Jerry 6 anni fa
parent
commit
da4a15f0f6
3 ha cambiato i file con 8 aggiunte e 8 eliminazioni
  1. 2 2
      alipay_client.go
  2. 2 2
      alipay_client_test.go
  3. 4 4
      constant.go

+ 2 - 2
alipay_client.go

@@ -313,10 +313,10 @@ func (this *aliPayClient) doAliPay(body BodyMap, method string) (bytes []byte, e
 	if method == "alipay.trade.page.pay" {
 		if !this.isProd {
 			//沙箱环境
-			return []byte(zfb_sanbox_base_url + "?" + urlParam), nil
+			return []byte(zfb_sanbox_base_url_2 + "?" + urlParam), nil
 		} else {
 			//正式环境
-			return []byte(zfb_base_url + "?" + urlParam), nil
+			return []byte(zfb_base_url_2 + "?" + urlParam), nil
 		}
 	}
 	var url string

+ 2 - 2
alipay_client_test.go

@@ -152,7 +152,7 @@ func TestAliPayClient_AliPayTradeWapPay(t *testing.T) {
 	//请求参数
 	body := make(BodyMap)
 	body.Set("subject", "手机网站测试支付")
-	body.Set("out_trade_no", "GYWX201901301040355706100462")
+	body.Set("out_trade_no", "GYWX201901301040355706100463")
 	body.Set("quit_url", "https://www.gopay.ink")
 	body.Set("total_amount", "100.00")
 	body.Set("product_code", "QUICK_WAP_WAY")
@@ -205,7 +205,7 @@ func TestAliPayClient_AliPayTradePagePay(t *testing.T) {
 	//请求参数
 	body := make(BodyMap)
 	body.Set("subject", "网站测试支付")
-	body.Set("out_trade_no", "GYWX201901301040355706100449")
+	body.Set("out_trade_no", "GYWX201901301040355706100464")
 	body.Set("total_amount", "88.88")
 	body.Set("product_code", "FAST_INSTANT_TRADE_PAY")
 

+ 4 - 4
constant.go

@@ -49,8 +49,8 @@ const (
 	//
 	//===========================================================================================
 	//
-	//zfb_base_url        = "https://openapi.alipay.com/gateway.do"
-	zfb_base_url = "https://openapi.alipay.com/gateway.do?charset=utf-8"
-	//zfb_sanbox_base_url = "https://openapi.alipaydev.com/gateway.do"
-	zfb_sanbox_base_url = "https://openapi.alipaydev.com/gateway.do?charset=utf-8"
+	zfb_base_url_2        = "https://openapi.alipay.com/gateway.do"
+	zfb_sanbox_base_url_2 = "https://openapi.alipaydev.com/gateway.do"
+	zfb_base_url          = "https://openapi.alipay.com/gateway.do?charset=utf-8"
+	zfb_sanbox_base_url   = "https://openapi.alipaydev.com/gateway.do?charset=utf-8"
 )