Saman payment library for Go Language. Which includes saman web api methods for connect to bank and verify transaction and reverse transaction.
Installation is done using go get
.
go get -u github.com/aliworkshop/samanpayment
- GetTokenRequest
- VerifyTransactionRequest
- ReverseTransactionRequest
this method use for get token from bank webservice for connect to the bank payment gateway
this method receives 5 following parameter for get token
Parameter | Type |
---|---|
resnum |
String |
amount |
Integer |
payer_phone |
String |
callback_url |
String |
transaction_key |
Integer |
saman := samanpayment.SamanConfig{
TerminalId: 123456789,
}
result, err := saman.GetTokenRequest(resnum, transaction_key, amount, callback_url, mobile)
this method use for verify transaction and update database if payment was successful
this method receive 2 parameters included transaction_key that you set it before and refnum that you get it from bank response in callback
saman := samanpayment.SamanConfig{
TerminalId: 123456789,
}
res, err := saman.VerifyTransactionRequest(transaction_key, resp.RefNum)
this method use for reverse transaction that was unsuccessful
this method receive 2 parameters included transaction_key that you set it before and refnum that you get it from bank response in callback
saman := samanpayment.SamanConfig{
TerminalId: 123456789,
}
res, err := saman.VerifyTransactionRequest(transaction_key, resp.RefNum)
Ali Torabi If this library helps you in anyway, show your love ❤️ by putting a ⭐ on this project ✌️