Commit 399f4f01c3dbb5dba137e5e8210a15ac68973eaf

Authored by Kexian Zhong
Committed by GitHub
1 parent e6288b5a
Exists in master

pay request for JSAPI noncestr should be rand

I checked JSAPI, the noncestr is not require to be same with invoke_unifiedorder. 
And it's recommended to be random as the official doc said: "微信支付API接口协议中包含字段nonce_str,主要保证签名不可预测"
Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
@@ -180,7 +180,7 @@ r = WxPay::Service.generate_app_pay_req params @@ -180,7 +180,7 @@ r = WxPay::Service.generate_app_pay_req params
180 # required fields 180 # required fields
181 params = { 181 params = {
182 prepayid: '1101000000140415649af9fc314aa427', # fetch by call invoke_unifiedorder with `trade_type` is `JSAPI` 182 prepayid: '1101000000140415649af9fc314aa427', # fetch by call invoke_unifiedorder with `trade_type` is `JSAPI`
183 - noncestr: '1101000000140429eb40476f8896f4c9', # must same as given to invoke_unifiedorder 183 + noncestr: SecureRandom.hex(16),
184 } 184 }
185 185
186 # call generate_js_pay_req 186 # call generate_js_pay_req