Jerry 6 lat temu
rodzic
commit
685b702835
2 zmienionych plików z 10 dodań i 6 usunięć
  1. 7 5
      constant.go
  2. 3 1
      wechat_params.go

+ 7 - 5
constant.go

@@ -10,13 +10,15 @@ const (
 
 	//境外国家地区
 	China         Country = 1 //中国国内
-	SoutheastAsia Country = 2 //东南亚
-	Other         Country = 3 //其他国家
+	China2        Country = 2 //中国国内(冗灾方案)
+	SoutheastAsia Country = 3 //东南亚
+	Other         Country = 4 //其他国家
 
 	//URL
-	wx_base_url_ch = "https://api.mch.weixin.qq.com/"   //中国国内
-	wx_base_url_hk = "https://apihk.mch.weixin.qq.com/" //东南亚
-	wx_base_url_us = "https://apius.mch.weixin.qq.com/" //其他
+	wx_base_url_ch  = "https://api.mch.weixin.qq.com/"   //中国国内
+	wx_base_url_ch2 = "https://api2.mch.weixin.qq.com/"  //中国国内
+	wx_base_url_hk  = "https://apihk.mch.weixin.qq.com/" //东南亚
+	wx_base_url_us  = "https://apius.mch.weixin.qq.com/" //其他
 
 	//正式
 	wx_Micropay          = "pay/micropay"                    //提交付款码支付

+ 3 - 1
wechat_params.go

@@ -16,11 +16,13 @@ type Country int
 
 //设置支付国家(默认:中国国内)
 //    根据支付地区情况设置国家
-//    country:<China:中国国内,SoutheastAsia:东南亚,Other:其他国家>
+//    country:<China:中国国内,China2:中国国内(冗灾方案),SoutheastAsia:东南亚,Other:其他国家>
 func (this *weChatClient) SetCountry(country Country) (client *weChatClient) {
 	switch country {
 	case China:
 		this.baseURL = wx_base_url_ch
+	case China2:
+		this.baseURL = wx_base_url_ch2
 	case SoutheastAsia:
 		this.baseURL = wx_base_url_hk
 	case Other: