wx_pay 0.8.0 → 0.8.1
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.rb +7 -1
- data/lib/wx_pay/service.rb +1 -0
- data/lib/wx_pay/sign.rb +2 -2
- data/lib/wx_pay/version.rb +1 -1
- data/test/test_helper.rb +1 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4ff7a9ba32dc3cea756ed66865b66f5ef440311
|
4
|
+
data.tar.gz: ce07f1c5496ff7ac19c3f6ae1381eda0603bb804
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ede1fdd18df2e2bb111b8ada4d8a1073a9f22414d35df9269553d4330ad704a692a598473ddcef5ccdda1ae3cbdc31b8178527b7d2273ad9f1a774ca3063c5b
|
7
|
+
data.tar.gz: b2d5d04eed82a6a0450aa17c08637d23f20785a1d7db7569141ab4410705ed85d24b29383cb1ff17c854189425515483dfea128f5184951c20d0f9ca92225784
|
data/lib/wx_pay.rb
CHANGED
@@ -5,9 +5,11 @@ require 'openssl'
|
|
5
5
|
|
6
6
|
module WxPay
|
7
7
|
@extra_rest_client_options = {}
|
8
|
+
@debug_mode = true
|
8
9
|
|
9
10
|
class<< self
|
10
|
-
attr_accessor :appid, :mch_id, :key, :
|
11
|
+
attr_accessor :appid, :mch_id, :key, :extra_rest_client_options, :debug_mode
|
12
|
+
attr_reader :apiclient_cert, :apiclient_key
|
11
13
|
|
12
14
|
def set_apiclient_by_pkcs12(str, pass)
|
13
15
|
pkcs12 = OpenSSL::PKCS12.new(str, pass)
|
@@ -24,5 +26,9 @@ module WxPay
|
|
24
26
|
def apiclient_key=(key)
|
25
27
|
@apiclient_key = OpenSSL::PKey::RSA.new(key)
|
26
28
|
end
|
29
|
+
|
30
|
+
def debug_mode?
|
31
|
+
@debug_mode
|
32
|
+
end
|
27
33
|
end
|
28
34
|
end
|
data/lib/wx_pay/service.rb
CHANGED
data/lib/wx_pay/sign.rb
CHANGED
@@ -5,8 +5,8 @@ module WxPay
|
|
5
5
|
def self.generate(params)
|
6
6
|
key = params.delete(:key)
|
7
7
|
|
8
|
-
query = params.sort.map do |
|
9
|
-
"#{
|
8
|
+
query = params.sort.map do |k, v|
|
9
|
+
"#{k}=#{v}" if v.to_s != ''
|
10
10
|
end.compact.join('&')
|
11
11
|
|
12
12
|
Digest::MD5.hexdigest("#{query}&key=#{key || WxPay.key}").upcase
|
data/lib/wx_pay/version.rb
CHANGED
data/test/test_helper.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.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jasl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '11.2'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '11.2'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: fakeweb
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|