Documentation ¶
Index ¶
- Constants
- Variables
- func GetBanks() (banks map[string]string, err error)
- func Init(MerchantKey, RedisAddr, RedisPwd, WithdrawalCallbackUrl string)
- func PayCallbackDecode(body []byte) (ordersn, amount string, err error)
- func StartMQ()
- func VerifyTransfer(orderSn string) (ok bool, err error)
- type GetBanksRequest
- type GetBanksResponse
- type Hipay2RequestBody
- type VerifyTransferRequest
- type VerifyTransferResponse
- type WithdrawalInfoInternalTask
- type WithdrawalInfoTask
- type WithdrawalRequest
- type WithdrawalResponse
Constants ¶
const TypeWithdrawalCallback = "withdrawal:hipay2"
Variables ¶
var Banks map[string]string
var MerchantKey string = "" /* 160-byte string literal not displayed */
var RedisAddr = ""
var RedisPwd = ""
var WithdrawalCallbackUrl = ""
Functions ¶
func Init ¶ added in v1.2.28
func Init(MerchantKey, RedisAddr, RedisPwd, WithdrawalCallbackUrl string)
func PayCallbackDecode ¶
http.body {"customer_name":"recharge","customer_id":"RRH1754017732237463553","actual_amount":"1000.00","amount_sent_to_merchant":955,"percentage_amount":45,"merchant_key":"VICT_live_jmpqE0TsM35rA1Q8pxyM48EAcUiP09BzI6CzXkaBHwa6XLx6MlgcVwRIPYR4xzJB4Es0rcFpaxoTSNjQrI3DsfXUNUVUFyCLwJTSuHYvoMXtuxfCbnM5S2c1YMFH7TNXGBfqojjbOKHquswq8eIHkf","accountNumber":null,"senderAccountNumber":"1026687219","senderAccountName":"AK ENTERTAINMENT","sessionID":null,"status":"success"} hipay2 pay callback
func VerifyTransfer ¶ added in v1.2.28
Types ¶
type GetBanksRequest ¶ added in v1.2.28
type GetBanksRequest struct {
MerchantKey string `json:"merchant_key"`
}
type GetBanksResponse ¶ added in v1.2.28
type Hipay2RequestBody ¶
type Hipay2RequestBody struct { CustomerName string `json:"customer_name"` CustomerId string `json:"customer_id"` ActualAmount string `json:"actual_amount"` AmountSentToMerchant int `json:"amount_sent_to_merchant"` PercentageAmount int `json:"percentage_amount"` MerchantKey string `json:"merchant_key"` AccountNumber interface{} `json:"accountNumber"` SenderAccountNumber string `json:"senderAccountNumber"` SenderAccountName string `json:"senderAccountName"` SessionID interface{} `json:"sessionID"` Status string `json:"status"` }
type VerifyTransferRequest ¶ added in v1.2.28
type VerifyTransferResponse ¶ added in v1.2.28
type WithdrawalInfoInternalTask ¶ added in v1.2.28
type WithdrawalInfoTask ¶ added in v1.2.28
type WithdrawalInfoTask struct { WithdrawalInfoInternalTask CallCount int ProcessTime int }
type WithdrawalRequest ¶ added in v1.2.28
type WithdrawalResponse ¶ added in v1.2.28
type WithdrawalResponse struct { AccountName string `json:"accountName"` AccountNumber string `json:"accountNumber"` Amount int `json:"amount"` Reference string `json:"reference"` Description string `json:"description"` Message string `json:"message"` Status bool `json:"status"` Ref string `json:"ref"` }
func Withdrawal ¶ added in v1.2.28
func Withdrawal(ordersn, bank, accountName, accountId, amount string) (result WithdrawalResponse, err error)
http request:
{"amount":1000,"sortCode":"000004","narration":"withdrawal","accountNumber":"1025433691","accountName":"xiahong chen","merchant_key":"VICT_live_jmpqE0TsM35rA1Q8pxyM48EAcUiP09BzI6CzXkaBHwa6XLx6MlgcVwRIPYR4xzJB4Es0rcFpaxoTSNjQrI3DsfXUNUVUFyCLwJTSuHYvoMXtuxfCbnM5S2c1YMFH7TNXGBfqojjbOKHquswq8eIHkf","ref":"HIPAY220240204164747"}
http response:
{ "accountName": "XIAHONG CHEN", "accountNumber": "1025433691", "amount": 1000, "reference": "u7FYJ6MuxoV4Cb8gxby2MetxFaEbQGGLkgPJ", "description": "Transfer of NGN1,000 to XIAHONG CHEN (1025433691\/UNITED BANK FOR AFRICA)", "message": "Transaction successfully completed.", "status": true, "ref": "HIPAY220240204164747" }