Documentation
¶
Index ¶
- type AppPayConfig
- type MchTransfersParams
- type NotifyResult
- type NotifyReturn
- type Params
- type Pay
- func (pcf *Pay) AppPayParams(prePayID string) AppPayConfig
- func (pcf *Pay) JSPayParams(prePayID string) PayConfig
- func (pcf *Pay) MchPay(p *Params) error
- func (pcf *Pay) PrePayId(p *Params) (prePayID string, err error)
- func (pcf *Pay) PrePayIdByApp(p *Params) (prePayID string, err error)
- func (pcf *Pay) PrePayIdByJs(p *Params) (prePayID string, err error)
- func (pcf *Pay) PrePayOrder(p *Params) (payOrder PreOrder, err error)
- func (pcf *Pay) PrePayOrderByApp(p *Params) (payOrder PreOrder, err error)
- func (pcf *Pay) PrePayOrderByJs(p *Params) (payOrder PreOrder, err error)
- func (pcf *Pay) PrePayOrderByMiniApp(p *Params) (payOrder PreOrder, err error)
- func (pcf *Pay) SendRed(p *Params) (string, error)
- func (pcf *Pay) Sign(variable interface{}, key string) (sign string, err error)
- func (pcf *Pay) SignByJson(variable interface{}, key string) (sign string, err error)
- type PayConfig
- type PreOrder
- type RedParams
- type RedResult
- type SignStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppPayConfig ¶
type AppPayConfig struct {
AppID string `xml:"appid" json:"appid"`
PartnerID string `xml:"partnerid" json:"partnerid"`
PrePayID string `xml:"prepayid" json:"prepayid"`
Package string `xml:"package" json:"package"`
NonceStr string `xml:"noncestr" json:"noncestr"`
Timestamp string `xml:"timestamp" json:"timestamp"`
Sign string `xml:"sign" json:"sign"`
}
type MchTransfersParams ¶
type MchTransfersParams struct {
InputCharset string `xml:"input_charset"`
MchID string `xml:"mch_id"`
NonceStr string `xml:"nonce_str"`
Sign string `xml:"sign"`
OutTradeNo string `xml:"out_trade_no"`
TotalFee int `xml:"total_fee"`
Memo string `xml:"memo"`
AppID string `xml:"appid"`
OpenID string `xml:"openid"`
OpUserID string `xml:"op_user_id"`
OpUserPasswd string `xml:"op_user_passwd"`
SpbillCreateIp string `xml:"spbill_create_ip"`
}
type NotifyResult ¶
type NotifyResult struct {
ReturnCode string `xml:"return_code"`
ReturnMsg string `xml:"return_msg"`
Appid string `xml:"appid"`
MchID string `xml:"mch_id"`
NonceStr string `xml:"nonce_str"`
Sign string `xml:"sign"`
DeviceInfo string `xml:"device_info"`
TradeType string `xml:"trade_type"`
BankType string `xml:"bank_type"`
FeeType string `xml:"fee_type"`
TotalFee string `xml:"total_fee"`
CashFee string `xml:"cash_fee"`
CouponFee string `xml:"coupon_fee"`
TransactionId string `xml:"transaction_id"`
OutTradeNo string `xml:"out_trade_no"`
Attach string `xml:"attach"`
TimeEnd string `xml:"time_end"`
Openid string `xml:"openid"`
ResultCode string `xml:"result_code"`
ErrCode string `xml:"err_code"`
ErrCodeDes string `xml:"err_code_des"`
}
type NotifyReturn ¶
type Params ¶
type Params struct {
TotalFee int
CreateIP string
Body string
OutTradeNo string
TradeType string
MiniAppParam string
OpenID string
ContractCode string
PromotionTag string
Attach string
//以下红包使用
Wishing string
SendName string
ActName string
IconID int
BannerID int
NotifyUrl string
}
传入的参数,用于生成 prepay_id 的必需参数 PayParams was NEEDED when request unifiedorder
type Pay ¶
Pay struct extends context
func (*Pay) AppPayParams ¶
func (pcf *Pay) AppPayParams(prePayID string) AppPayConfig
func (*Pay) JSPayParams ¶
func (*Pay) PrePayId ¶
PrePayId will request wechat merchant api and request for a pre payment order id
func (*Pay) PrePayOrderByApp ¶
func (*Pay) PrePayOrderByJs ¶
func (*Pay) PrePayOrderByMiniApp ¶
type PayConfig ¶
type PayConfig struct {
AppID string `xml:"appId" json:"appId"`
TimeStamp string `xml:"timeStamp" json:"timeStamp"`
NonceStr string `xml:"nonceStr" json:"nonceStr"`
Package string `xml:"package" json:"package"`
SignType string `xml:"signType" json:"signType"`
PaySign string `xml:"paySign" json:"paySign"`
}
PayConfig 是传出用于 jsdk 用的参数
type PreOrder ¶
type PreOrder struct {
ReturnCode string `xml:"return_code"`
ReturnMsg string `xml:"return_msg"`
AppID string `xml:"appid,omitempty"`
MchID string `xml:"mch_id,omitempty"`
NonceStr string `xml:"nonce_str,omitempty"`
Sign string `xml:"sign,omitempty"`
ResultCode string `xml:"result_code,omitempty"`
TradeType string `xml:"trade_type,omitempty"`
PrePayID string `xml:"prepay_id,omitempty"`
CodeURL string `xml:"code_url,omitempty"`
ErrCode string `xml:"err_code,omitempty"`
ErrCodeDes string `xml:"err_code_des,omitempty"`
}
type RedParams ¶
type RedParams struct {
Charset int `json:"charset" xml:"charset"` //必填 1 utf8 , 2 gbk
NonceStr string `json:"nonce_str" xml:"nonce_str"` //必填
Sign string `json:"sign" xml:"sign"` //必填
MchBillno string `json:"mch_billno" xml:"mch_billno"` //必填 订单号
MchID string `json:"mch_id" xml:"mch_id"` //必填
MchName string `json:"mch_name" xml:"mch_name"` //必填//商户名称,会展示在红包领取页面上
QqAppID string `json:"qqappid" xml:"qqappid"` //必填
ReOpenID string `json:"re_openid" xml:"re_openid"` //必填
TotalAmount int `json:"total_amount" xml:"total_amount"` //必填
TotalNum int `json:"total_num" xml:"total_num"` //必填
Wishing string `json:"wishing" xml:"wishing"` //必填
ActName string `json:"act_name" xml:"act_name"` //必填
IconID int `json:"icon_id" xml:"icon_id"` //必填
BannerID int `json:"banner_id,omitempty" xml:"banner_id,omitempty"`
NotifyUrl string `json:"notify_url,omitempty" xml:"notify_url,omitempty"`
NotSendMsg int `json:"not_send_msg,omitempty" xml:"not_send_msg,omitempty"`
MinValue int `json:"min_value" xml:"min_value"` //必填 1
MaxValue int `json:"max_value" xml:"max_value"` //必填 100
}
Click to show internal directories.
Click to hide internal directories.