new_alipay 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +8 -1
- data/lib/new_alipay/batch_trans.rb +6 -0
- data/lib/new_alipay/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: 15869ed4273e78cc0f8548324278876e8cec87ef
|
4
|
+
data.tar.gz: f8f575160066c99137b82f5c68225aebe42b8264
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e38c29b41036da3d57530f6f007c9a2ab3b674b3eb5b460cd7654367fe0cf391d5b3e0712f15e07bb74d7bbdb8a0fbe9c7cb47f3b4600780abf0a5e7c9eeddf
|
7
|
+
data.tar.gz: 54a07efa52057a92287e2aaba4737543d31855d14af0ad605984ebaa5e54a8d223de949f9c83732edf0f568893eb60f74e82c42ef8af7cb3a8d0b137e35ba1fd
|
data/Gemfile.lock
CHANGED
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: "#{
|
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文本
|
data/lib/new_alipay/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|