微信分账接口
This commit is contained in:
@@ -288,6 +288,25 @@ type TransfersResult struct {
|
||||
PaymentTime string `json:"payment_time" xml:"payment_time"`
|
||||
}
|
||||
|
||||
type AddProfitSharingReceiver struct {
|
||||
RequestBase
|
||||
Receiver CData `json:"receiver" xml:"receiver"`
|
||||
}
|
||||
|
||||
type AddProfitSharingReceiverResult struct {
|
||||
ReturnCode string `json:"return_code" xml:"return_code"`
|
||||
ReturnMsg string `json:"return_msg" xml:"return_msg"`
|
||||
|
||||
ResultCode string `json:"result_code" xml:"result_code"`
|
||||
ErrCode string `json:"err_code,omitempty" xml:"err_code,omitempty"`
|
||||
ErrCodeDes string `json:"err_code_des,omitempty" xml:"err_code_des,omitempty"`
|
||||
AppID string `json:"appid" xml:"appid"`
|
||||
MchID string `json:"mch_id" xml:"mch_id"`
|
||||
NonceStr string `json:"nonce_str" xml:"nonce_str"`
|
||||
Sign string `json:"sign" xml:"sign"`
|
||||
Receiver string `json:"receiver" xml:"receiver"`
|
||||
}
|
||||
|
||||
func New(appID, appKey, mchID string, config ...*platformapi.APIConfig) *API {
|
||||
curConfig := platformapi.DefAPIConfig
|
||||
if len(config) > 0 {
|
||||
@@ -512,7 +531,17 @@ 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)
|
||||
// retVal, err := a.AccessAPI("mmpaymkttransfers/promotion/transfers", param)
|
||||
// if err == nil {
|
||||
// err = a.translateResult(retVal, &result)
|
||||
// }
|
||||
return result, err
|
||||
}
|
||||
|
||||
//添加分账接收方
|
||||
//https://pay.weixin.qq.com/wiki/doc/api/allocation.php?chapter=27_3&index=4
|
||||
func (a *API) AddProfitSharingReceiver(param *AddProfitSharingReceiver) (result *AddProfitSharingReceiverResult, err error) {
|
||||
retVal, err := a.AccessAPI("pay/profitsharingaddreceiver", param)
|
||||
if err == nil {
|
||||
err = a.translateResult(retVal, &result)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user