wx_pay 0.7.1 → 0.8.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 +21 -4
- 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: d986c63e59418f4f41abdf7964f439a044335012
|
4
|
+
data.tar.gz: 74505540b958d4f1725f0763e62caaff2db4d911
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 974a4df080f52a1269cb7890adf235b8d27671bb66a6f10bd320871b88eaa5975d9e11643f3909c30a2b7653985e61d46305433b41b03285a276e6f32daac756
|
7
|
+
data.tar.gz: 5356b1639c8a8a141406267fdf595b5affe729f179dc78558802eee50d06e6305f3c2f81f1ddd539fc24890a807034ebbd58c156d076ef8aa4f5f2c173aacab1
|
data/lib/wx_pay/service.rb
CHANGED
@@ -183,7 +183,24 @@ module WxPay
|
|
183
183
|
|
184
184
|
r
|
185
185
|
end
|
186
|
-
|
186
|
+
|
187
|
+
DOWNLOAD_BILL_REQUIRED_FIELDS = [:bill_date, :bill_type]
|
188
|
+
def self.download_bill(params, options = {})
|
189
|
+
params = {
|
190
|
+
appid: options.delete(:appid) || WxPay.appid,
|
191
|
+
mch_id: options.delete(:mch_id) || WxPay.mch_id,
|
192
|
+
nonce_str: SecureRandom.uuid.tr('-', ''),
|
193
|
+
}.merge(params)
|
194
|
+
|
195
|
+
check_required_options(params, DOWNLOAD_BILL_REQUIRED_FIELDS)
|
196
|
+
|
197
|
+
r = invoke_remote("#{GATEWAY_URL}/pay/downloadbill", make_payload(params), options)
|
198
|
+
|
199
|
+
yield r if block_given?
|
200
|
+
|
201
|
+
r
|
202
|
+
end
|
203
|
+
|
187
204
|
def self.sendgroupredpack(params, options={})
|
188
205
|
params = {
|
189
206
|
wxappid: options.delete(:appid) || WxPay.appid,
|
@@ -255,10 +272,10 @@ module WxPay
|
|
255
272
|
}.merge(options)
|
256
273
|
)
|
257
274
|
|
258
|
-
|
275
|
+
begin
|
259
276
|
WxPay::Result.new(Hash.from_xml(r))
|
260
|
-
|
261
|
-
|
277
|
+
rescue REXML::ParseException
|
278
|
+
r
|
262
279
|
end
|
263
280
|
end
|
264
281
|
end
|
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.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jasl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|