Documentation
¶
Index ¶
- func GetAccessToken(appId, secret, code string) (*string, *string, error)
- type WeChatPay
- func (p WeChatPay) H5PrePay(ctx context.Context, appId, mchId, title, tradeNo, notifyUrl string, ...) (*string, error)
- func (p WeChatPay) JsApiPay(ctx context.Context, appId, mchId, title, tradeNo, notifyUrl, openId string, ...) (*string, error)
- func (p WeChatPay) NativePrePay(ctx context.Context, appId, mchId, title, tradeNo, notifyUrl string, ...) (*string, error)
- func (p WeChatPay) QueryRefund(ctx context.Context, refundNo string) (*time.Time, error)
- func (p WeChatPay) Refund(ctx context.Context, title, tradeNo, refundNo, reason string, ...) error
- type WechatUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type WeChatPay ¶
type WeChatPay struct {
// contains filtered or unexported fields
}
func NewWeChatPay ¶
func NewWeChatPay(ctx context.Context, mchID, mchCertificateSerialNumber, mchAPIv3Key, apiClientKeyPath string) (*WeChatPay, error)
NewWeChatPay mchCertificateSerialNumber 商户证书序列号 mchAPIv3Key 商户APIv3密钥 apiClientKeyPath 商户私钥路径
func (WeChatPay) H5PrePay ¶
func (p WeChatPay) H5PrePay(ctx context.Context, appId, mchId, title, tradeNo, notifyUrl string, amount int64, payerClientIP *string) (*string, error)
H5PrePay h5支付
func (WeChatPay) NativePrePay ¶
func (p WeChatPay) NativePrePay(ctx context.Context, appId, mchId, title, tradeNo, notifyUrl string, amount int64) (*string, error)
NativePrePay Native支付
func (WeChatPay) QueryRefund ¶
type WechatUser ¶
type WechatUser struct { OpenId string `json:"openid"` Nickname string `json:"nickname"` Sex uint32 `json:"sex"` Province string `json:"province"` City string `json:"city"` Country string `json:"country"` HeadImgUrl string `json:"headimgurl"` Privilege []string `json:"privilege"` UnionId string `json:"unionid"` }
func GetUserInfo ¶
func GetUserInfo(accessToken, openid string) (*WechatUser, error)
Click to show internal directories.
Click to hide internal directories.