Register first in oxapayments and create ur apikey in merchant
go get github.com/hackincloud-com/go-oxapayments
Just load the config with all the credentials and config from InitConfig
then add your configurations using these functions
var payment = oxapayments.InitConfig(
oxapayments.WithCurrency("USDT"),
oxapayments.WithApiKey("sandbox"),
)
func Basic_Usage() {
// Set an value for payment
payment.OrderId = "ORDER-1"
payment.Description = "Order For Mango"
payment.Email = "[email protected]"
payment.Amount = 1
// Set Merchants api to start invoice
req := payment.Set("https://api.oxapay.com/merchants/request")
results := payment.Start(req)
// see the examples func below
CheckPaymentInfo(results.RespInvoice.TrackID)
// get the paylink
fmt.Println(results.PayLink)
}
func CheckPaymentInfo(IdFromInvoice string){
// Track Transaction status and more
payment.TrackID = IdFromInvoice
getinfo := payment.Set("https://api.oxapay.com/merchants/inquiry")
res := payment.Start(getinfo)
// status trx
fmt.Println(res.Status)
}
The URL where payment information will be sent. Use this to receive notifications about the payment status. ( disclaimer : im using fiber )