Commit 7887f0360ca3a4bbc54194020bef9c3aef237e07
1 parent
a359d437
Exists in
master
Compose package in generete_js_pay_req
Showing
1 changed file
with
3 additions
and
2 deletions
Show diff stats
lib/wx_pay/service.rb
... | ... | @@ -58,11 +58,12 @@ module WxPay |
58 | 58 | params |
59 | 59 | end |
60 | 60 | |
61 | - GENERATE_JS_PAY_REQ_REQUIRED_FIELDS = [:appid, :noncestr, :package] | |
61 | + GENERATE_JS_PAY_REQ_REQUIRED_FIELDS = [:prepayid, :noncestr] | |
62 | 62 | def self.generate_js_pay_req(params, options = {}) |
63 | 63 | params = { |
64 | 64 | appId: options.delete(:appid) || WxPay.appid, |
65 | - nonceStr: params.delete(:noncestr), | |
65 | + package: "prepay_id=#{params[:prepayid]}", | |
66 | + nonceStr: params[:noncestr], | |
66 | 67 | timeStamp: Time.now.to_i.to_s, |
67 | 68 | signType: 'MD5' |
68 | 69 | }.merge(params) | ... | ... |