package
0.1.3
Repository: https://github.com/huangjunwen/wx-driver.git
Documentation: pkg.go.dev

# Functions

CloseOrder 关闭订单接口.
DecryptMchXML 解密一个加密了的 MchXML,目前主要用在退款结果通知,也许未来还有其它地方会用到 NOTE: 最终用户一般不需要使用该函数.
HandleMchXML 处理 mch xml 回调,若 handler 返回非 nil error,则该 http.Handler 返回 FAIL return_code 给微信 NOTE: 最终用户一般不需要使用该函数.
HandleSignedMchXML 处理带签名的 mch xml 回调,需要传入一个 ConfigurationSelector 用于选择配置 NOTE: 最终用户一般不需要使用该函数.
JSReq 返回拉起微信支付所需的 JS 参数(公众号支付/小程序支付),使用 DefaultOptions 中的签名方式.
JSReqEx 返回拉起微信支付所需的 JS 参数(公众号支付/小程序支付),signType 必须保持和统一下单一致, 若均使用 DefaultOptions,可以直接使用 JSReq.
MustOptions 是 must 版 NewOptions.
NewOptions 创建一个 Options NOTE: 若 len(opts) == 0,返回 (*Options)(nil) 也是有效的.
OrderNotify 创建一个处理支付结果通知的 http.Handler; 传入 handler 的参数包括上下文和查询订单接口返回的 Response;handler 处理过后若成功应该返回 nil,若失败则应该返回一个非 nil error 对象,该 error 的 String() 将会返回给外部 NOTE:请使用与在统一下单一样的签名类型,否则签名会可能不通过.
OrderQuery 查询订单接口.
ParseRefundStatus parse 退款状态.
ParseSignType parse 签名类型.
ParseTradeState parse 交易状态字符串.
ParseTradeType parse 交易类型字符串.
PostMchXML 调用 mch xml 接口,大致过程如下: - 添加公共字段 appid/mch_id/mch_id/nonce_str/sign_type - 签名并添加 sign - 调用 api,等待结果或错误 - 检查 return_code/return_msg - 验证签名 - 验证 appid/mch_id - 检查 result_code NOTE: 最终用户一般不需要使用该函数.
Refund 申请退款接口,该接口需要客户端证书的 client.
RefundNotify 创建一个处理退款结果通知的 http.Handler; 传入 handler 的参数包括上下文和查询退款接口返回的 Response;handler 处理过后若成功应该返回 nil,若失败则应该返回一个非 nil error 对象,该 error 的 String() 将会返回给外部.
RefundQuery 查询退款.
SignMchXML 对 MchXML 进行签名,签名算法见微信支付《安全规范》,signType 为空时默认使用 MD5, x 中 sign 字段和空值字段皆不参与签名;返回的签名字符串为大写 NOTE: 最终用户一般不需要使用该函数.
UnifiedOrder 统一下单接口.
UseClient 设置 HTTPClient.
UseMiddleware 设置中间件.
UseSignType 设置签名类型.
UseURLBase 设置 API 地址前缀,默认为 "https://api.mch.weixin.qq.com".

# Constants

URLBaseDefault 默认接入点.
URLBaseHK 建议东南亚接入点.
URLBaseUS 建议其它地区接入点.

# Variables

DefaultOptions 为 mch 模块的默认设置,可修改它影响该模块下的默认行为,.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
RefundStatusCHANGE 表示退款异常,需要手动处理;PROCESSING -> CHANGE.
RefundStatusInvalid 表示无效退款状态.
RefundStatusPROCESSING 表示退款处理中.
RefundStatusREFUNDCLOSE 表示退款关闭;PROCESSING -> REFUNDCLOSE.
RefundStatusPROCESSING 表示退款成功;PROCESSING -> SUCCESS.
No description provided by the author
No description provided by the author
No description provided by the author
TradeStateCLOSED 表示已关闭;NOTPAY 关单 -> CLOSED.
TradeStateInvalid 表示无效交易状态.
TradeStateNOTPAY 表示未支付.
TradeStatePAYERROR 表示支付错误(如银行返回失败);NOTPAY -> PAYERROR.
TradeStateREFUND 表示进入退款;SUCCESS 发起退款 -> REFUND.
TradeStateREVOKED 表示已撤销(刷卡支付).
TradeStateSUCCESS 表示支付成功;NOTPAY -> SUCCESS.
TradeStateUSERPAYING 表示用户支付中?.
TradeTypeAPP 表示 app 交易类型.
TradeTypeInvalid 表示无效交易类型.
TradeTypeJSAPI 表示公众号/小程序交易类型.
TradeTypeMWEB 表示 H5 交易类型.
TradeTypeNATIVE 表示扫码交易类型.

# Structs

CloseOrderRequest 是关闭订单接口请求.
MchBusinessError 是微信支付业务错误.
Options 包含微信支付接口时的选项,NOTE: 某些选项未必对所有接口都有意义.
OrderQueryRequest 为查询订单接口请求.
OrderQueryResponse 为查询订单接口响应.
RefundInfo 为查询退款接口响应中的单笔退款单信息.
RefundQueryRequest 为查询退款接口请求.
RefundQueryRequest 为查询退款接口响应.
RefundRequest 为申请退款接口请求.
RefundRequest 为申请退款接口响应.
RefundStatus 表示退款状态.
SignType 代表签名类型.
TradeState 表示交易状态.
TradeType 表示交易方式.
UnifiedOrderRequest 为统一下单接口请求.
UnifiedOrderResponse 为统一下单接口响应.

# Type aliases

MchXML 代表微信支付接口的 xml 数据,形如: <xml> <fieldName1>fieldValue1</fieldName1> <fieldName2>fieldValue2</fieldName2> ..
Option 代表调用微信支付接口时的单个选项.