new_alipay 0.1.6 → 0.1.7

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: 772beb0e34d4ff45feeb336eafca28b10079754f
4
- data.tar.gz: 749cc846504255b5e06436e237bbb918cefd81dc
3
+ metadata.gz: 15869ed4273e78cc0f8548324278876e8cec87ef
4
+ data.tar.gz: f8f575160066c99137b82f5c68225aebe42b8264
5
5
  SHA512:
6
- metadata.gz: be78f2560cfca0da02f29081d2ff01d2e49287f3e2799722002144f83f9ea6aaf21a8a2880f96a4a19d1e042703c18ea4166e9fbe9db3b0ea6a0e81d81bf6f66
7
- data.tar.gz: ed5d09af6c65d7080118e82e3f07aaca8798e9ee059bca8b098299a64bfbd7bf66452069b4a1b2faff69bebe5219b3bf3a7fe30b539ef6b621d897dcfb02bd02
6
+ metadata.gz: 1e38c29b41036da3d57530f6f007c9a2ab3b674b3eb5b460cd7654367fe0cf391d5b3e0712f15e07bb74d7bbdb8a0fbe9c7cb47f3b4600780abf0a5e7c9eeddf
7
+ data.tar.gz: 54a07efa52057a92287e2aaba4737543d31855d14af0ad605984ebaa5e54a8d223de949f9c83732edf0f568893eb60f74e82c42ef8af7cb3a8d0b137e35ba1fd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- new_alipay (0.1.5)
4
+ new_alipay (0.1.7)
5
5
 
6
6
  GEM
7
7
  remote: https://ruby.taobao.org/
data/README.md CHANGED
@@ -2,10 +2,17 @@
2
2
 
3
3
  支付宝快捷支付+支付宝批量付款
4
4
 
5
+ ## Status
6
+ 代码 已经打包发布到 RubyGems.
7
+
8
+ [![image](https://ruby-china-files.b0.upaiyun.com/photo/5982eaaa64f467d9dbda03ad4f40ea27.png)](https://rubygems.org/gems/new_alipay)
9
+
10
+
5
11
  ## Installation
6
12
 
7
13
  Add this line to your application's Gemfile:
8
14
 
15
+
9
16
  ```ruby
10
17
  gem 'new_alipay'
11
18
  ```
@@ -87,7 +94,7 @@ NewAlipay.account_name='xxxx公司/你的真实姓名'
87
94
  notify_url: 'http://test.yourserver.com/callback',
88
95
  batch_fee: 0.01,
89
96
  batch_num: 1,
90
- detail_data: "#{Time.new.strftime('%Y%m%d')+18.times.inject('') { |acc, i| acc+=('0'..'9').to_a[(i+Random.rand(1000))%10]; acc }}^152xxxxyyyy^某某^0.01^测试支付"
97
+ detail_data: "#{NewAlipay::BatchTrans.random_trade_no(26)}^152xxxxyyyy^某某^0.01^测试支付"
91
98
 
92
99
  })
93
100
  ```
@@ -11,6 +11,12 @@ module NewAlipay
11
11
  HTTP_VERIFY_URL = 'http://notify.alipay.com/trade/notify_query.do?'
12
12
 
13
13
  module_function
14
+
15
+ #返回随机交易密码
16
+ def random_trade_no(length=26)
17
+ Time.new.strftime('%Y%m%d')+(length-8).times.inject('') { |acc, i| acc+=('0'..'9').to_a[(i+Random.rand(1000))%10]; acc }
18
+ end
19
+
14
20
  # 建立请求,以表单HTML形式构造(默认)
15
21
  # @param para_temp 请求参数数组
16
22
  # @return 提交表单HTML文本
@@ -1,3 +1,3 @@
1
1
  module NewAlipay
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: new_alipay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - saxer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-31 00:00:00.000000000 Z
11
+ date: 2016-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler