微信支付新增企业付款和分账,添加分账接收方接口
This commit is contained in:
@@ -73,17 +73,6 @@ type RequestBase struct {
|
||||
SignType string `json:"sign_type,omitempty" xml:"sign_type,omitempty"`
|
||||
}
|
||||
|
||||
type RequestBase2 struct {
|
||||
XMLName xml.Name `json:"-" xml:"xml"`
|
||||
|
||||
AppID string `json:"mch_appid" xml:"mch_appid"`
|
||||
DeviceInfo string `json:"device_info,omitempty" xml:"device_info,omitempty"`
|
||||
MchID string `json:"mchid" xml:"mchid"`
|
||||
NonceStr string `json:"nonce_str" xml:"nonce_str"`
|
||||
Sign string `json:"sign" xml:"sign"`
|
||||
SignType string `json:"sign_type,omitempty" xml:"sign_type,omitempty"`
|
||||
}
|
||||
|
||||
type IRequestBase interface {
|
||||
SetAppID(action, appID string)
|
||||
SetMchID(action, mchID string)
|
||||
@@ -275,7 +264,7 @@ type MultiProfitSharingResult struct {
|
||||
}
|
||||
|
||||
type Transfers struct {
|
||||
RequestBase2
|
||||
RequestBase
|
||||
PartnerTradeNo string `json:"partner_trade_no" xml:"partner_trade_no"`
|
||||
OpenID string `json:"openid" xml:"openid"`
|
||||
CheckName string `json:"check_name" xml:"check_name"`
|
||||
@@ -402,9 +391,13 @@ func (a *API) AccessAPI(action string, requestParam IRequestBase) (retVal map[st
|
||||
requestParam.SetAppID(action, a.appID)
|
||||
requestParam.SetMchID(action, a.mchID)
|
||||
requestParam.SetNonceStr(utils.GetUUID())
|
||||
sigType := sigTypeSha256
|
||||
// sigType := sigTypeMd5
|
||||
requestParam.SetSignType(sigType)
|
||||
var sigType string
|
||||
if action != specialAction {
|
||||
sigType = sigTypeSha256
|
||||
requestParam.SetSignType(sigType)
|
||||
} else {
|
||||
sigType = sigTypeMd5
|
||||
}
|
||||
signStr := a.signParam(sigType, utils.Struct2FlatMap(requestParam))
|
||||
requestParam.SetSign(signStr)
|
||||
|
||||
@@ -545,10 +538,10 @@ func (a *API) MultiProfitSharing(param *MultiProfitSharing) (result *MultiProfit
|
||||
//企业付款
|
||||
//https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_2
|
||||
func (a *API) Transfers(param *Transfers) (result *TransfersResult, err error) {
|
||||
// retVal, err := a.AccessAPI("mmpaymkttransfers/promotion/transfers", param)
|
||||
// if err == nil {
|
||||
// err = a.translateResult(retVal, &result)
|
||||
// }
|
||||
retVal, err := a.AccessAPI(specialAction, param)
|
||||
if err == nil {
|
||||
err = a.translateResult(retVal, &result)
|
||||
}
|
||||
return result, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user