Commit 330bf178 authored by wangp's avatar wangp

拉卡拉

parent 92b92866
...@@ -111,9 +111,11 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{}, ...@@ -111,9 +111,11 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{},
//source_code 1: 微信 Native 2:微信小程序 3:微信内支付 4:h5 跳微信 //source_code 1: 微信 Native 2:微信小程序 3:微信内支付 4:h5 跳微信
//5:支付宝(web)-扫码或登录支付宝账户 6:alipay(mobile) 7:alipay(app) //5:支付宝(web)-扫码或登录支付宝账户 6:alipay(mobile) 7:alipay(app)
//9: B2C 10:bk支付宝web 11:bk 支付宝手机 15:快捷支付(银行卡) //9: B2C 10:bk支付宝web 11:bk 支付宝手机 15:快捷支付(银行卡) 16:微信小程序-必康自营
if input.SourceCode==4 || input.SourceCode==6 ||input.SourceCode==1 || input.SourceCode==5 || input.SourceCode==15 { if input.SourceCode==4 || input.SourceCode==6 ||input.SourceCode==1 ||
input.SourceCode==5 || input.SourceCode==15 || input.SourceCode==16 {
//聚合收银台(微信H5、支付宝H5、微信扫码、支付宝扫码) //聚合收银台(微信H5、支付宝H5、微信扫码、支付宝扫码)
//聚合收银台(微信小程序-必康自营)
//url = "https://test.wsmsd.cn/sit/api/v3/ccss/counter/order/create" //聚合收银台 //url = "https://test.wsmsd.cn/sit/api/v3/ccss/counter/order/create" //聚合收银台
url = setting.Conf.Lakala.UrlCreate //聚合收银台 url = setting.Conf.Lakala.UrlCreate //聚合收银台
...@@ -134,7 +136,7 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{}, ...@@ -134,7 +136,7 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{},
if input.SourceCode==15 { if input.SourceCode==15 {
//快捷支付 //快捷支付
data2["counter_param"] = "{\"pay_mode\":\"QUICK_PAY\"}" data2["counter_param"] = "{\"pay_mode\":\"QUICK_PAY\"}"
} else if input.SourceCode < 5 { } else if input.SourceCode < 5 || input.SourceCode==16 {
//微信 //微信
data2["counter_param"] = "{\"pay_mode\":\"WECHAT\"}" data2["counter_param"] = "{\"pay_mode\":\"WECHAT\"}"
} else { } else {
...@@ -228,7 +230,7 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{}, ...@@ -228,7 +230,7 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{},
data["req_data"] = data2 data["req_data"] = data2
} else { } else {
return nil, errors.New("输入参数「source_code」错误,有效值为[1-6,9,15]") return nil, errors.New("输入参数「source_code」错误,有效值为[1-6,9,15,16]")
} }
//数据重组 - end //数据重组 - end
fmt.Println("拉卡拉输入参数") fmt.Println("拉卡拉输入参数")
...@@ -319,14 +321,16 @@ func lakala_post(input *models.PlaceAnOrderParamInput, url string, data_json []b ...@@ -319,14 +321,16 @@ func lakala_post(input *models.PlaceAnOrderParamInput, url string, data_json []b
//return nil, temp["resp_data"]["counter_url"] //return nil, temp["resp_data"]["counter_url"]
response := make(map[string]string) response := make(map[string]string)
if source_code==4 || source_code==6 || source_code==1 || source_code==5 || source_code==15 { if source_code==4 || source_code==6 || source_code==1 || source_code==5 || source_code==15 || input.SourceCode==16 {
//聚合收银台(微信H5、支付宝H5、微信扫码、支付宝扫码、快捷支付(银行卡)) //聚合收银台(微信H5、支付宝H5、微信扫码、支付宝扫码、快捷支付(银行卡))
//聚合收银台(微信小程序-必康自营)
temp2, _ := temp["resp_data"].(map[string]interface{}) temp2, _ := temp["resp_data"].(map[string]interface{})
if temp2["counter_url"]=="" { if temp2["counter_url"]=="" {
return errors.New("拉卡拉返回值「counter_url」为空错误"), "", temp return errors.New("拉卡拉返回值「counter_url」为空错误"), "", temp
} }
if source_code==4 || source_code==6 || source_code==15 { if source_code==4 || source_code==6 || source_code==15 || input.SourceCode==16 {
//微信H5、支付宝H5、快捷支付(银行卡) //微信H5、支付宝H5、快捷支付(银行卡)
//聚合收银台(微信小程序-必康自营)
response["m_web_url"] = temp2["counter_url"].(string) response["m_web_url"] = temp2["counter_url"].(string)
} else { } else {
//微信扫码、支付宝扫码 //微信扫码、支付宝扫码
...@@ -764,7 +768,7 @@ func selectRefundBill(tx *sql.Tx, input *models.RefundParamInput) (string, strin ...@@ -764,7 +768,7 @@ func selectRefundBill(tx *sql.Tx, input *models.RefundParamInput) (string, strin
} }
if source_code==0 { if source_code==0 {
return "", "", 0, 0, errors.New("「source_code」错误,有效值为[1-6,9,15]") return "", "", 0, 0, errors.New("「source_code」错误,有效值为[1-6,9,15,16]")
} }
// 获取「对账单流水号」和「交易终端号」,退款用 // 获取「对账单流水号」和「交易终端号」,退款用
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment