common

package
v0.0.0-...-1bfa26d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2018 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

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 BuildMsgPage(msg string) string

func Buildaliform

func Buildaliform(url string, p map[string]string) string

func BuildwxjsCall

func BuildwxjsCall(appid, prepay_id, returnurl, apikey string) string

Types

type AliParams

type AliParams = WxParams

type WxParams

type WxParams map[string]interface{}

func MergeParams

func MergeParams(ps ...WxParams) WxParams

func (WxParams) AppendSubParams

func (p WxParams) AppendSubParams(key string, ps AliParams) AliParams

func (WxParams) GenStr

func (p WxParams) GenStr(seq string) string

func (WxParams) GenUrlStr

func (p WxParams) GenUrlStr() string

func (WxParams) MakeAliSign

func (p WxParams) MakeAliSign(privkeybase64 string) string

func (WxParams) MakeWxSign

func (p WxParams) MakeWxSign(signtype, apikey string) string

func (WxParams) MarshalXML

func (p WxParams) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*WxParams) SetStr

func (p *WxParams) SetStr(s string, sep string)

func (*WxParams) SetUrlStr

func (p *WxParams) SetUrlStr(s string)

func (WxParams) SortGenStr

func (p WxParams) SortGenStr(seq string) string

func (*WxParams) UnmarshalXML

func (p *WxParams) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (WxParams) VerifyAsyncAliSign

func (p WxParams) VerifyAsyncAliSign(pubkeybase64 string) bool

func (WxParams) VerifySyncAliSign

func (p WxParams) VerifySyncAliSign(pubkeybase64 string) bool

func (WxParams) VerifyWxSign

func (p WxParams) VerifyWxSign(signtype, apikey string) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL