alipay 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3edec82f680c00773ce90092f2fa9b0d53ad176
4
- data.tar.gz: 5657552ff665d594f71babfe43ac4f5da535e580
3
+ metadata.gz: 90db58ac96b9dc46b469b17123cad251d9d12834
4
+ data.tar.gz: d0b01bd14ba415fcd64c56dfb6d3e4863bd12659
5
5
  SHA512:
6
- metadata.gz: 3a3bfcb3f8dab931dd2ffef9d2304fd5155b5665dd73f0ae32d72ee823d049c9146142c8f2a331af4eb8c075a89fb9e6ddee51a0641ee00bc9108680aa38ef77
7
- data.tar.gz: 12de1a73d39b7e660a143c9f72e1e8f06e95b92c136b6ebd5200fed63282d5007a9caf8e4070c0f904954f3aab56cbafce0aab35c89b9e40a19748c0c27604d9
6
+ metadata.gz: fe6faf8e28ca0e2913b8926247774f760f697985a788d3930a55519798d9489d67f3ca20ba48979b441905bdee7c8777dd686259c62974e278cfdea772cb4672
7
+ data.tar.gz: dc2b6411f65c4fd289e42d19a5af28f2a00b1528e6f07c3cf6bb8ce26dfc62ed2c9b3e8ab6d735c42dfd9aeacec572032a0c7998ff2f31cee24824b9d35a15c5
@@ -1,3 +1,9 @@
1
+ ## master
2
+
3
+ ## v0.9.0 (2015-10-15)
4
+
5
+ - Add `Alipay::Service.create_direct_pay_by_user_wap_url` method, thanks @serco-chen #52
6
+
1
7
  ## v0.8.0 (2015-07-20)
2
8
 
3
9
  - Add `Alipay::Mobile::Service.mobile_security_pay_string` method, thanks @Sen #49
data/README.md CHANGED
@@ -9,7 +9,7 @@ Alipay official document: https://b.alipay.com/order/techService.htm .
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'alipay', '~> 0.7.1'
12
+ gem 'alipay', '~> 0.9.0'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -146,8 +146,7 @@ Alipay::Service.create_direct_pay_by_user_url({ARGUMENTS}, {OPTIONS})
146
146
  Alipay::Service.create_direct_pay_by_user_url(
147
147
  out_trade_no: '20150401000-0001',
148
148
  subject: 'Order Name',
149
- price: '10.00',
150
- quantity: 12,
149
+ total_fee: '10.00',
151
150
  return_url: 'https://example.com/orders/20150401000-0001',
152
151
  notify_url: 'https://example.com/orders/20150401000-0001/notify'
153
152
  )
@@ -159,15 +158,50 @@ Alipay::Service.create_direct_pay_by_user_url(
159
158
  | --- | ----------- | ----------- |
160
159
  | out_order_no | required | Order id in your application. |
161
160
  | subject | required | Order subject. |
162
- | price | required * | Order item's price. |
163
- | quantity | required * | Order item's quantity, total price is price * quantity. |
161
+ | total_fee | required | Order's total fee. |
164
162
  | return_url | optional | Redirect customer to this url after payment. |
165
163
  | notify_url | optional | Alipay asyn notify url. |
166
164
 
167
- \* Can be replaced by total_fee. When total_fee is set, price and quantity could not be set.
168
-
169
165
  This is not a complete list of arguments, please read official document: http://download.alipay.com/public/api/base/alipaydirect.zip .
170
166
 
167
+ ### 手机网站支付接口
168
+
169
+ #### Name
170
+
171
+ ```ruby
172
+ alipay.wap.create.direct.pay.by.user
173
+ ```
174
+
175
+ #### Definition
176
+
177
+ ```ruby
178
+ Alipay::Service.create_direct_pay_by_user_wap_url({ARGUMENTS}, {OPTIONS})
179
+ ```
180
+
181
+ #### Example
182
+
183
+ ```ruby
184
+ Alipay::Service.create_direct_pay_by_user_wap_url(
185
+ out_trade_no: '20150401000-0001',
186
+ subject: 'Order Name',
187
+ total_fee: '10.00',
188
+ return_url: 'https://example.com/orders/20150401000-0001',
189
+ notify_url: 'https://example.com/orders/20150401000-0001/notify'
190
+ )
191
+ ```
192
+
193
+ #### Arguments
194
+
195
+ | Key | Requirement | Description |
196
+ | --- | ----------- | ----------- |
197
+ | out_order_no | required | Order id in your application. |
198
+ | subject | required | Order subject. |
199
+ | total_fee | required | Order's total fee. |
200
+ | return_url | optional | Redirect customer to this url after payment. |
201
+ | notify_url | optional | Alipay asyn notify url. |
202
+
203
+ This is not a complete list of arguments, please read official document: http://download.alipay.com/public/api/base/alipaywapdirect.zip .
204
+
171
205
  ### 即时到账批量退款有密接口
172
206
 
173
207
  #### Name
@@ -399,13 +433,13 @@ mobile.securitypay.pay
399
433
  #### Definition
400
434
 
401
435
  ```ruby
402
- Alipay::Mobile::Service.mobile_security_pay_string({ARGUMENTS}, {OPTIONS})
436
+ Alipay::Mobile::Service.mobile_securitypay_pay_string({ARGUMENTS}, {OPTIONS})
403
437
  ```
404
438
 
405
439
  #### Example
406
440
 
407
441
  ```ruby
408
- Alipay::Mobile::Service.mobile_security_pay_string(
442
+ Alipay::Mobile::Service.mobile_securitypay_pay_string(
409
443
  out_trade_no: '20150401000-0001',
410
444
  notify_url: 'https://example.com/orders/20150401000-0001/notify'
411
445
  subject: 'subject',
@@ -429,7 +463,7 @@ Alipay::Mobile::Service.mobile_security_pay_string(
429
463
 
430
464
  This is not a complete list of arguments, please read official document: http://download.alipay.com/public/api/base/WS_MOBILE_PAY_SDK_BASE.zip .
431
465
 
432
- ## Wap::Service
466
+ ## Wap::Service (Deprecated)
433
467
 
434
468
  ### 授权接口
435
469
 
@@ -57,6 +57,23 @@ module Alipay
57
57
  request_uri(params, options).to_s
58
58
  end
59
59
 
60
+ CREATE_DIRECT_PAY_BY_USER_WAP_REQUIRED_PARAMS = %w( out_trade_no subject total_fee )
61
+ # direct wap
62
+ def self.create_direct_pay_by_user_wap_url(params, options = {})
63
+ params = Utils.stringify_keys(params)
64
+ check_required_params(params, CREATE_DIRECT_PAY_BY_USER_WAP_REQUIRED_PARAMS)
65
+
66
+ params = {
67
+ 'service' => 'alipay.wap.create.direct.pay.by.user',
68
+ '_input_charset' => 'utf-8',
69
+ 'partner' => options[:pid] || Alipay.pid,
70
+ 'seller_id' => options[:pid] || Alipay.pid,
71
+ 'payment_type' => '1'
72
+ }.merge(params)
73
+
74
+ request_uri(params, options).to_s
75
+ end
76
+
60
77
  CREATE_REFUND_URL_REQUIRED_PARAMS = %w( batch_no data notify_url )
61
78
  # 支付宝即时到帐批量退款有密接口(此为异步接口,有密指通过此接口打开 url 后需要用户输入支付宝的支付密码进行退款)
62
79
  def self.refund_fastpay_by_platform_pwd_url(params, options = {})
@@ -1,3 +1,3 @@
1
1
  module Alipay
2
- VERSION = "0.8.0"
2
+ VERSION = "0.9.0"
3
3
  end
@@ -38,6 +38,15 @@ class Alipay::ServiceTest < Minitest::Test
38
38
  assert_equal 'https://mapi.alipay.com/gateway.do?service=create_direct_pay_by_user&_input_charset=utf-8&partner=1000000000000000&seller_id=1000000000000000&payment_type=1&out_trade_no=1&subject=test&price=0.01&quantity=1&sign_type=MD5&sign=682ad02280fca7d4c0fd22678fdddeef', Alipay::Service.create_direct_pay_by_user_url(options)
39
39
  end
40
40
 
41
+ def test_generate_create_direct_pay_by_user_wap_url
42
+ options = {
43
+ out_trade_no: '1',
44
+ subject: 'test',
45
+ total_fee: '0.01'
46
+ }
47
+ assert_equal 'https://mapi.alipay.com/gateway.do?service=alipay.wap.create.direct.pay.by.user&_input_charset=utf-8&partner=1000000000000000&seller_id=1000000000000000&payment_type=1&out_trade_no=1&subject=test&total_fee=0.01&sign_type=MD5&sign=6530de6e3cba153cd4ca7edc48b91f96', Alipay::Service.create_direct_pay_by_user_wap_url(options)
48
+ end
49
+
41
50
  def test_refund_fastpay_by_platform_pwd_url
42
51
  data = [{
43
52
  trade_no: '1',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alipay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rei
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-20 00:00:00.000000000 Z
11
+ date: 2015-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler