Documentation ¶
Index ¶
- Constants
- type PayloadBase
- type PaymentProvider
- func (s *PaymentProvider) Close(payment *base.Payment) error
- func (s *PaymentProvider) CreatePayment(payment *base.Payment) (*base.CreatePaymentResp, error)
- func (s *PaymentProvider) GetNotifyController() *base.PaymentNotifyController
- func (s *PaymentProvider) GetPayment(query *base.PaymentQuery) (*base.PaymentNotify, error)
- func (s *PaymentProvider) Init(paymentUrl string, endpoint *base.PaymentEndpoint) error
- func (s *PaymentProvider) QueryRefund(query *base.QueryRefund) (*base.QueryRefundResp, error)
- func (s *PaymentProvider) QueryTransfer(query *base.QueryTransfer) (*base.QueryTransferResp, error)
- func (s *PaymentProvider) Refund(payment *base.Payment) error
- func (s *PaymentProvider) Transfer(transfer *base.PaymentTransfer) error
- type ReqClosePayment
- type ReqNotify
- type ReqOrder
- type ReqOrderQuery
- type ReqQueryRefund
- type ReqRefund
- type ReqTransfer
- type ReqTransferQuery
- type RespClosePayment
- type RespErr
- type RespNotify
- type RespQueryRefund
- type RespQueryTransfer
- type RespRefund
- type RespReturn
- type RespTransfer
- type ResqOrder
Constants ¶
View Source
const ( ResultSuccess = "SUCCESS" ResultFail = "FAIL" )
View Source
const (
NotifyEndpoint = "/v1/payment-wechat"
)
View Source
const (
TradeTypeMiniProgram = "JSAPI"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PayloadBase ¶
type PaymentProvider ¶
type PaymentProvider struct { base.BasePaymentProvider // contains filtered or unexported fields }
func (*PaymentProvider) CreatePayment ¶
func (s *PaymentProvider) CreatePayment(payment *base.Payment) (*base.CreatePaymentResp, error)
func (*PaymentProvider) GetNotifyController ¶
func (s *PaymentProvider) GetNotifyController() *base.PaymentNotifyController
func (*PaymentProvider) GetPayment ¶
func (s *PaymentProvider) GetPayment(query *base.PaymentQuery) (*base.PaymentNotify, error)
func (*PaymentProvider) Init ¶
func (s *PaymentProvider) Init(paymentUrl string, endpoint *base.PaymentEndpoint) error
func (*PaymentProvider) QueryRefund ¶
func (s *PaymentProvider) QueryRefund(query *base.QueryRefund) (*base.QueryRefundResp, error)
退款查询
func (*PaymentProvider) QueryTransfer ¶
func (s *PaymentProvider) QueryTransfer(query *base.QueryTransfer) (*base.QueryTransferResp, error)
func (*PaymentProvider) Transfer ¶
func (s *PaymentProvider) Transfer(transfer *base.PaymentTransfer) error
type ReqClosePayment ¶
type ReqClosePayment struct { PayloadBase AppKey string `xml:"appid" json:"appid"` MchKey string `xml:"mch_id" json:"mch_id"` NonceStr string `xml:"nonce_str" json:"nonce_str"` Sign string `xml:"sign" json:"sign"` TradeNo string `xml:"out_trade_no" json:"out_trade_no"` }
func (*ReqClosePayment) FromPayment ¶
func (s *ReqClosePayment) FromPayment(payment *base.Payment)
func (*ReqClosePayment) GenerateSign ¶
func (s *ReqClosePayment) GenerateSign(secret string)
type ReqNotify ¶
type ReqNotify struct { PayloadBase RespReturn ResultCode string `xml:"result_code"` TradeNo string `xml:"out_trade_no"` TradeState string `xml:"trade_state"` }
func (*ReqNotify) ToPaymentNotify ¶
func (s *ReqNotify) ToPaymentNotify() *base.PaymentNotify
type ReqOrder ¶
type ReqOrder struct { PayloadBase AppKey string `xml:"appid" json:"appid"` MchKey string `xml:"mch_id" json:"mch_id"` NonceStr string `xml:"nonce_str" json:"nonce_str"` Sign string `xml:"sign" json:"sign"` Boby string `xml:"body" json:"body"` TradeNo string `xml:"out_trade_no" json:"out_trade_no"` TotalFee int `xml:"total_fee" json:"total_fee"` SpbillCreateIP string `xml:"spbill_create_ip" json:"spbill_create_ip"` NotifyUrl string `xml:"notify_url" json:"notify_url"` TradeType string `xml:"trade_type" json:"trade_type"` OpenID string `xml:"openid" json:"openid"` }
func (*ReqOrder) FromPayment ¶
func (*ReqOrder) GenerateSign ¶
type ReqOrderQuery ¶
type ReqOrderQuery struct { PayloadBase AppKey string `xml:"appid" json:"appid"` MchKey string `xml:"mch_id" json:"mch_id"` TradeNo string `xml:"out_trade_no" json:"out_trade_no"` NonceStr string `xml:"nonce_str" json:"nonce_str"` Sign string `xml:"sign" json:"sign"` }
func (*ReqOrderQuery) GenerateSign ¶
func (s *ReqOrderQuery) GenerateSign(secret string)
type ReqQueryRefund ¶
type ReqQueryRefund struct { PayloadBase AppKey string `xml:"appid" json:"appid"` MchKey string `xml:"mch_id" json:"mch_id"` NonceStr string `xml:"nonce_str" json:"nonce_str"` Sign string `xml:"sign" json:"sign"` TradeNo string `xml:"out_trade_no" json:"out_trade_no"` }
func (*ReqQueryRefund) FromQueryRefund ¶
func (s *ReqQueryRefund) FromQueryRefund(query *base.QueryRefund)
func (*ReqQueryRefund) GenerateSign ¶
func (s *ReqQueryRefund) GenerateSign(secret string)
type ReqRefund ¶
type ReqRefund struct { PayloadBase AppKey string `xml:"appid" json:"appid"` MchKey string `xml:"mch_id" json:"mch_id"` NonceStr string `xml:"nonce_str" json:"nonce_str"` Sign string `xml:"sign" json:"sign"` TradeNo string `xml:"out_trade_no" json:"out_trade_no"` RefundNo string `xml:"out_refund_no" json:"out_refund_no"` TotalFee int `xml:"total_fee" json:"total_fee"` RefundFee int `xml:"refund_fee" json:"refund_fee"` }
func (*ReqRefund) FromPayment ¶
func (*ReqRefund) GenerateSign ¶
type ReqTransfer ¶
type ReqTransfer struct { PayloadBase AppKey string `xml:"mch_appid" json:"mch_appid"` MchKey string `xml:"mchid" json:"mchid"` NonceStr string `xml:"nonce_str" json:"nonce_str"` Sign string `xml:"sign" json:"sign"` TradeNo string `xml:"partner_trade_no" json:"partner_trade_no"` OpenID string `xml:"openid" json:"openid"` CheckName string `xml:"check_name" json:"check_name"` TotalFee int `xml:"amount" json:"amount"` Desc string `xml:"desc" json:"desc"` }
func (*ReqTransfer) FromPaymentTransfer ¶
func (s *ReqTransfer) FromPaymentTransfer(transfer *base.PaymentTransfer)
func (*ReqTransfer) GenerateSign ¶
func (s *ReqTransfer) GenerateSign(secret string)
type ReqTransferQuery ¶
type ReqTransferQuery struct { PayloadBase AppKey string `xml:"appid" json:"appid"` MchKey string `xml:"mch_id" json:"mch_id"` NonceStr string `xml:"nonce_str" json:"nonce_str"` Sign string `xml:"sign" json:"sign"` TradeNo string `xml:"partner_trade_no" json:"partner_trade_no"` }
func (*ReqTransferQuery) FromTransferQuery ¶
func (s *ReqTransferQuery) FromTransferQuery(transfer *base.QueryTransfer)
func (*ReqTransferQuery) GenerateSign ¶
func (s *ReqTransferQuery) GenerateSign(secret string)
type RespClosePayment ¶
type RespClosePayment struct { PayloadBase RespReturn RespErr ResultCode string `xml:"result_code"` }
type RespNotify ¶
type RespNotify struct { PayloadBase RespReturn }
type RespQueryRefund ¶
type RespQueryRefund struct { PayloadBase RespReturn RespErr ResultCode string `xml:"result_code"` TradeNo string `xml:"out_trade_no" json:"out_trade_no"` Status string `xml:"refund_status_0"` }
func (*RespQueryRefund) ToQueryRefundResp ¶
func (s *RespQueryRefund) ToQueryRefundResp() *base.QueryRefundResp
type RespQueryTransfer ¶
type RespQueryTransfer struct { PayloadBase RespReturn RespErr ResultCode string `xml:"result_code"` Status string `xml:"status"` Reason string `xml:"reason"` }
func (*RespQueryTransfer) ToQueryTransferResp ¶
func (s *RespQueryTransfer) ToQueryTransferResp() *base.QueryTransferResp
type RespRefund ¶
type RespRefund struct { PayloadBase RespReturn RespErr ResultCode string `xml:"result_code"` TradeNo string `xml:"out_trade_no" json:"out_trade_no"` }
type RespReturn ¶
type RespTransfer ¶
type RespTransfer struct { PayloadBase RespReturn RespErr ResultCode string `xml:"result_code"` TradeNo string `xml:"partner_trade_no"` PaymentNo string `xml:"payment_no"` }
type ResqOrder ¶
type ResqOrder struct { PayloadBase RespReturn RespErr ResultCode string `xml:"result_code"` PrepayID string `xml:"prepay_id"` }
Click to show internal directories.
Click to hide internal directories.