alipay 0.15.1 → 0.15.2

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
- SHA1:
3
- metadata.gz: '09613954cbb2717b9bf8b39d884c34586955a6ff'
4
- data.tar.gz: 68ff46cddf2dcab1bbee320a2cbcb6aa8a02984a
2
+ SHA256:
3
+ metadata.gz: 46b46f90c6340aeb58cf9de3a967423f390fa0444a63635f0548bace4019a61f
4
+ data.tar.gz: b011da754fa7343f08785829906b33014807794184b130a0d413dfee3048e679
5
5
  SHA512:
6
- metadata.gz: 3c4c7634bf06766e46c7d75f9fb0641b73cd8c8549828478d30509afb27e42792b1e24c07b2b3c51cfddf59c13a4059815612202f2105602f5b58a94d34467dd
7
- data.tar.gz: d17d7fe8ca5797da669d0a4bc6563d8fbd7ce24bf57b01ceac7a1860c6c8997872644c053edcdb6ede8f322bce8cb1eaa31054929f2ee73336209f37e9e01612
6
+ metadata.gz: '033712118c048e90a8e45189d4483fcef0c549c68c21182c2c09b3b72cefe9c32ee75b1645b39dc8f54346315a47fd8f17013f02e897f4399f1be6ccf1727f68'
7
+ data.tar.gz: ed308742f277d296686254a6801269db4c33ea32fcc2f64b7df6bc778913332050426970638f5797639db9f45c8773d1c7476dcae0ab51fe20bf2e296e42537a
@@ -1,5 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3.0
4
- - 2.2.4
5
- - 2.1.8
3
+ - 2.5.1
4
+ - 2.4.4
5
+ - 2.3.6
@@ -1,5 +1,9 @@
1
1
  ## master
2
2
 
3
+ ## v0.15.2 (2019-08-02)
4
+
5
+ - page_execute_form invalid-signature charset, thanks @lingceng #90
6
+
3
7
  ## v0.15.1 (2018-06-16)
4
8
 
5
9
  - Add `partner` and `seller_id` options for legacy API, thanks @KQyongzhang #83
data/README.md CHANGED
@@ -56,12 +56,12 @@ ALIPAY_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----\nTq43T5...OVUAQb3R\n-----END PUBLI
56
56
  ```ruby
57
57
  @alipay_client.page_execute_url(
58
58
  method: 'alipay.trade.page.pay',
59
- biz_content: {
59
+ biz_content: JSON.generate({
60
60
  out_trade_no: '20160401000000',
61
61
  product_code: 'FAST_INSTANT_TRADE_PAY',
62
62
  total_amount: '0.01',
63
63
  subject: 'test'
64
- }.to_json(ascii_only: true), # to_json(ascii_only: true) is important!
64
+ }, ascii_only: true), # ascii_only is important!
65
65
  timestamp: '2016-04-01 00:00:00'
66
66
  )
67
67
 
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "bundler"
23
23
  spec.add_development_dependency "rake"
24
24
  spec.add_development_dependency "minitest"
25
25
  spec.add_development_dependency "webmock"
@@ -103,12 +103,12 @@ Alipay::Client.page_execute_url
103
103
  method: 'alipay.trade.page.pay',
104
104
  return_url: 'https://mystore.com/orders/20160401000000/return',
105
105
  notify_url: 'https://mystore.com/orders/20160401000000/notify',
106
- biz_content: {
106
+ biz_content: JSON.generate({
107
107
  out_trade_no: '20160401000000',
108
108
  product_code: 'FAST_INSTANT_TRADE_PAY',
109
109
  total_amount: '0.01',
110
110
  subject: 'Example #123'
111
- }.to_json(ascii_only: true)
111
+ }, ascii_only: true)
112
112
  )
113
113
  # => 'https://openapi.alipaydev.com/gateway.do?app_id=2016...'
114
114
  ```
@@ -141,13 +141,13 @@ Alipay::Client.page_execute_url
141
141
  method: 'alipay.trade.wap.pay',
142
142
  return_url: 'https://mystore.com/orders/20160401000000/return',
143
143
  notify_url: 'https://mystore.com/orders/20160401000000/notify',
144
- biz_content: {
144
+ biz_content: JSON.generate({
145
145
  out_trade_no: '20160401000000',
146
146
  product_code: 'QUICK_WAP_WAY',
147
147
  total_amount: '0.01',
148
148
  subject: 'Example: 456'
149
149
  quit_url: 'https://mystore.com/orders/20160401000000/'
150
- }.to_json(ascii_only: true)
150
+ }, ascii_only: true)
151
151
  )
152
152
  # => 'https://openapi.alipaydev.com/gateway.do?app_id=2016...'
153
153
  ```
@@ -174,11 +174,11 @@ Alipay::Client.execute
174
174
  response = @client.execute(
175
175
  method: 'alipay.trade.precreate',
176
176
  notify_url: 'https://mystore.com/orders/20160401000000/notify',
177
- biz_content: {
177
+ biz_content: JSON.generate({
178
178
  out_trade_no: '20160401000000',
179
179
  total_amount: '50.00',
180
180
  subject: 'QR Code Test'
181
- }.to_json(ascii_only: true)
181
+ }, ascii_only: true)
182
182
  )
183
183
  # => '{\"alipay_trade_precreate_response\":{\"code\"...'
184
184
 
@@ -217,11 +217,11 @@ Alipay::Client.execute (扫码支付)
217
217
  total_amount: '0.01',
218
218
  subject: 'Example #654',
219
219
  enable_pay_channels: 'balance,pcreditpayInstallment',
220
- extend_params: {
220
+ extend_params: JSON.generate({
221
221
  hb_fq_num: '6'',
222
222
  hb_fq_seller_percent: '0'
223
223
  }
224
- }.to_json(ascii_only: true)
224
+ }, ascii_only: true)
225
225
  )
226
226
  ```
227
227
  情景:商城网站不提供分期选项,但允许客户在支付宝的支付过程中自行决定分期付款。
@@ -230,13 +230,13 @@ Alipay::Client.execute (扫码支付)
230
230
  method: 'alipay.trade.page.pay',
231
231
  return_url: 'https://mystore.com/orders/20160401000000/return',
232
232
  notify_url: 'https://mystore.com/orders/20160401000000/notify',
233
- biz_content: {
233
+ biz_content: JSON.generate({
234
234
  out_trade_no: '20160401000000',
235
235
  product_code: 'FAST_INSTANT_TRADE_PAY',
236
236
  total_amount: '0.01',
237
237
  subject: 'Example #654',
238
238
  enable_pay_channels: 'balance,pcreditpayInstallment',
239
- }.to_json(ascii_only: true)
239
+ }, ascii_only: true)
240
240
  )
241
241
  ```
242
242
  #### 值得注意的参数
@@ -299,9 +299,9 @@ Alipay::Client.execute
299
299
  ```ruby
300
300
  response = @client.execute(
301
301
  method: 'alipay.trade.query',
302
- biz_content: {
302
+ biz_content: JSON.generate({
303
303
  trade_no: '2013112611001004680073956707',
304
- }.to_json(ascii_only: true)
304
+ }, ascii_only: true)
305
305
  )
306
306
  # => '{\"alipay_trade_query_response\":{\"code\"...'
307
307
 
@@ -333,9 +333,9 @@ Alipay::Client.execute
333
333
  response = @client.execute(
334
334
  method: 'alipay.trade.close',
335
335
  notify_url: 'https://mystore.com/orders/20160401000000/notify',
336
- biz_content: {
336
+ biz_content: JSON.generate({
337
337
  trade_no: '2013112611001004680073956707',
338
- }.to_json(ascii_only: true)
338
+ }, ascii_only: true)
339
339
  )
340
340
  # => '{\"alipay_trade_close_response\":{\"code\"...'
341
341
 
@@ -365,9 +365,9 @@ Alipay::Client.execute
365
365
  ```ruby
366
366
  response = @client.execute(
367
367
  method: 'alipay.trade.cancel',
368
- biz_content: {
368
+ biz_content: JSON.generate({
369
369
  out_trade_no: '20160401000000',
370
- }.to_json(ascii_only: true)
370
+ }, ascii_only: true)
371
371
  )
372
372
  # => '{\"alipay_trade_cancel_response\":{\"code\"...'
373
373
 
@@ -400,11 +400,11 @@ Alipay::Client.execute
400
400
  ```ruby
401
401
  response = @client.execute(
402
402
  method: 'alipay.trade.refund',
403
- biz_content: {
403
+ biz_content: JSON.generate({
404
404
  out_trade_no: '6c50789a0610',
405
405
  out_request_no: '6c50789a0610-1',
406
406
  refund_amount: '10.12'
407
- }.to_json(ascii_only: true)
407
+ }, ascii_only: true)
408
408
  )
409
409
  # => '{\"alipay_trade_refund_response\":{\"code\"...'
410
410
 
@@ -438,10 +438,10 @@ Alipay::Client.execute
438
438
  ```ruby
439
439
  response = @client.execute(
440
440
  method: 'alipay.trade.fastpay.refund.query',
441
- biz_content: {
441
+ biz_content: JSON.generate({
442
442
  out_trade_no: '6c50789a0610',
443
443
  out_request_no: '6c50789a0610-1'
444
- }.to_json(ascii_only: true)
444
+ }, ascii_only: true)
445
445
  )
446
446
  # => '{\"alipay_trade_fastpay_refund_query_response\":{\"code\"...'
447
447
 
@@ -473,12 +473,12 @@ Alipay::Client.execute
473
473
  ```ruby
474
474
  response = @client.execute(
475
475
  method: 'alipay.fund.trans.toaccount.transfer',
476
- biz_content: {
476
+ biz_content: JSON.generate({
477
477
  out_biz_no: '3142321423432',
478
478
  payee_type: 'ALIPAY_LOGONID',
479
479
  payee_account: 'customer@example.com',
480
480
  amount: '12.23'
481
- }.to_json(ascii_only: true)
481
+ }, ascii_only: true)
482
482
  )
483
483
  # => '{\"alipay_fund_trans_toaccount_transfer_response\":{\"code\"...'
484
484
 
@@ -511,9 +511,9 @@ Alipay::Client.execute
511
511
  ```ruby
512
512
  response = @client.execute(
513
513
  method: 'alipay.fund.trans.order.query',
514
- biz_content: {
514
+ biz_content: JSON.generate({
515
515
  out_biz_no: '3142321423432',
516
- }.to_json(ascii_only: true)
516
+ }, ascii_only: true)
517
517
  )
518
518
  # => '{\"alipay_fund_trans_order_query_response\":{\"code\"...'
519
519
 
@@ -101,12 +101,12 @@ This client method will generate a payment URL for redirecting customers to.
101
101
  method: 'alipay.trade.page.pay',
102
102
  return_url: 'https://mystore.com/orders/20160401000000/return',
103
103
  notify_url: 'https://mystore.com/orders/20160401000000/notify',
104
- biz_content: {
104
+ biz_content: JSON.generate({
105
105
  out_trade_no: '20160401000000',
106
106
  product_code: 'FAST_INSTANT_TRADE_PAY',
107
107
  total_amount: '0.01',
108
108
  subject: 'Example #123'
109
- }.to_json(ascii_only: true)
109
+ }, ascii_only: true)
110
110
  )
111
111
  # => 'https://openapi.alipaydev.com/gateway.do?app_id=2016...'
112
112
  ```
@@ -143,13 +143,13 @@ This method will generate a payment URL for redirecting customers to.
143
143
  method: 'alipay.trade.wap.pay',
144
144
  return_url: 'https://mystore.com/orders/20160401000000/return',
145
145
  notify_url: 'https://mystore.com/orders/20160401000000/notify',
146
- biz_content: {
146
+ biz_content: JSON.generate({
147
147
  out_trade_no: '20160401000000',
148
148
  product_code: 'QUICK_WAP_WAY',
149
149
  total_amount: '0.01',
150
150
  subject: 'Example: 456'
151
151
  quit_url: 'https://mystore.com/orders/20160401000000/'
152
- }.to_json(ascii_only: true)
152
+ }, ascii_only: true)
153
153
  )
154
154
  # => 'https://openapi.alipaydev.com/gateway.do?app_id=2016...'
155
155
  ```
@@ -177,11 +177,11 @@ Alipay::Client.execute
177
177
  response = @client.execute(
178
178
  method: 'alipay.trade.precreate',
179
179
  notify_url: 'https://mystore.com/orders/20160401000000/notify',
180
- biz_content: {
180
+ biz_content: JSON.generate({
181
181
  out_trade_no: '20160401000000',
182
182
  total_amount: '50.00',
183
183
  subject: 'QR Code Test'
184
- }.to_json(ascii_only: true)
184
+ }, ascii_only: true)
185
185
  )
186
186
  # => '{\"alipay_trade_precreate_response\":{\"code\"...'
187
187
 
@@ -214,7 +214,7 @@ Scenario: Customer pre-select a six-installment payment plan before going throug
214
214
  method: 'alipay.trade.page.pay',
215
215
  return_url: 'https://mystore.com/orders/20160401000000/return',
216
216
  notify_url: 'https://mystore.com/orders/20160401000000/notify',
217
- biz_content: {
217
+ biz_content: JSON.generate({
218
218
  out_trade_no: '20160401000000',
219
219
  product_code: 'FAST_INSTANT_TRADE_PAY',
220
220
  total_amount: '0.01',
@@ -224,7 +224,7 @@ Scenario: Customer pre-select a six-installment payment plan before going throug
224
224
  hb_fq_num: '6'',
225
225
  hb_fq_seller_percent: '0'
226
226
  }
227
- }.to_json(ascii_only: true)
227
+ }, ascii_only: true)
228
228
  )
229
229
  ```
230
230
  Scenario: Customer select an installment plan or their choice at Alipay's payment page.
@@ -233,13 +233,13 @@ Scenario: Customer select an installment plan or their choice at Alipay's paymen
233
233
  method: 'alipay.trade.page.pay',
234
234
  return_url: 'https://mystore.com/orders/20160401000000/return',
235
235
  notify_url: 'https://mystore.com/orders/20160401000000/notify',
236
- biz_content: {
236
+ biz_content: JSON.generate({
237
237
  out_trade_no: '20160401000000',
238
238
  product_code: 'FAST_INSTANT_TRADE_PAY',
239
239
  total_amount: '0.01',
240
240
  subject: 'Example #654',
241
241
  enable_pay_channels: 'balance,pcreditpayInstallment',
242
- }.to_json(ascii_only: true)
242
+ }, ascii_only: true)
243
243
  )
244
244
  ```
245
245
  #### Notebale Parameters
@@ -313,9 +313,9 @@ Alipay::Client.execute
313
313
  ```ruby
314
314
  response = @client.execute(
315
315
  method: 'alipay.trade.query',
316
- biz_content: {
316
+ biz_content: JSON.generate({
317
317
  trade_no: '2013112611001004680073956707',
318
- }.to_json(ascii_only: true)
318
+ }, ascii_only: true)
319
319
  )
320
320
  # => '{\"alipay_trade_query_response\":{\"code\"...'
321
321
 
@@ -350,9 +350,9 @@ Alipay::Client.execute
350
350
  response = @client.execute(
351
351
  method: 'alipay.trade.close',
352
352
  notify_url: 'https://mystore.com/orders/20160401000000/notify',
353
- biz_content: {
353
+ biz_content: JSON.generate({
354
354
  trade_no: '2013112611001004680073956707',
355
- }.to_json(ascii_only: true)
355
+ }, ascii_only: true)
356
356
  )
357
357
  # => '{\"alipay_trade_close_response\":{\"code\"...'
358
358
 
@@ -388,9 +388,9 @@ Alipay::Client.execute
388
388
  ```ruby
389
389
  response = @client.execute(
390
390
  method: 'alipay.trade.cancel',
391
- biz_content: {
391
+ biz_content: JSON.generate({
392
392
  out_trade_no: '20160401000000',
393
- }.to_json(ascii_only: true)
393
+ }, ascii_only: true)
394
394
  )
395
395
  # => '{\"alipay_trade_cancel_response\":{\"code\"...'
396
396
 
@@ -425,11 +425,11 @@ Secenario: Customer request refund on a ¥10.12 item on a ¥210.85 order(payme
425
425
  ```ruby
426
426
  response = @client.execute(
427
427
  method: 'alipay.trade.refund',
428
- biz_content: {
428
+ biz_content: JSON.generate({
429
429
  out_trade_no: '6c50789a0610',
430
430
  out_request_no: '6c50789a0610-1',
431
431
  refund_amount: '10.12'
432
- }.to_json(ascii_only: true)
432
+ }, ascii_only: true)
433
433
  )
434
434
  # => '{\"alipay_trade_refund_response\":{\"code\"...'
435
435
 
@@ -468,10 +468,10 @@ Alipay::Client.execute
468
468
  ```ruby
469
469
  response = @client.execute(
470
470
  method: 'alipay.trade.fastpay.refund.query',
471
- biz_content: {
471
+ biz_content: JSON.generate({
472
472
  out_trade_no: '6c50789a0610',
473
473
  out_request_no: '6c50789a0610-1'
474
- }.to_json(ascii_only: true)
474
+ }, ascii_only: true)
475
475
  )
476
476
  # => '{\"alipay_trade_fastpay_refund_query_response\":{\"code\"...'
477
477
 
@@ -506,12 +506,12 @@ Alipay::Client.execute
506
506
  ```ruby
507
507
  response = @client.execute(
508
508
  method: 'alipay.fund.trans.toaccount.transfer',
509
- biz_content: {
509
+ biz_content: JSON.generate({
510
510
  out_biz_no: '3142321423432',
511
511
  payee_type: 'ALIPAY_LOGONID',
512
512
  payee_account: 'customer@example.com',
513
513
  amount: '12.23'
514
- }.to_json(ascii_only: true)
514
+ }, ascii_only: true)
515
515
  )
516
516
  # => '{\"alipay_fund_trans_toaccount_transfer_response\":{\"code\"...'
517
517
 
@@ -548,9 +548,9 @@ Alipay::Client.execute
548
548
  ```ruby
549
549
  response = @client.execute(
550
550
  method: 'alipay.fund.trans.order.query',
551
- biz_content: {
551
+ biz_content: JSON.generate({
552
552
  out_biz_no: '3142321423432',
553
- }.to_json(ascii_only: true)
553
+ }, ascii_only: true)
554
554
  )
555
555
  # => '{\"alipay_fund_trans_order_query_response\":{\"code\"...'
556
556
 
@@ -102,7 +102,7 @@ module Alipay
102
102
  def page_execute_form(params)
103
103
  params = prepare_params(params)
104
104
 
105
- html = %Q(<form id='alipaysubmit' name='alipaysubmit' action='#{@url}' method='POST'>)
105
+ html = %Q(<form id='alipaysubmit' name='alipaysubmit' action='#{@url}?charset=#{@charset}' method='POST'>)
106
106
  params.each do |key, value|
107
107
  html << %Q(<input type='hidden' name='#{key}' value='#{value.gsub("'", "&apos;")}'/>)
108
108
  end
@@ -1,3 +1,3 @@
1
1
  module Alipay
2
- VERSION = "0.15.1"
2
+ VERSION = "0.15.2"
3
3
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alipay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rei
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-16 00:00:00.000000000 Z
11
+ date: 2019-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.3'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -123,8 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: []
126
- rubyforge_project:
127
- rubygems_version: 2.6.11
126
+ rubygems_version: 3.0.3
128
127
  signing_key:
129
128
  specification_version: 4
130
129
  summary: An unofficial simple alipay gem