微信支付特殊情况
This commit is contained in:
@@ -54,6 +54,14 @@ const (
|
|||||||
AccountTypeOpen = "PERSONAL_OPENID"
|
AccountTypeOpen = "PERSONAL_OPENID"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
specialSignActions = map[string]string{
|
||||||
|
"secapi/pay/multiprofitsharing": "secapi/pay/multiprofitsharing",
|
||||||
|
"pay/profitsharingaddreceiver": "pay/profitsharingaddreceiver",
|
||||||
|
"pay/profitsharingremovereceiver": "pay/profitsharingremovereceiver",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
type API struct {
|
type API struct {
|
||||||
appID string
|
appID string
|
||||||
appKey string
|
appKey string
|
||||||
@@ -429,11 +437,14 @@ func (a *API) AccessAPI(action string, requestParam IRequestBase) (retVal map[st
|
|||||||
requestParam.SetMchID(action, a.mchID)
|
requestParam.SetMchID(action, a.mchID)
|
||||||
requestParam.SetNonceStr(utils.GetUUID())
|
requestParam.SetNonceStr(utils.GetUUID())
|
||||||
var sigType string
|
var sigType string
|
||||||
if action == specialAction {
|
if specialSignActions[action] != "" {
|
||||||
sigType = sigTypeSha256
|
sigType = sigTypeSha256
|
||||||
requestParam.SetSignType(sigType)
|
requestParam.SetSignType(sigType)
|
||||||
|
} else if action == specialAction {
|
||||||
|
sigType = sigTypeMd5
|
||||||
} else {
|
} else {
|
||||||
sigType = sigTypeMd5
|
sigType = sigTypeMd5
|
||||||
|
requestParam.SetSignType(sigType)
|
||||||
}
|
}
|
||||||
signStr := a.signParam(sigType, utils.Struct2FlatMap(requestParam))
|
signStr := a.signParam(sigType, utils.Struct2FlatMap(requestParam))
|
||||||
requestParam.SetSign(signStr)
|
requestParam.SetSign(signStr)
|
||||||
|
|||||||
Reference in New Issue
Block a user