Tokopay

package module
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 2 Imported by: 0

README

go-tokopay Client for Golang

This library is the abstraction of go-tokopay API for access from applications written with Golang.

Instalasi

go get github.com/pycodeDev/go-tokopay

How To Use

Get Your Merchant ID and Secret Key at go-tokopay Dashboard.

Get Info Merchant

prepare your struct to use this func.

type ParamInfoMerchant struct {
    MerchantId string
    Secret string
    Idr bool
}

Note: Idr (true) if you want get your balance in indonesian rupiahs format

call the func

    response, err := go-tokopay.GetInfoMerchant(ParamInfoMerchant)
    if err != nil
    {
        fmt.Println(err)
    }

get the response

response.MerchantName //name of merchant
response.Balance // balance of merchant available to pull
response.BalanceHold // balance of merchant hold
Order Simple

prepare your struct to use this func.

type ParamOrderSimple struct {
    MerchantId string
    Secret string
    Method string
    RefId string
    Nominal int
    Idr bool
}

Note: Idr (true) if you want get your balance in indonesian rupiahs format

call the func

    response, err := go-tokopay.Order(ParamOrderSimple)
    if err != nil
    {
        fmt.Println(err)
    }

get the response

response.Data // like nomor_va, checkout_url, qr_link
response.PanduanPembayaran // guide for pay
response.PayUrl // route after pay the payment
response.Status // status transaction
response.TrxId // trx id if your transaction problem, send to go-tokopay cs

Note: Idr (true) if you want get your balance in indonesian rupiahs format

License

MIT

Author

Muhammad Anang Ramadhan

Documentation

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL