From 330bf1782eb398db44c233cb1ebdbc11ac94dac6 Mon Sep 17 00:00:00 2001 From: wangp <wangpei@gmail.com> Date: Fri, 25 Aug 2023 18:12:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=89=E5=8D=A1=E6=8B=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repository/pay/pay.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/repository/pay/pay.go b/repository/pay/pay.go index 658ad2b..d8dd0bd 100755 --- a/repository/pay/pay.go +++ b/repository/pay/pay.go @@ -111,9 +111,11 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{}, //source_code 1: 微信 Native 2:微信å°ç¨‹åº 3:微信内支付 4:h5 跳微信 //5:支付å®(web)-æ‰«ç æˆ–登录支付å®è´¦æˆ· 6:alipay(mobile) 7:alipay(app) - //9: B2C 10:bk支付å®web 11:bk æ”¯ä»˜å®æ‰‹æœº 15:å¿«æ·æ”¯ä»˜(银行å¡) - if input.SourceCode==4 || input.SourceCode==6 ||input.SourceCode==1 || input.SourceCode==5 || input.SourceCode==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 || input.SourceCode==16 { //èšåˆæ”¶é“¶å°(微信H5ã€æ”¯ä»˜å®H5ã€å¾®ä¿¡æ‰«ç ã€æ”¯ä»˜å®æ‰«ç ) + //èšåˆæ”¶é“¶å°(微信å°ç¨‹åº-必康自è¥) //url = "https://test.wsmsd.cn/sit/api/v3/ccss/counter/order/create" //èšåˆæ”¶é“¶å° url = setting.Conf.Lakala.UrlCreate //èšåˆæ”¶é“¶å° @@ -134,7 +136,7 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{}, if input.SourceCode==15 { //å¿«æ·æ”¯ä»˜ 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\"}" } else { @@ -228,7 +230,7 @@ func UnifiedOrder(input *models.PlaceAnOrderParamInput, ip string) (interface{}, data["req_data"] = data2 } else { - return nil, errors.New("è¾“å…¥å‚æ•°ã€Œsource_codeã€é”™è¯¯ï¼Œæœ‰æ•ˆå€¼ä¸º[1-6,9,15]") + return nil, errors.New("è¾“å…¥å‚æ•°ã€Œsource_codeã€é”™è¯¯ï¼Œæœ‰æ•ˆå€¼ä¸º[1-6,9,15,16]") } //æ•°æ®é‡ç»„ - end fmt.Println("æ‹‰å¡æ‹‰è¾“入傿•°") @@ -319,14 +321,16 @@ func lakala_post(input *models.PlaceAnOrderParamInput, url string, data_json []b //return nil, temp["resp_data"]["counter_url"] 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ã€å¾®ä¿¡æ‰«ç ã€æ”¯ä»˜å®æ‰«ç ã€å¿«æ·æ”¯ä»˜(银行å¡)) + //èšåˆæ”¶é“¶å°(微信å°ç¨‹åº-必康自è¥) temp2, _ := temp["resp_data"].(map[string]interface{}) if temp2["counter_url"]=="" { 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ã€å¿«æ·æ”¯ä»˜(银行å¡) + //èšåˆæ”¶é“¶å°(微信å°ç¨‹åº-必康自è¥) response["m_web_url"] = temp2["counter_url"].(string) } else { //微信扫ç ã€æ”¯ä»˜å®æ‰«ç @@ -764,7 +768,7 @@ func selectRefundBill(tx *sql.Tx, input *models.RefundParamInput) (string, strin } 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]") } // 获å–ã€Œå¯¹è´¦å•æµæ°´å·ã€å’Œã€Œäº¤æ˜“终端å·ã€ï¼Œé€€æ¬¾ç”¨ -- 2.18.1