Commit 640e19162a7b34132660b7f2f4b22d5ae51a2fec

Authored by fxg
1 parent 19d26141
Exists in master

generate_js_pay_req: lost api key

Showing 1 changed file with 4 additions and 3 deletions   Show diff stats
lib/wx_pay/service.rb
... ... @@ -42,7 +42,7 @@ module WxPay
42 42  
43 43 r
44 44 end
45   -
  45 +
46 46 INVOKE_CLOSEORDER_REQUIRED_FIELDS = [:out_trade_no]
47 47 def self.invoke_closeorder(params, options = {})
48 48 params = {
... ... @@ -50,7 +50,7 @@ module WxPay
50 50 mch_id: options.delete(:mch_id) || WxPay.mch_id,
51 51 key: options.delete(:key) || WxPay.key,
52 52 nonce_str: SecureRandom.uuid.tr('-', '')
53   - }.merge(params)
  53 + }.merge(params)
54 54  
55 55 check_required_options(params, INVOKE_CLOSEORDER_REQUIRED_FIELDS)
56 56  
... ... @@ -85,6 +85,7 @@ module WxPay
85 85 params = {
86 86 appId: options.delete(:appid) || WxPay.appid,
87 87 package: "prepay_id=#{params.delete(:prepayid)}",
  88 + key: options.delete(:key) || WxPay.key,
88 89 nonceStr: params.delete(:noncestr),
89 90 timeStamp: Time.now.to_i.to_s,
90 91 signType: 'MD5'
... ... @@ -285,7 +286,7 @@ module WxPay
285 286  
286 287 r
287 288 end
288   -
  289 +
289 290 def self.sendredpack(params, options={})
290 291 params = {
291 292 wxappid: options.delete(:appid) || WxPay.appid,
... ...