Documentation ¶
Index ¶
- func AESDecrypt(crypted, key []byte) []byte
- func AESEncrypt(origData, key []byte) []byte
- func AesDecrypt(cipherText string, encryptKey string)
- func AesEncrypt(plainText string, encryptKey string)
- func ExtractAlipayPublicKey(alipayPublicKey string) string
- func GetAlipayCertSN(alipayCertSN map[string]string) string
- func GetAlipayRootCertSN() string
- func GetConfig(key string) string
- func GetMerchantCertSN() string
- func GetSdkVersion() string
- func GetTimestamp() string
- func InitClient(config Client)
- func IsCertMode() bool
- func PKCS7Padding(origData []byte, blockSize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- func ReadAsJson(response io.Reader, method string) (map[string]string, error)
- func RsaSignWithSha256(data []byte, keyBytes []byte) []byte
- func RsaVerySignWithSha256(data, signData, keyBytes []byte) bool
- func Sign(systemParams map[string]string, bizParams map[string]string, ...) string
- func SortMap(romanNumeralDict map[string]string) map[string]string
- func ToRespModel(resp map[string]string) map[string]interface{}
- func ToUrlEncodedRequestBody(bizParams map[string]string) string
- func Verify(respMap map[string]string, alipayPublicKey string) bool
- type AlipayOpenApiGenericResponse
- func (s AlipayOpenApiGenericResponse) GoString() string
- func (s *AlipayOpenApiGenericResponse) SetCode(v string) *AlipayOpenApiGenericResponse
- func (s *AlipayOpenApiGenericResponse) SetHttpBody(v string) *AlipayOpenApiGenericResponse
- func (s *AlipayOpenApiGenericResponse) SetMsg(v string) *AlipayOpenApiGenericResponse
- func (s *AlipayOpenApiGenericResponse) SetSubCode(v string) *AlipayOpenApiGenericResponse
- func (s *AlipayOpenApiGenericResponse) SetSubMsg(v string) *AlipayOpenApiGenericResponse
- func (s AlipayOpenApiGenericResponse) String() string
- type Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶
func AesEncrypt ¶
func ExtractAlipayPublicKey ¶
func GetAlipayCertSN ¶
func GetAlipayRootCertSN ¶
func GetAlipayRootCertSN() string
func GetMerchantCertSN ¶
func GetMerchantCertSN() string
func GetSdkVersion ¶
func GetSdkVersion() string
func InitClient ¶
func InitClient(config Client)
func IsCertMode ¶
func IsCertMode() bool
func ReadAsJson ¶
* 解析网关响应内容,同时将API的接口名称和响应原文插入到响应数组的method和body字段中
func Sign ¶
func Sign(systemParams map[string]string, bizParams map[string]string, textParams map[string]string, privateKey string) string
* 计算签名
func ToRespModel ¶
func ToUrlEncodedRequestBody ¶
* 将业务参数和其他额外文本参数按www-form-urlencoded格式转换成HTTP Body中的字节数组,注意要做URL Encode
Types ¶
type AlipayOpenApiGenericResponse ¶
type AlipayOpenApiGenericResponse struct { HttpBody *string `json:"http_body" xml:"http_body" require:"true"` Code *string `json:"code" xml:"code" require:"true"` Msg *string `json:"msg" xml:"msg" require:"true"` SubCode *string `json:"sub_code" xml:"sub_code" require:"true"` SubMsg *string `json:"sub_msg" xml:"sub_msg" require:"true"` }
func (AlipayOpenApiGenericResponse) GoString ¶
func (s AlipayOpenApiGenericResponse) GoString() string
func (*AlipayOpenApiGenericResponse) SetCode ¶
func (s *AlipayOpenApiGenericResponse) SetCode(v string) *AlipayOpenApiGenericResponse
func (*AlipayOpenApiGenericResponse) SetHttpBody ¶
func (s *AlipayOpenApiGenericResponse) SetHttpBody(v string) *AlipayOpenApiGenericResponse
func (*AlipayOpenApiGenericResponse) SetMsg ¶
func (s *AlipayOpenApiGenericResponse) SetMsg(v string) *AlipayOpenApiGenericResponse
func (*AlipayOpenApiGenericResponse) SetSubCode ¶
func (s *AlipayOpenApiGenericResponse) SetSubCode(v string) *AlipayOpenApiGenericResponse
func (*AlipayOpenApiGenericResponse) SetSubMsg ¶
func (s *AlipayOpenApiGenericResponse) SetSubMsg(v string) *AlipayOpenApiGenericResponse
func (AlipayOpenApiGenericResponse) String ¶
func (s AlipayOpenApiGenericResponse) String() string
type Client ¶
type Client struct { Protocol string GatewayHost string AppId string SignType string AlipayPublicKey string MerchantPrivateKey string MerchantCertPath string AlipayCertPath string AlipayRootCertPath string NotifyUrl string EncryptKey string MerchantCertSN string AlipayCertSN string AlipayRootCertSN string }
Click to show internal directories.
Click to hide internal directories.