wx_pay 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26631d0b6453cdf713cd357010b70e2cbe4e20cf
4
- data.tar.gz: a402861f8e9e17c8ff9e2c1e60635d5e85f0bf37
3
+ metadata.gz: 7c46a29e5c22d6e86f78da2d7c92fba8204ae67c
4
+ data.tar.gz: 9246f29160dba30f1f990b8a278a666e1f0d6acb
5
5
  SHA512:
6
- metadata.gz: 08307967ea0a4798793aa0f82542ac82d68b742f08b42c46c20f1c5d81782add4b9aef98de0edda004487f743c6026bb4dfab6292491ecc26fa831edf8f71222
7
- data.tar.gz: b1123a5fb210ca54be2b6c4388212ee8f021b661c72d4855a9c0cbfaba64c779835db4ca3e817e5cc7cca5ccedf001b7150a192b11af1a8ed49b2038cc890684
6
+ metadata.gz: 0d28f442024679881952cc57e3c1ddc3151eee0344396c3294b71e04e01db659cf1e9427f8f40c03f915917aef66cce2bef52e0e8dac5f3d85dc29f91f9de6c1
7
+ data.tar.gz: 75091fb1b3df4e26720c380c988573adf6b6f5e4f1c9839e30bdee3b61fd9b0de9b6a8a060f8f47e6c2670ff8aa7ba598bfe294bbe3f8c944ca88cd2625d14ad
@@ -10,7 +10,7 @@ module WxPay
10
10
  params = {
11
11
  appid: WxPay.appid,
12
12
  mch_id: WxPay.mch_id,
13
- nonce_str: SecureRandom.uuid.tr('-', ''),
13
+ nonce_str: SecureRandom.uuid.tr('-', '')
14
14
  }.merge(params)
15
15
 
16
16
  check_required_options(params, INVOKE_UNIFIEDORDER_REQUIRED_FIELDS)
@@ -22,6 +22,22 @@ module WxPay
22
22
  r
23
23
  end
24
24
 
25
+ GENERATE_APP_PAY_REQ_REQUIRED_FIELDS = %i(prepayid noncestr)
26
+ def self.generate_app_pay_req(params)
27
+ params = {
28
+ appid: WxPay.appid,
29
+ partnerid: WxPay.mch_id,
30
+ package: 'Sign=WXPay',
31
+ timestamp: Time.now.to_i.to_s
32
+ }.merge(params)
33
+
34
+ check_required_options(params, GENERATE_APP_PAY_REQ_REQUIRED_FIELDS)
35
+
36
+ params[:sign] = WxPay::Sign.generate(params)
37
+
38
+ params
39
+ end
40
+
25
41
  private
26
42
 
27
43
  def self.check_required_options(options, names)
@@ -1,3 +1,3 @@
1
1
  module WxPay
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wx_pay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jasl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-13 00:00:00.000000000 Z
11
+ date: 2015-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client