Commit f437a8f9e22fd20b1c46f0fa8a3688609f98f2ef

Authored by Wen
Committed by GitHub
1 parent 86dc2f91
Exists in master

Corrected example for sandbox mode

Due to changes to the method get_sandbox_signkey, the mch_id and sandbox mode need to be set before retrieving sanbox signkey
Showing 1 changed file with 3 additions and 2 deletions   Show diff stats
@@ -55,12 +55,13 @@ WxPay.extra_rest_client_options = {timeout: 2, open_timeout: 3} @@ -55,12 +55,13 @@ WxPay.extra_rest_client_options = {timeout: 2, open_timeout: 3}
55 If you need to use sandbox mode. 55 If you need to use sandbox mode.
56 56
57 ```ruby 57 ```ruby
58 -result = WxPay::Service.get_sandbox_signkey('YOUR_MCH_ID')  
59 -WxPay.key = result['sandbox_signkey']  
60 WxPay.appid = 'YOUR_APPID' 58 WxPay.appid = 'YOUR_APPID'
61 WxPay.mch_id = 'YOUR_MCH_ID' 59 WxPay.mch_id = 'YOUR_MCH_ID'
62 WxPay.debug_mode = true # default is `true` 60 WxPay.debug_mode = true # default is `true`
63 WxPay.sandbox_mode = true # default is `false` 61 WxPay.sandbox_mode = true # default is `false`
  62 +result = WxPay::Service.get_sandbox_signkey
  63 +WxPay.key = result['sandbox_signkey']
  64 +
64 ``` 65 ```
65 66
66 Note: You should create your APIKEY (Link to [微信商户平台](https://pay.weixin.qq.com/index.php/home/login)) first if you haven't, and pay attention that **the length of the APIKEY should be 32**. 67 Note: You should create your APIKEY (Link to [微信商户平台](https://pay.weixin.qq.com/index.php/home/login)) first if you haven't, and pay attention that **the length of the APIKEY should be 32**.