Commit 15c8ac33 authored by wangp's avatar wangp

lakala

parent c9fa6d48
...@@ -281,12 +281,15 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{}, ...@@ -281,12 +281,15 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{},
func lakala_post(input *models.PlaceAnOrderParamInput, url string, data_json []byte) (error, interface{}, interface{}) { func lakala_post(input *models.PlaceAnOrderParamInput, url string, data_json []byte) (error, interface{}, interface{}) {
var source_code, platform_type uint8 var source_code, platform_type uint8
var order_id string
if input==nil { if input==nil {
source_code = 0 //支付方式 source_code = 0 //支付方式
platform_type = 0 //平台类型 platform_type = 0 //平台类型
order_id = "" //订单号
} else { } else {
source_code = input.SourceCode //支付方式 source_code = input.SourceCode //支付方式
platform_type = input.PlatformType //平台类型 platform_type = input.PlatformType //平台类型
order_id = input.OrderId //订单号
} }
authorization, err := getAuthorization(platform_type, string(data_json)) authorization, err := getAuthorization(platform_type, string(data_json))
...@@ -324,15 +327,16 @@ func lakala_post(input *models.PlaceAnOrderParamInput, url string, data_json []b ...@@ -324,15 +327,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)
response["out_trade_no"] = order_id
if source_code==4 || source_code==6 || source_code==1 || source_code==5 || source_code==15 || input.SourceCode==16 || input.SourceCode==17 { if source_code==4 || source_code==6 || source_code==1 || source_code==5 || source_code==15 || input.SourceCode==16 || input.SourceCode==17 {
//聚合收银台(微信H5、支付宝H5、微信扫码、支付宝扫码、快捷支付(银行卡)) //聚合收银台(微信H5、支付宝H5、微信扫码、支付宝扫码、快捷支付(银行卡)(包括微信小程序))
//聚合收银台(微信小程序-必康自营)、聚合JSAPI(微信小程序-必康自营) //聚合收银台(微信小程序-必康自营)、聚合JSAPI(微信小程序-必康自营)
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 || source_code==17 { if source_code==4 || source_code==6 || source_code==15 || source_code==17 {
//微信H5、支付宝H5、快捷支付(银行卡) //微信H5、支付宝H5、快捷支付(银行卡)(包括微信小程序)
//聚合收银台(微信JSAPI-必康自营) //聚合收银台(微信JSAPI-必康自营)
response["m_web_url"] = temp2["counter_url"].(string) response["m_web_url"] = temp2["counter_url"].(string)
} else if source_code==1 || source_code==5 { } else if source_code==1 || source_code==5 {
......
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