rl404 / ovo-go

Unofficial golang API wrapper for ovo.id.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ovo-go

Go Report Card License: MIT Go Reference

ovo-go is unofficial golang API wrapper for OVO.

Features

  • Inquiry customer phone number
  • Create push-to-pay transaction
  • Create reversal push-to-pay transaction
  • Void transaction
  • Get transaction

Installation

go get github.com/rl404/ovo-go

Quick Start

package main

import (
	"log"

	"github.com/rl404/ovo-go"
)

func main() {
	// Prepare credentials.
	appID := "appID"
	key := "key123"
	tid := "123"
	mid := "123"
	merchantID := "123"
	storeCode := "ABC123"

	// Create ovo client.
	o := ovo.NewDefault(appID, key, tid, mid, merchantID, storeCode, ovo.Sandbox)

	// Create transaction.
	tx, code, err := o.GetStatus(ovo.GetStatusRequest{
		Amount:          10000,
		Phone:           "081234567890",
		MerchantInvoice: "invoice123",
		ReferenceNumber: 1,
		BatchNo:         1,
	})
	if err != nil {
		log.Println(code, err)
		return
	}

	log.Println(code, tx)
}

For more detail config and usage, please go to the documentation.

License

MIT License

Copyright (c) 2021 Axel

About

Unofficial golang API wrapper for ovo.id.

License:MIT License


Languages

Language:Go 100.0%