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