wx_pay 0.14.2 → 0.15.0
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 +12 -0
- data/lib/wx_pay/version.rb +1 -1
- data/test/test_helper.rb +1 -1
- data/test/wx_pay/service_test.rb +1 -5
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7716b9c31fb5cbf24db64ca0aad7c228ab1dc1f
|
4
|
+
data.tar.gz: ec0a6c208012f09829ff8e2b37238a25b5c07659
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4edecc4552ee556a99620920fb3126d09f7ae3d478c7544e6981827375edd35ed8c452037ee9616dcd5bcede35626f434f3e0e41a3e416dda1e95583b2794e94
|
7
|
+
data.tar.gz: 4ac03cae8b014baadad894fe6ef26f528e1f27c41ec12d35414a787f4471fbcb04436d2736616e191d38c5875595bf30f682eb91d927276fe3e1fae2bbb497b6
|
data/lib/wx_pay/service.rb
CHANGED
@@ -25,6 +25,18 @@ module WxPay
|
|
25
25
|
), quirks_mode: true)
|
26
26
|
end
|
27
27
|
|
28
|
+
def self.authenticate_from_weapp(js_code, options = {})
|
29
|
+
options = WxPay.extra_rest_client_options.merge(options)
|
30
|
+
url = "https://api.weixin.qq.com/sns/jscode2session?appid=#{WxPay.appid}&secret=#{WxPay.appsecret}&js_code=#{js_code}&grant_type=authorization_code"
|
31
|
+
|
32
|
+
::JSON.parse(RestClient::Request.execute(
|
33
|
+
{
|
34
|
+
method: :get,
|
35
|
+
url: url
|
36
|
+
}.merge(options)
|
37
|
+
), quirks_mode: true)
|
38
|
+
end
|
39
|
+
|
28
40
|
INVOKE_UNIFIEDORDER_REQUIRED_FIELDS = [:body, :out_trade_no, :total_fee, :spbill_create_ip, :notify_url, :trade_type]
|
29
41
|
def self.invoke_unifiedorder(params, options = {})
|
30
42
|
params = {
|
data/lib/wx_pay/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
data/test/wx_pay/service_test.rb
CHANGED
@@ -32,11 +32,7 @@ class ServiceTest < MiniTest::Test
|
|
32
32
|
</xml>
|
33
33
|
EOF
|
34
34
|
|
35
|
-
|
36
|
-
:post,
|
37
|
-
%r|https://api\.mch\.weixin\.qq\.com*|,
|
38
|
-
body: response_body
|
39
|
-
)
|
35
|
+
stub_request(:post, 'api.mch.weixin.qq.com').to_return(body: response_body)
|
40
36
|
end
|
41
37
|
|
42
38
|
def test_accept_multiple_app_id_when_invoke
|
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.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jasl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -67,19 +67,19 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '11.2'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: webmock
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '2.3'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '2.3'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: minitest
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
version: '0'
|
133
133
|
requirements: []
|
134
134
|
rubyforge_project:
|
135
|
-
rubygems_version: 2.6.
|
135
|
+
rubygems_version: 2.6.11
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: An unofficial simple wechat pay gem
|