通联宝支付paytype修改

This commit is contained in:
苏尹岚
2020-03-03 14:32:41 +08:00
parent fc34599506
commit 131cb1110d

View File

@@ -16,8 +16,9 @@ const (
prodURL = "https://vsp.allinpay.com/apiweb"
sepcAction = "unitorder/pay"
sigKey = "sign"
payType = "W06"
sigKey = "sign"
PayTypeWxXcx = "W06"
PayTypeZfbApp = "A03"
ResponseCodeSuccess = "SUCCESS"
ResponseCodeFail = "FAIL"
@@ -39,6 +40,7 @@ type CreateUnitorderOrderParam struct {
Reqsn string `json:"reqsn"` //商户交易单号
NotifyUrl string `json:"notifyUrl"` //接收微信支付异步通知回调地址通知url必须为直接可访问的url不能携带参数。
Acct string `json:"acct"`
PayType string `json:"paytype"`
}
type CreateUnitorderOrderResult struct {
@@ -135,7 +137,7 @@ func (a *API) AccessAPI(action string, bizParams map[string]interface{}) (retVal
params["version"] = "12"
params = utils.MergeMaps(params, bizParams)
if action == sepcAction {
params["paytype"] = payType
// params["paytype"] = payType
params["sub_appid"] = a.subAppid
}
signStr := a.signParam(params)
@@ -174,6 +176,7 @@ func (a *API) CreateUnitorderOrder(param *CreateUnitorderOrderParam) (result *Cr
params["notify_url"] = param.NotifyUrl
params["reqsn"] = param.Reqsn
params["acct"] = param.Acct
params["paytype"] = param.PayType
retVal, err := a.AccessAPI(sepcAction, params)
if err == nil {
utils.Map2StructByJson(retVal, &result, false)