hipay4

package
v0.0.0-...-560c451 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const C_pay_url = "https://order.5kj.one/payApi/PayApi/CreateOrder"
View Source
const C_withdrawal_url = "https://order.5kj.one/payApi/PayApi/CreatePayOutOrder"

Variables

View Source
var C_MD5_KEY = "a639a1225e168fc5a95d8f891f81e7d1"
View Source
var C_app_id = 175
View Source
var C_pay_code = 2121
View Source
var C_pay_notice_url = "https://fc5d-221-237-121-3.ngrok-free.app"
View Source
var C_trade_no = 1165
View Source
var C_withdrawal_code = 2122
View Source
var C_withdrawal_notice_url = "https://fc5d-221-237-121-3.ngrok-free.app"

Functions

func MD5

func MD5(str string) string

func Serialized

func Serialized(data any) string

func SignWithMd5

func SignWithMd5(data any) string

Types

type PayNotification

type PayNotification struct {
	PayNotificationInternal
	Sign string `json:"sign"`
}

func CheckPayNotification

func CheckPayNotification(body []byte) (resp PayNotification, err error)

type PayNotificationInternal

type PayNotificationInternal struct {
	TradeNo    int    `json:"trade_no"`
	Status     int    `json:"status"`
	OrderNo    string `json:"order_no"`
	DisOrderNo string `json:"dis_order_no"`
	OrderPrice int    `json:"order_price"`
	RealPrice  int    `json:"real_price"`
	Fee        int    `json:"fee"`
	NtiTime    int    `json:"nti_time"`
	Payer      string `json:"payer"`
	Attach     string `json:"attach"`
	CreateTime int    `json:"create_time"`
}

type PayRequest

type PayRequest struct {
	PayRequestInternal
	Sign string `json:"sign"`
}

type PayRequestInternal

type PayRequestInternal struct {
	TradeNo      int    `json:"trade_no"`
	OrderNo      string `json:"order_no"`
	AppId        int    `json:"app_id"`
	PayCode      int    `json:"pay_code"`
	Price        int    `json:"price"`
	SuccessUrl   string `json:"success_url"`
	FailUrl      string `json:"fail_url"`
	PayNoticeUrl string `json:"pay_notice_url"`
	PayRemindUrl string `json:"pay_remind_url"`
	Attach       string `json:"attach"`
	UserIp       string `json:"user_ip"`
	UserId       string `json:"user_id"`
}

type PayResponse

type PayResponse struct {
	Code       int    `json:"code"`
	Msg        string `json:"msg"`
	PayUrl     string `json:"pay_url"`
	QrCode     string `json:"qr_code"`
	OrderNo    string `json:"order_no"`
	DisOrderNo string `json:"dis_order_no"`
	Sign       string `json:"sign"`
	CreateTime int    `json:"create_time"`
}

func Pay

func Pay(ordersn string, amount int) (resp PayResponse, err error)

type WithdrawalNotification

type WithdrawalNotification struct {
	WithdrawalNotificationInternal
	Sign string `json:"sign"`
}

func CheckWithdrawalNotification

func CheckWithdrawalNotification(body []byte) (resp WithdrawalNotification, err error)

type WithdrawalNotificationInternal

type WithdrawalNotificationInternal struct {
	TradeNo    int    `json:"trade_no"`
	OrderNo    string `json:"order_no"`
	DisOrderNo string `json:"dis_order_no"`
	Price      int    `json:"price"`
	Fee        int    `json:"fee"`
	Status     int    `json:"status"`
	Remark     string `json:"remark"`
	Attach     string `json:"attach"`
	CreateTime int    `json:"create_time"`
}

type WithdrawalRequest

type WithdrawalRequest struct {
	WithdrawalRequestInternal
	Sign string `json:"sign"`
}

type WithdrawalRequestInternal

type WithdrawalRequestInternal struct {
	TradeNo      int    `json:"trade_no"`
	OrderNo      string `json:"order_no"`
	AppId        int    `json:"app_id"`
	PayCode      int    `json:"pay_code"`
	Price        int    `json:"price"`
	AccountType  string `json:"account_type"`
	AccountNo    string `json:"account_no"`
	AccountName  string `json:"account_name"`
	BankCode     string `json:"bank_code"`
	PayNoticeUrl string `json:"pay_notice_url"`
	Attach       string `json:"attach"`
}

type WithdrawalResponse

type WithdrawalResponse struct {
	WithdrawalResponseInternal
	Sign string `json:"sign"`
}

func Withdrawal

func Withdrawal(ordersn, accountNo, accountName, bank string, price int) (resp WithdrawalResponse, err error)

type WithdrawalResponseInternal

type WithdrawalResponseInternal struct {
	Code       int    `json:"code"`
	Msg        string `json:"msg"`
	Status     int    `json:"status"`
	OrderNo    string `json:"order_no"`
	DisOrderNo string `json:"dis_order_no"`
	CreateTime int    `json:"create_time"`
	Sign       string `json:"sign"`
}

Jump to

Keyboard shortcuts

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