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 +4 -4
- data/lib/wx_pay/service.rb +17 -1
- data/lib/wx_pay/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c46a29e5c22d6e86f78da2d7c92fba8204ae67c
|
4
|
+
data.tar.gz: 9246f29160dba30f1f990b8a278a666e1f0d6acb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d28f442024679881952cc57e3c1ddc3151eee0344396c3294b71e04e01db659cf1e9427f8f40c03f915917aef66cce2bef52e0e8dac5f3d85dc29f91f9de6c1
|
7
|
+
data.tar.gz: 75091fb1b3df4e26720c380c988573adf6b6f5e4f1c9839e30bdee3b61fd9b0de9b6a8a060f8f47e6c2670ff8aa7ba598bfe294bbe3f8c944ca88cd2625d14ad
|
data/lib/wx_pay/service.rb
CHANGED
@@ -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)
|
data/lib/wx_pay/version.rb
CHANGED
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.
|
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
|
11
|
+
date: 2015-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|