allpay_client 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/README.md +2 -0
- data/examples/server.rb +7 -2
- data/examples/views/index.erb +6 -0
- data/lib/allpay/client.rb +7 -4
- data/lib/allpay/version.rb +1 -1
- data/lib/allpay_client.rb +1 -0
- metadata +17 -15
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
ZTcwNzEzMzI5MDU1NThiNGI0NTQ2ZmFjYTBjZGE4NTQwZDk3YzY1Nw==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1871efcd2f7796836ed1d99c133b3ad2d20a25e9
|
4
|
+
data.tar.gz: 8f12e4605eda751826a8e0d90d82dc39e124e208
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
ZDgwMWIxNTRlNmYzYTQyNDJjMTliOTU3NjUwZjZhMDk3ZWM2ZGVmODlmNzgy
|
11
|
-
N2IxNjMwMDZiZjE4ZTQ2ZjRiZGEwY2I3MzJkYmMwMjFiOWI2Y2Y=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MjMxMTc1MzQ5NDk0MDNiYmMzMTNmZTRlNGYxMGU2YTZiYmQ2ODZkODdjOTAy
|
14
|
-
NDdjNWZlMGM1ZDg0ZTBiMTliYTg3MzE3YTU5N2ViMDlkOWU1MTk0MWVmZDhl
|
15
|
-
YTk5MjZkNTQxMzY1YmY2OTA0ZTI2NTg4ZTM5ZmNiYWI4NDA2NTQ=
|
6
|
+
metadata.gz: 5b38addb35def66faa66bfc3ce67069e0ec2609edf2dde3c6899da1bf15825e8c8f591676c93df87e8f473125ba47b37a7c5762f840eeea64ef2fecaea520fbd
|
7
|
+
data.tar.gz: 46803f47cf80101d3cad60beabe7559917a44f19fc84ffb1881828550670077dd9e7235096f95e8ead1e9aa502643f5cc5a590139240251199ea1052eff2bbd2
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/tonytonyjan/allpay.svg?branch=master)](https://travis-ci.org/tonytonyjan/allpay)
|
2
|
+
|
1
3
|
# Allpay 歐付寶
|
2
4
|
|
3
5
|
這是歐付寶 API 的 Ruby 包裝,更多資訊參考他們的[官方文件](https://www.allpay.com.tw/Content/files/%E5%85%A8%E6%96%B9%E4%BD%8D%E9%87%91%E6%B5%81%E4%BB%8B%E6%8E%A5%E6%8A%80%E8%A1%93%E6%96%87%E4%BB%B6.pdf)。
|
data/examples/server.rb
CHANGED
@@ -10,12 +10,17 @@ get '/' do
|
|
10
10
|
MerchantTradeNo: SecureRandom.hex(4),
|
11
11
|
MerchantTradeDate: Time.now.strftime('%Y/%m/%d %H:%M:%S'),
|
12
12
|
PaymentType: 'aio',
|
13
|
-
TotalAmount:
|
13
|
+
TotalAmount: 1000,
|
14
14
|
TradeDesc: '腦袋有動工作室',
|
15
15
|
ItemName: '物品一#物品二',
|
16
16
|
ReturnURL: 'http://requestb.in/11zuej31',
|
17
17
|
ClientBackURL: 'http://requestb.in/11zuej31?inspect',
|
18
|
-
ChoosePayment: 'Credit'
|
18
|
+
ChoosePayment: 'Credit',
|
19
|
+
PeriodAmount: 1000,
|
20
|
+
PeriodType: 'D',
|
21
|
+
Frequency: 1,
|
22
|
+
ExecTimes: 12,
|
23
|
+
PeriodReturnURL: 'http://requestb.in/158bu8e1'
|
19
24
|
}
|
20
25
|
@mac = client.make_mac(@params)
|
21
26
|
erb :index
|
data/examples/views/index.erb
CHANGED
@@ -16,6 +16,12 @@
|
|
16
16
|
<input type="text" name="ReturnURL" value="<%= @params[:ReturnURL] %>">
|
17
17
|
<input type="text" name="ClientBackURL" value="<%= @params[:ClientBackURL] %>">
|
18
18
|
<input type="text" name="ChoosePayment" value="<%= @params[:ChoosePayment] %>">
|
19
|
+
<input type="text" name="PeriodAmount" value="<%= @params[:PeriodAmount] %>">
|
20
|
+
<input type="text" name="PeriodType" value="<%= @params[:PeriodType] %>">
|
21
|
+
<input type="text" name="Frequency" value="<%= @params[:Frequency] %>">
|
22
|
+
<input type="text" name="ExecTimes" value="<%= @params[:ExecTimes] %>">
|
23
|
+
<input type="text" name="PeriodReturnURL" value="<%= @params[:PeriodReturnURL] %>">
|
24
|
+
|
19
25
|
<input type="text" name="CheckMacValue" value="<%= @mac %>">
|
20
26
|
<input type="submit">
|
21
27
|
</form>
|
data/lib/allpay/client.rb
CHANGED
@@ -39,10 +39,13 @@ module Allpay
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def query_trade_info merchant_trade_number, platform = nil
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
params = {
|
43
|
+
MerchantTradeNo: merchant_trade_number,
|
44
|
+
TimeStamp: Time.now.to_i,
|
45
|
+
PlatformID: platform
|
46
|
+
}
|
47
|
+
params.delete_if{ |k, v| v.empty? }
|
48
|
+
res = request '/Cashier/QueryTradeInfo', params
|
46
49
|
Hash[res.body.split('&').map!{|i| i.split('=')}]
|
47
50
|
end
|
48
51
|
|
data/lib/allpay/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
require 'allpay'
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allpay_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jian Weihang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-06 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
19
|
version: '1.7'
|
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
26
|
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: sinatra
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: API client for allpay
|
@@ -73,9 +73,9 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
-
- .gitignore
|
77
|
-
- .rspec
|
78
|
-
- .travis.yml
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rspec"
|
78
|
+
- ".travis.yml"
|
79
79
|
- Gemfile
|
80
80
|
- LICENSE.txt
|
81
81
|
- README.md
|
@@ -86,6 +86,7 @@ files:
|
|
86
86
|
- lib/allpay.rb
|
87
87
|
- lib/allpay/client.rb
|
88
88
|
- lib/allpay/version.rb
|
89
|
+
- lib/allpay_client.rb
|
89
90
|
- spec/allpay_spec.rb
|
90
91
|
- spec/spec_helper.rb
|
91
92
|
homepage:
|
@@ -98,12 +99,12 @@ require_paths:
|
|
98
99
|
- lib
|
99
100
|
required_ruby_version: !ruby/object:Gem::Requirement
|
100
101
|
requirements:
|
101
|
-
- -
|
102
|
+
- - ">="
|
102
103
|
- !ruby/object:Gem::Version
|
103
104
|
version: '0'
|
104
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
106
|
requirements:
|
106
|
-
- -
|
107
|
+
- - ">="
|
107
108
|
- !ruby/object:Gem::Version
|
108
109
|
version: '0'
|
109
110
|
requirements: []
|
@@ -115,3 +116,4 @@ summary: API client for allpay
|
|
115
116
|
test_files:
|
116
117
|
- spec/allpay_spec.rb
|
117
118
|
- spec/spec_helper.rb
|
119
|
+
has_rdoc:
|