Documentation ¶
Index ¶
- Constants
- func BuildMsgPage(msg string) string
- func Buildaliform(url string, p map[string]string) string
- func BuildwxjsCall(appid, prepay_id, returnurl, apikey string) string
- type AliParams
- type WxParams
- func (p WxParams) AppendSubParams(key string, ps AliParams) AliParams
- func (p WxParams) GenStr(seq string) string
- func (p WxParams) GenUrlStr() string
- func (p WxParams) MakeAliSign(privkeybase64 string) string
- func (p WxParams) MakeWxSign(signtype, apikey string) string
- func (p WxParams) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- func (p *WxParams) SetStr(s string, sep string)
- func (p *WxParams) SetUrlStr(s string)
- func (p WxParams) SortGenStr(seq string) string
- func (p *WxParams) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- func (p WxParams) VerifyAsyncAliSign(pubkeybase64 string) bool
- func (p WxParams) VerifySyncAliSign(pubkeybase64 string) bool
- func (p WxParams) VerifyWxSign(signtype, apikey string) bool
Constants ¶
View Source
const ( Fail = "FAIL" Success = "SUCCESS" BodyXMLType = "application/xml; charset=utf-8" BodyJSONType = "application/json; charset=utf-8" BodyUrlencodedType = "application/x-www-form-urlencoded; charset=utf-8" ALISUCCESS = "10000" MicroPayUrl = "https://api.mch.weixin.qq.com/pay/micropay" UnifiedOrderUrl = "https://api.mch.weixin.qq.com/pay/unifiedorder" OrderQueryUrl = "https://api.mch.weixin.qq.com/pay/orderquery" ReverseUrl = "https://api.mch.weixin.qq.com/secapi/pay/reverse" CloseOrderUrl = "https://api.mch.weixin.qq.com/pay/closeorder" RefundUrl = "https://api.mch.weixin.qq.com/secapi/pay/refund" RefundQueryUrl = "https://api.mch.weixin.qq.com/pay/refundquery" DownloadBillUrl = "https://api.mch.weixin.qq.com/pay/downloadbill" ReportUrl = "https://api.mch.weixin.qq.com/payitil/report" ShortUrl = "https://api.mch.weixin.qq.com/tools/shorturl" AuthCodeToOpenidUrl = "https://api.mch.weixin.qq.com/tools/authcodetoopenid" SandboxMicroPayUrl = "https://api.mch.weixin.qq.com/sandboxnew/pay/micropay" SandboxUnifiedOrderUrl = "https://api.mch.weixin.qq.com/sandboxnew/pay/unifiedorder" SandboxOrderQueryUrl = "https://api.mch.weixin.qq.com/sandboxnew/pay/orderquery" SandboxReverseUrl = "https://api.mch.weixin.qq.com/sandboxnew/secapi/pay/reverse" SandboxCloseOrderUrl = "https://api.mch.weixin.qq.com/sandboxnew/pay/closeorder" SandboxRefundUrl = "https://api.mch.weixin.qq.com/sandboxnew/secapi/pay/refund" SandboxRefundQueryUrl = "https://api.mch.weixin.qq.com/sandboxnew/pay/refundquery" SandboxDownloadBillUrl = "https://api.mch.weixin.qq.com/sandboxnew/pay/downloadbill" SandboxReportUrl = "https://api.mch.weixin.qq.com/sandboxnew/payitil/report" SandboxShortUrl = "https://api.mch.weixin.qq.com/sandboxnew/tools/shorturl" SandboxAuthCodeToOpenidUrl = "https://api.mch.weixin.qq.com/sandboxnew/tools/authcodetoopenid" )
View Source
const ( K_ALI_PAY_TRADE_STATUS_WAIT_BUYER_PAY = "WAIT_BUYER_PAY" // 交易创建,等待买家付款 K_ALI_PAY_TRADE_STATUS_TRADE_CLOSED = "TRADE_CLOSED" // 未付款交易超时关闭,或支付完成后全额退款 K_ALI_PAY_TRADE_STATUS_TRADE_SUCCESS = "TRADE_SUCCESS" // 交易支付成功 K_ALI_PAY_TRADE_STATUS_TRADE_FINISHED = "TRADE_FINISHED" // 交易结束,不可退款 K_ALI_PAY_SANDBOX_API_URL = "https://openapi.alipaydev.com/gateway.do" K_ALI_PAY_PRODUCTION_API_URL = "https://openapi.alipay.com/gateway.do" K_ALI_PAY_PRODUCTION_MAPI_URL = "https://mapi.alipay.com/gateway.do" )
View Source
const ( Md5Sign = "MD5" HMacSha256 = "HMAC-SHA256" WxSign = "sign" AliSign = "sign" SignType = "sign_type" )
Variables ¶
This section is empty.
Functions ¶
func BuildMsgPage ¶
func BuildwxjsCall ¶
Types ¶
type WxParams ¶
type WxParams map[string]interface{}
func MergeParams ¶
func (WxParams) AppendSubParams ¶
func (WxParams) MakeAliSign ¶
func (WxParams) MakeWxSign ¶
func (WxParams) MarshalXML ¶
func (WxParams) SortGenStr ¶
func (*WxParams) UnmarshalXML ¶
func (WxParams) VerifyAsyncAliSign ¶
func (WxParams) VerifySyncAliSign ¶
func (WxParams) VerifyWxSign ¶
Click to show internal directories.
Click to hide internal directories.