hipay2

package
v1.2.31 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const TypeWithdrawalCallback = "withdrawal:hipay2"

Variables

View Source
var Banks map[string]string
View Source
var MerchantKey string = "" /* 160-byte string literal not displayed */
View Source
var RedisAddr = ""
View Source
var RedisPwd = ""
View Source
var WithdrawalCallbackUrl = ""

Functions

func GetBanks added in v1.2.28

func GetBanks() (banks map[string]string, err error)

func Init added in v1.2.28

func Init(MerchantKey, RedisAddr, RedisPwd, WithdrawalCallbackUrl string)

func PayCallbackDecode

func PayCallbackDecode(body []byte) (ordersn, amount string, err error)

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 StartMQ added in v1.2.28

func StartMQ()

func VerifyTransfer added in v1.2.28

func VerifyTransfer(orderSn string) (ok bool, err error)

Types

type GetBanksRequest added in v1.2.28

type GetBanksRequest struct {
	MerchantKey string `json:"merchant_key"`
}

type GetBanksResponse added in v1.2.28

type GetBanksResponse struct {
	Status bool `json:"status"`
	Banks  []struct {
		Code string `json:"code"`
		Name string `json:"name"`
	} `json:"banks"`
}

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 VerifyTransferRequest struct {
	Ref         string `json:"ref"`
	MerchantKey string `json:"merchant_key"`
}

type VerifyTransferResponse added in v1.2.28

type VerifyTransferResponse struct {
	Amount      string `json:"amount"`
	Reference   string `json:"reference"`
	Description string `json:"description"`
	Message     string `json:"message"`
	Status      string `json:"status"`
	Ref         string `json:"ref"`
}

type WithdrawalInfoInternalTask added in v1.2.28

type WithdrawalInfoInternalTask struct {
	OrderSn string `json:"orderSn"`
	Amount  string `json:"amount"`
}

type WithdrawalInfoTask added in v1.2.28

type WithdrawalInfoTask struct {
	WithdrawalInfoInternalTask
	CallCount   int
	ProcessTime int
}

type WithdrawalRequest added in v1.2.28

type WithdrawalRequest struct {
	Amount        int    `json:"amount"`
	SortCode      string `json:"sortCode"`
	Narration     string `json:"narration"`
	AccountNumber string `json:"accountNumber"`
	AccountName   string `json:"accountName"`
	MerchantKey   string `json:"merchant_key"`
	Ref           string `json:"ref"`
}

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"
}

Jump to

Keyboard shortcuts

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