12345678910111213141516171819202122232425262728 |
- // 收款、代收
- package unionpay
- import "fmt"
- // EntrustCharge 代扣费用
- func EntrustCharge(mi *MerchantInfo, oi OrderInfo, ci CustomerInfo) (res ReqRespose, err error) {
- var body string
- args := newParams(oi, ci)
- args.TxnType = "11" // 交易类型, 取值:11
- args.TxnSubType = "02" // 交易子类, 取值:02
- args.BizType = "000501" // 业务类型 代收产品
- args.BackURL = oi.NotifyURL
- body, err = args.ToBody(mi, ci)
- if err != nil {
- return
- }
- fmt.Println(body)
- res, err = post(BaseHost+ReqBackTrans, []byte(body))
- if err != nil {
- return
- }
- _, err = res.Ok()
- return
- }
|