Documentation ¶
Index ¶
- Constants
- Variables
- func DeepCopy(value interface{}) interface{}
- func DeleteEmptyValue(src map[string]interface{}) map[string]interface{}
- func DoGetReq(url string, params map[string]interface{}, msc *MerchSysConfig) (*http.Response, error)
- func DoPostReq(url string, params map[string]interface{}, msc *MerchSysConfig) (*http.Response, error)
- func DoUploadFile(url string, params map[string]interface{}, fileParamName string, ...) (*http.Response, error)
- func FormatSignSrcText(method string, paramMap map[string]interface{}) (string, error)
- func Println(v ...interface{})
- func RsaLongDecrypt(content string, msc *MerchSysConfig) (result string)
- func RsaLongEncrypt(content string, msc *MerchSysConfig) (result string)
- func RsaSign(content string, msc *MerchSysConfig) (result string, err error)
- func RsaSignVerify(signData string, originalData string, msc *MerchSysConfig) (err error)
- func ToString(v interface{}) string
- type ApiError
- func FilterApiError(respBodyString string) (*ApiError, error)
- func HandleResponse(resp *http.Response, msc *MerchSysConfig) (map[string]interface{}, *ApiError, error)
- func RequestAdaPay(reqUrl string, requestMethod RequestMethod, reqParam map[string]interface{}, ...) (map[string]interface{}, *ApiError, error)
- func UploadAdaPay(reqUrl string, reqParam map[string]interface{}, fileParamName string, ...) (map[string]interface{}, *ApiError, error)
- type MerchSysConfig
- type RequestMethod
Constants ¶
View Source
const Version = "1.3.0"
Variables ¶
View Source
var GDefaultMerchSysConfig = MerchSysConfig{}
View Source
var GMultiMerchSysConfigs = map[string]MerchSysConfig{}
Functions ¶
func DeleteEmptyValue ¶
func DoUploadFile ¶
func FormatSignSrcText ¶
func RsaLongDecrypt ¶
func RsaLongDecrypt(content string, msc *MerchSysConfig) (result string)
func RsaLongEncrypt ¶
func RsaLongEncrypt(content string, msc *MerchSysConfig) (result string)
func RsaSignVerify ¶
func RsaSignVerify(signData string, originalData string, msc *MerchSysConfig) (err error)
Types ¶
type ApiError ¶
type ApiError struct { ErrorCode string `json:"error_code"` ErrorMsg string `json:"error_msg"` ErrorType string `json:"error_type"` Status string `json:"status"` InvalidParam string `json:"invalid_param"` }
func FilterApiError ¶
func HandleResponse ¶
func RequestAdaPay ¶
func RequestAdaPay(reqUrl string, requestMethod RequestMethod, reqParam map[string]interface{}, msc *MerchSysConfig) (map[string]interface{}, *ApiError, error)
func UploadAdaPay ¶
type MerchSysConfig ¶
type MerchSysConfig struct { ApiKeyLive string `json:"api_key_live"` ApiKeyTest string `json:"api_key_test"` RspPubKey string `json:"rsa_public_key"` RspPriKey string `json:"rsa_private_key"` }
func GetMerchSysConfig ¶
func GetMerchSysConfig(mscId string) MerchSysConfig
func ReadMerchConfig ¶
func ReadMerchConfig(configPath string) (*MerchSysConfig, error)
func (*MerchSysConfig) IsEmpty ¶
func (msc *MerchSysConfig) IsEmpty() bool
type RequestMethod ¶
type RequestMethod string
const ( POST RequestMethod = "POST" GET RequestMethod = "GET" UPLOAD RequestMethod = "UPLOAD" )
Click to show internal directories.
Click to hide internal directories.