Versions in this module Expand all Collapse all v1 v1.0.0 Sep 13, 2017 Changes in this version + const AUTHCODETOOPENID_URL_SUFFIX + const BANKERROR + const CLOSEORDER_URL_SUFFIX + const CUSTOM_HEADER + const DEFAULT_CONNECT_TIMEOUT_MS + const DEFAULT_READ_TIMEOUT_MS + const DOMAIN_API + const DOMAIN_API2 + const DOMAIN_APIHK + const DOMAIN_APIUS + const DOWNLOADBILL_URL_SUFFIX + const FAIL + const FIELD_SIGN + const FIELD_SIGN_TYPE + const HMACSHA256 + const MD5 + const MICROPAY_URL_SUFFIX + const MIN_SWITCH_PRIMARY_MSEC + const ORDERQUERY_URL_SUFFIX + const REFUNDQUERY_URL_SUFFIX + const REFUND_URL_SUFFIX + const REPORT_URL + const REPORT_URL_SUFFIX + const REVERSE_URL_SUFFIX + const SANDBOX_SIGNKEY_URL_SUFFIX + const SANDBOX_URL_SUFFIX + const SHORTURL_URL_SUFFIX + const SSLCERT_PATH + const SSLKEY_PATH + const SUCCESS + const SYSTEMERROR + const UNIFIEDORDER_URL_SUFFIX + const USERPAYING + var ErrorLoadX509KeyPair = errors.New("LoadX509KeyPair() is empty to load") + var ErrorNilDomain = errors.New("PayConfig.PayDomain().getDomain() is empty or null") + var ErrorParameter = errors.New("JsonApiParameters() check error") + var ErrorReadRootCAFile = errors.New("read rootca.pem file error") + var ErrorSignType = errors.New("sign type error") + var ErrorToken = errors.New("EditAddressParameters() token is nil") + var ErrorUnknownHost = errors.New("ErrorUnknownHostException") + var ErrprConnectTimeout = errors.New("ErrorConnectTimeout") + func CurrentTimeStamp() int64 + func CurrentTimeStampMS() int64 + func CurrentTimeStampNS() int64 + func CurrentTimeStampString() string + func EditAddressParameters(url string, token *oauth.ResAccessToken) (string, error) + func GenerateNonceStr() string + func GenerateSignature(reqData PayData, key string, signType SignType) (string, error) + func GenerateUUID() string + func IsSignatureValid(xml, key string) bool + func JsonApiParameters(data PayData) (string, error) + func MakeSignHMACSHA256(data, key string) string + func MakeSignMD5(data string) string + func MapToString(data PayData) string + func MapToXml(reqData PayData) (string, error) + func NewPayDomainSimple() *payDomainSimpleImpl + func ParseInt(b bool) (i int) + func SHA1(s string) string + func SandboxSignKey() (string, error) + func ToUrlParams(data PayData) string + type CDATA struct + Value string + type DomainInfo struct + Domain string + PrimaryDomain bool + func NewDomainInfo(domain string, primary bool) *DomainInfo + func (info *DomainInfo) String() string + type DomainStatics struct + func NewDomainStatics(domain string) *DomainStatics + type Pay struct + func NewPay(config PayConfig) *Pay + func (pay *Pay) ApplySandBox(url string) string + func (pay *Pay) AuthCodeToOpenid(data PayData) (PayData, error) + func (pay *Pay) AuthCodeToOpenidTimeout(data PayData, connectTimeoutMs int, readTimeoutMs int) (PayData, error) + func (pay *Pay) CloseOrder(data PayData) (PayData, error) + func (pay *Pay) CloseOrderTimeout(data PayData, connectTimeoutMs, readTimeoutMs int) (PayData, error) + func (pay *Pay) DownloadBill(data PayData) (PayData, error) + func (pay *Pay) DownloadBillTimeout(data PayData, connectTimeoutMs int, readTimeoutMs int) (PayData, error) + func (pay *Pay) FillRequestData(data PayData) (PayData, error) + func (pay *Pay) MicroPay(data PayData) (PayData, error) + func (pay *Pay) MicroPayTimeout(data PayData, connectTimeoutMs int, readTimeoutMs int) (PayData, error) + func (pay *Pay) MicroPayWithPos(data PayData) (PayData, error) + func (pay *Pay) MicroPayWithPosConnectTimeout(data PayData, connectTimeoutMs int) (PayData, error) + func (pay *Pay) QueryOrder(data PayData) (PayData, error) + func (pay *Pay) QueryOrderTimeout(data PayData, connectTimeoutMs int, readTimeoutMs int) (PayData, error) + func (pay *Pay) QueryRefund(data PayData) (PayData, error) + func (pay *Pay) QueryRefundTimeout(data PayData, connectTimeoutMs int, readTimeoutMs int) (PayData, error) + func (pay *Pay) Refund(data PayData) (PayData, error) + func (pay *Pay) RefundTimeout(data PayData, connectTimeoutMs int, readTimeoutMs int) (PayData, error) + func (pay *Pay) Report(data PayData) (PayData, error) + func (pay *Pay) ReportTimeout(data PayData, connectTimeoutMs int, readTimeoutMs int) (PayData, error) + func (pay *Pay) RequestWithCert(url string, data PayData) (string, error) + func (pay *Pay) RequestWithCertTimeout(url string, data PayData, connectTimeoutMs, readTimeoutMs int) (string, error) + func (pay *Pay) RequestWithoutCert(url string, data PayData) (string, error) + func (pay *Pay) RequestWithoutCertTimeout(url string, data PayData, connectTimeoutMs, readTimeoutMs int) (string, error) + func (pay *Pay) ReverseOrder(data PayData) (PayData, error) + func (pay *Pay) ReverseOrderTimeout(data PayData, connectTimeoutMs int, readTimeoutMs int) (PayData, error) + func (pay *Pay) SetSandBox(useSandbox bool) *Pay + func (pay *Pay) ShortUrl(data PayData) (PayData, error) + func (pay *Pay) ShortUrlTimeout(data PayData, connectTimeoutMs int, readTimeoutMs int) (PayData, error) + func (pay *Pay) UnifiedOrder(data PayData) (PayData, error) + func (pay *Pay) UnifiedOrderTimeout(data PayData, connectTimeoutMs, readTimeoutMs int) (PayData, error) + type PayConfig interface + AppID func() string + AutoReport func() bool + Cert func() []byte + ConnectTimeoutMs func() int + Key func() string + MchID func() string + PayDomainInstance func() PayDomain + ReadTimeoutMs func() int + ReportBatchSize func() int + ReportQueueMaxSize func() int + ReportWorkNum func() int + func NewPayConfig() PayConfig + func PayConfigInstance() PayConfig + func SetPayConfig(conf PayConfig) PayConfig + type PayConfigImpl struct + func (impl *PayConfigImpl) AppID() string + func (impl *PayConfigImpl) AutoReport() bool + func (impl *PayConfigImpl) Cert() []byte + func (impl *PayConfigImpl) ConnectTimeoutMs() int + func (impl *PayConfigImpl) Key() string + func (impl *PayConfigImpl) MchID() string + func (impl *PayConfigImpl) PayDomainInstance() PayDomain + func (impl *PayConfigImpl) ReadTimeoutMs() int + func (impl *PayConfigImpl) ReportBatchSize() int + func (impl *PayConfigImpl) ReportQueueMaxSize() int + func (impl *PayConfigImpl) ReportWorkNum() int + type PayData map[string]string + func AuthCodeToOpenid(data PayData) (PayData, error) + func CloseOrder(data PayData) (PayData, error) + func DownloadBill(data PayData) (PayData, error) + func MicroPay(data PayData) (PayData, error) + func MicroPayWithPos(data PayData) (PayData, error) + func QueryOrder(data PayData) (PayData, error) + func QueryRefund(data PayData) (PayData, error) + func Refund(data PayData) (PayData, error) + func Report(data PayData) (PayData, error) + func ReverseOrder(data PayData) (PayData, error) + func ShortUrl(data PayData) (PayData, error) + func UnifiedOrder(data PayData) (PayData, error) + func XmlToMap(contentXml string) PayData + func (data PayData) Get(key string) string + func (data PayData) IsExist(key string) bool + func (data PayData) Set(key, val string) + func (data PayData) SortKeys() []string + func (data PayData) ToJson() string + type PayDomain interface + GetDomainInfo func() *DomainInfo + Report func(string, int64, error) + func PayDomainSimpleInstance() PayDomain + type PayReport struct + func PayReportInstance(config PayConfig) *PayReport + func (report *PayReport) Report(uuid string, elapsedTimeMillis int64, firstDomain string, primaryDomain bool, ...) + type PayRequest struct + func NewPayRequest(config PayConfig) *PayRequest + func (request *PayRequest) RequestOnce(domain, urlSuffix, uuid, data string, connectTimeoutMs, readTimeoutMs int, ...) (string, error) + func (request *PayRequest) RequestWithCert(urlSuffix, uuid, data string, autoReport bool) (string, error) + func (request *PayRequest) RequestWithCertTimeout(urlSuffix, uuid, data string, connectTimeoutMs, readTimeoutMs int, ...) (string, error) + func (request *PayRequest) RequestWithoutCert(urlSuffix, uuid, data string, autoReport bool) (string, error) + func (request *PayRequest) RequestWithoutCertTimeout(urlSuffix, uuid, data string, connectTimeoutMs, readTimeoutMs int, ...) (string, error) + type ReportInfo struct + ElapsedTimeMillis int64 + FirstConnectTimeoutMillis int + FirstDomain string + FirstHasConnectTimeout int + FirstHasDnsError int + FirstHasReadTimeout int + FirstReadTimeoutMillis int + PrimaryDomain bool + Sdk string + Timestamp int64 + Uuid string + Version string + func NewReportInfo(uuid string, timestamp int64, elapsedTimeMillis int64, firstDomain string, ...) *ReportInfo + func (r *ReportInfo) ToLineString(key string) string + func (r *ReportInfo) ToString() string + type RequestFunc func(url string, data PayData, connectTimeoutMs, readTimeoutMs int) (string, error) + type SignType int + const SIGN_TYPE_HMACSHA256 + const SIGN_TYPE_MD5 + func (t SignType) ToString() string