common

package
v0.0.0-...-c10a5fe Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliQueryResult

type AliQueryResult struct {
	TradeNo        string `json:"trade_no"`
	OutTradeNo     string `json:"out_trade_no"`
	OpenID         string `json:"open_id"`
	BuyerLogonID   string `json:"buyer_logon_id"`
	TradeStatus    string `json:"trade_status"`
	TotalAmount    string `json:"total_amount"`
	ReceiptAmount  string `json:"receipt_amount"`
	BuyerPayAmount string `json:"BuyerPayAmount"`
	PointAmount    string `json:"point_amount"`
	InvoiceAmount  string `json:"invoice_amount"`
	SendPayDate    string `json:"send_pay_date"`
	AlipayStoreID  string `json:"alipay_store_id"`
	StoreID        string `json:"store_id"`
	TerminalID     string `json:"terminal_id"`
	FundBillList   []struct {
		FundChannel string `json:"fund_channel"`
		Amount      string `json:"amount"`
	} `json:"fund_bill_list"`
	StoreName           string `json:"store_name"`
	BuyerUserID         string `json:"buyer_user_id"`
	DiscountGoodsDetail string `json:"discount_goods_detail"`
	IndustrySepcDetail  string `json:"industry_sepc_detail"`
}

支付宝查询结果结构体

type AliWebPayResult

type AliWebPayResult struct {
	NotifyTime       string `json:"notify_time"`
	NotifyType       string `json:"notify_type"`
	NotifyID         string `json:"notify_id"`
	SignType         string `json:"sign_type"`
	Sign             string `json:"sign"`
	OutTradeNum      string `json:"out_trade_no"`
	Subject          string `json:"subject"`
	PayMentType      string `json:"payment_type"`
	TradeNum         string `json:"trade_no"`
	TradeStatus      string `json:"trade_status"`
	GmtPayMent       string `json:"gmt_payment"`
	GmtClose         string `json:"gmt_close"`
	SellerEmail      string `json:"seller_email"`
	BuyerEmail       string `json:"buyer_email"`
	SellerID         string `json:"seller_id"`
	BuyerID          string `json:"buyer_id"`
	Price            string `json:"price"`
	TotalFee         string `json:"total_fee"`
	Quantity         string `json:"quantity"`
	Body             string `json:"body"`
	Discount         string `json:"discount"`
	IsTotalFeeAdjust string `json:"is_total_fee_adjust"`
	UseCoupon        string `json:"use_coupon"`
	RefundStatus     string `json:"refund_status"`
	GmtRefund        string `json:"gmt_refund"`
}

支付宝支付结果回调结构体

type BaseResult

type BaseResult struct {
	IsSucceed     bool   // 是否交易成功
	TradeNum      string // 交易流水号
	MoneyFee      int64  // 支付金额
	TradeTime     string // 交易时间
	ContractNum   string // 交易单号
	UserInfo      string // 支付账号信息(有可能有,有可能没有)
	ThirdDiscount int64  // 第三方优惠
}

支付结果

type CallbackReturn

type CallbackReturn struct {
	IsSucceed     bool   `json:"isSucceed"`
	OrderNum      string `json:"orderNum"`
	TradeNum      string `json:"tradeNum"`
	UserID        string `json:"userID"`
	MoneyFee      int64  `json:"moneyFee"`
	Sign          string `json:"sign"`
	ThirdDiscount int64  `json:"thirdDiscount"`
}

回调业务代码时的参数

type Charge

type Charge struct {
	TradeNum    string `json:"tradeNum,omitempty"`
	Origin      string `json:"origin,omitempty"`
	UserID      string `json:"userId,omitempty"`
	PayMethod   int64  `json:"payMethod,omitempty"`
	MoneyFee    int64  `json:"MoneyFee,omitempty"`
	CallbackURL string `json:"callbackURL,omitempty"`
	ReturnURL   string `json:"returnURL,omitempty"`
	ShowURL     string `json:"showURL,omitempty"`
	Describe    string `json:"describe,omitempty"`
	OpenID      string `json:"openid,omitempty"`
}

支付参数

type PayCallback

type PayCallback struct {
	Origin      string `json:"origin"`
	TradeNum    string `json:"trade_num"`
	OrderNum    string `json:"order_num"`
	CallBackURL string `json:"callback_url"`
	Status      int64  `json:"status"`
}

支付返回

type PayClient

type PayClient interface {
	Pay(charge *Charge) (string, error)
}

支付客户端接口

type WeChatPayResult

type WeChatPayResult struct {
	WechatBaseResult
	WechatReturnData
	WechatResultData
}

微信支付回调结果结构体

type WeChatQueryResult

type WeChatQueryResult struct {
	WechatBaseResult
	WechatReturnData
	WechatResultData
	TradeState     string `xml:"trade_state"`
	TradeStateDesc string `xml:"trade_state_desc"`
}

微信查询结果结构体

type WeChatReResult

type WeChatReResult struct {
	ReturnCode string `xml:"return_code"`
	ReturnMsg  string `xml:"return_msg"`

	AppID      string `xml:"appid"`
	MchID      string `xml:"mch_id"`
	DeviceInfo string `xml:"device_info"`
	NonceStr   string `xml:"nonce_str"`
	Sign       string `xml:"sign"`
	ResultCode string `xml:"result_code"`
	ErrCode    string `xml:"err_code"`
	ErrCodeDes string `xml:"err_code_des"`

	TradeType string `xml:"trade_type"`
	PrepayID  string `xml:"prepay_id"`
	CodeURL   string `xml:"code_url"`
}

微信支付返回结构体

type WechatBaseResult

type WechatBaseResult struct {
	ReturnCode string `xml:"return_code"`
	ReturnMsg  string `xml:"return_msg"`
}

微信基本信息

type WechatResultData

type WechatResultData struct {
	OpenID        string `xml:"openid,emitempty"`
	IsSubscribe   string `xml:"is_subscribe,emitempty"`
	TradeType     string `xml:"trade_type,emitempty"`
	BankType      string `xml:"bank_type,emitempty"`
	FeeType       string `xml:"fee_type,emitempty"`
	TotalFee      int64  `xml:"total_fee,emitempty"`
	CashFeeType   string `xml:"cash_fee_type,emitempty"`
	CashFee       int64  `xml:"cash_fee,emitempty"`
	TransactionID string `xml:"transaction_id,emitempty"`
	OutTradeNO    string `xml:"out_trade_no,emitempty"`
	Attach        string `xml:"attach,emitempty"`
	TimeEnd       string `xml:"time_end,emitempty"`
}

微信结果通用数据

type WechatReturnData

type WechatReturnData struct {
	AppID      string `xml:"appid,emitempty"`
	MchID      string `xml:"mch_id,emitempty"`
	DeviceInfo string `xml:"device_info,emitempty"`
	NonceStr   string `xml:"nonce_str,emitempty"`
	Sign       string `xml:"sign,emitempty"`
	ResultCode string `xml:"result_code,emitempty"`
	ErrCode    string `xml:"err_code,emitempty"`
	ErrCodeDes string `xml:"err_code_des,emitempty"`
}

微信返回通用数据

Jump to

Keyboard shortcuts

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