Skip to content

Commit

Permalink
add china2
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoogle-ink committed Aug 11, 2019
1 parent 3b22e98 commit 685b702
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 7 additions & 5 deletions constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" //提交付款码支付
Expand Down
4 changes: 3 additions & 1 deletion wechat_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 685b702

Please sign in to comment.