gmo 0.2.4 → 0.2.5
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_pay_easy_gets_data_about_a_transaction.yml +36 -0
- data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_pay_easy_gets_data_about_a_transaction.yml +69 -0
- data/gmo.gemspec +2 -2
- data/lib/gmo/shop_api.rb +20 -0
- data/lib/gmo/version.rb +1 -1
- data/spec/gmo/shop_api_spec.rb +55 -0
- metadata +9 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e849a1f54798b48c6c680c96828ac28869814b76
|
|
4
|
+
data.tar.gz: 2d95146139b5bd709188dbb6b7e3033beae8228d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7cedd9430dad9205407779eb4d76104e8a103d0a2e90e2cfe51a0b42ee5566b293121298b9c9f9919d6d2ebae4ea500a08c6fb2eff83a9afb0d77abe7b26ca6e
|
|
7
|
+
data.tar.gz: a9def24ae84bffa4949c9e826ac62502156b9b72109d2042b80d769d668c8a6c49a26e4464d86227e902b9a88ddae3babfd6da433a2beef8ca82b23f45e81e60
|
data/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: post
|
|
5
|
+
uri: https://<HOST>/payment/EntryTranPayEasy.idPass
|
|
6
|
+
body:
|
|
7
|
+
encoding: UTF-8
|
|
8
|
+
string: OrderID=1448103619&Amount=100&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>
|
|
9
|
+
headers:
|
|
10
|
+
Accept-Encoding:
|
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
12
|
+
Accept:
|
|
13
|
+
- "*/*"
|
|
14
|
+
User-Agent:
|
|
15
|
+
- Ruby
|
|
16
|
+
response:
|
|
17
|
+
status:
|
|
18
|
+
code: 200
|
|
19
|
+
message: OK
|
|
20
|
+
headers:
|
|
21
|
+
Server:
|
|
22
|
+
- nginx
|
|
23
|
+
Date:
|
|
24
|
+
- Sat, 21 Nov 2015 11:00:19 GMT
|
|
25
|
+
Content-Type:
|
|
26
|
+
- text/plain;charset=Windows-31J
|
|
27
|
+
Transfer-Encoding:
|
|
28
|
+
- chunked
|
|
29
|
+
Connection:
|
|
30
|
+
- close
|
|
31
|
+
body:
|
|
32
|
+
encoding: UTF-8
|
|
33
|
+
string: AccessID=282b61afb9cabee8e72d49db77c08e2f&AccessPass=9c4883358947a15683f8a63f5fc7aef4
|
|
34
|
+
http_version:
|
|
35
|
+
recorded_at: Sat, 21 Nov 2015 11:00:19 GMT
|
|
36
|
+
recorded_with: VCR 3.0.0
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: post
|
|
5
|
+
uri: https://<HOST>/payment/EntryTranPayEasy.idPass
|
|
6
|
+
body:
|
|
7
|
+
encoding: UTF-8
|
|
8
|
+
string: OrderID=1448105474&Amount=100&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>
|
|
9
|
+
headers:
|
|
10
|
+
Accept-Encoding:
|
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
12
|
+
Accept:
|
|
13
|
+
- "*/*"
|
|
14
|
+
User-Agent:
|
|
15
|
+
- Ruby
|
|
16
|
+
response:
|
|
17
|
+
status:
|
|
18
|
+
code: 200
|
|
19
|
+
message: OK
|
|
20
|
+
headers:
|
|
21
|
+
Server:
|
|
22
|
+
- nginx
|
|
23
|
+
Date:
|
|
24
|
+
- Sat, 21 Nov 2015 11:31:15 GMT
|
|
25
|
+
Content-Type:
|
|
26
|
+
- text/plain;charset=Windows-31J
|
|
27
|
+
Transfer-Encoding:
|
|
28
|
+
- chunked
|
|
29
|
+
Connection:
|
|
30
|
+
- close
|
|
31
|
+
body:
|
|
32
|
+
encoding: UTF-8
|
|
33
|
+
string: AccessID=eb18bcc94bd6027929b2cb401b5eff9b&AccessPass=e79f0cbfb6b00343beb85eb8df873277
|
|
34
|
+
http_version:
|
|
35
|
+
recorded_at: Sat, 21 Nov 2015 11:31:15 GMT
|
|
36
|
+
- request:
|
|
37
|
+
method: post
|
|
38
|
+
uri: https://<HOST>/payment/ExecTranPayEasy.idPass
|
|
39
|
+
body:
|
|
40
|
+
encoding: UTF-8
|
|
41
|
+
string: OrderID=1448105474&AccessID=eb18bcc94bd6027929b2cb401b5eff9b&AccessPass=e79f0cbfb6b00343beb85eb8df873277&CustomerName=%83y%83C%91%BE%98Y&CustomerKana=%83y%83C%83%5E%83%8D%83E&TelNo=0300000001&ReceiptsDisp11=RSpec+Helpdesk&ReceiptsDisp12=0300000001&ReceiptsDisp13=00%3A00-00%3A15&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>
|
|
42
|
+
headers:
|
|
43
|
+
Accept-Encoding:
|
|
44
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
45
|
+
Accept:
|
|
46
|
+
- "*/*"
|
|
47
|
+
User-Agent:
|
|
48
|
+
- Ruby
|
|
49
|
+
response:
|
|
50
|
+
status:
|
|
51
|
+
code: 200
|
|
52
|
+
message: OK
|
|
53
|
+
headers:
|
|
54
|
+
Server:
|
|
55
|
+
- nginx
|
|
56
|
+
Date:
|
|
57
|
+
- Sat, 21 Nov 2015 11:31:16 GMT
|
|
58
|
+
Content-Type:
|
|
59
|
+
- text/plain;charset=Windows-31J
|
|
60
|
+
Transfer-Encoding:
|
|
61
|
+
- chunked
|
|
62
|
+
Connection:
|
|
63
|
+
- close
|
|
64
|
+
body:
|
|
65
|
+
encoding: UTF-8
|
|
66
|
+
string: OrderID=1448105474&CustID=WNT05476383&BkCode=58021&ConfNo=3769&EncryptReceiptNo=LB7OigJvPDmbWxAqB8OY&PaymentTerm=20151201235959&TranDate=20151121203100&CheckString=6a7c5cb87d1857e9b9088d65480545e3
|
|
67
|
+
http_version:
|
|
68
|
+
recorded_at: Sat, 21 Nov 2015 11:31:16 GMT
|
|
69
|
+
recorded_with: VCR 3.0.0
|
data/gmo.gemspec
CHANGED
|
@@ -23,8 +23,8 @@ Gem::Specification.new do |gem|
|
|
|
23
23
|
|
|
24
24
|
gem.add_runtime_dependency "rack"
|
|
25
25
|
gem.add_runtime_dependency "multi_json"
|
|
26
|
-
gem.add_development_dependency "rspec"
|
|
26
|
+
gem.add_development_dependency "rspec", "~> 2"
|
|
27
27
|
gem.add_development_dependency "rake"
|
|
28
28
|
gem.add_development_dependency "vcr"
|
|
29
29
|
gem.add_development_dependency "webmock"
|
|
30
|
-
end
|
|
30
|
+
end
|
data/lib/gmo/shop_api.rb
CHANGED
|
@@ -61,6 +61,16 @@ module GMO
|
|
|
61
61
|
post_request name, options
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
+
# 【Pay-easy決済】
|
|
65
|
+
# 5.1.2.1. 取引登録
|
|
66
|
+
# これ以降の決済取引で必要となる取引IDと取引パスワードの発行を行い、取引を開始します。
|
|
67
|
+
def entry_tran_pay_easy(options = {})
|
|
68
|
+
name = "EntryTranPayEasy.idPass"
|
|
69
|
+
required = [:order_id, :amount]
|
|
70
|
+
assert_required_options(required, options)
|
|
71
|
+
post_request name, options
|
|
72
|
+
end
|
|
73
|
+
|
|
64
74
|
## 2.2.2.2.決済実行
|
|
65
75
|
# 指定されたサイトに会員を登録します。
|
|
66
76
|
# return
|
|
@@ -140,6 +150,16 @@ module GMO
|
|
|
140
150
|
post_request name, options
|
|
141
151
|
end
|
|
142
152
|
|
|
153
|
+
# 【Pay-easy決済】
|
|
154
|
+
# 5.1.2.2. 決済実行
|
|
155
|
+
# お客様が入力した情報で後続の決済センターと通信を行い決済を実施し、結果を返します。
|
|
156
|
+
def exec_tran_pay_easy(options = {})
|
|
157
|
+
name = "ExecTranPayEasy.idPass"
|
|
158
|
+
required = [:access_id, :access_pass, :order_id, :customer_name, :customer_kana, :tel_no, :receipts_disp_11, :receipts_disp_12, :receipts_disp_13]
|
|
159
|
+
assert_required_options(required, options)
|
|
160
|
+
post_request name, options
|
|
161
|
+
end
|
|
162
|
+
|
|
143
163
|
## 2.14.2.1.決済変更
|
|
144
164
|
# 仮売上の決済に対して実売上を行います。尚、実行時に仮売上時との金額チェックを行います。
|
|
145
165
|
# /payment/AlterTran.idPass
|
data/lib/gmo/version.rb
CHANGED
data/spec/gmo/shop_api_spec.rb
CHANGED
|
@@ -71,6 +71,24 @@ describe "GMO::Payment::ShopAPI" do
|
|
|
71
71
|
end
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
+
describe "#entry_tran_pay_easy" do
|
|
75
|
+
it "gets data about a transaction", :vcr do
|
|
76
|
+
order_id = @order_id
|
|
77
|
+
result = @service.entry_tran_pay_easy({
|
|
78
|
+
:order_id => order_id,
|
|
79
|
+
:amount => 100
|
|
80
|
+
})
|
|
81
|
+
result["AccessID"].nil?.should_not be_true
|
|
82
|
+
result["AccessPass"].nil?.should_not be_true
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
it "got error if missing options", :vcr do
|
|
86
|
+
lambda {
|
|
87
|
+
result = @service.entry_tran_pay_easy()
|
|
88
|
+
}.should raise_error("Required order_id, amount were not provided.")
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
74
92
|
describe "#exec_tran" do
|
|
75
93
|
it "gets data about a transaction", :vcr do
|
|
76
94
|
order_id = generate_id
|
|
@@ -194,6 +212,43 @@ describe "GMO::Payment::ShopAPI" do
|
|
|
194
212
|
end
|
|
195
213
|
end
|
|
196
214
|
|
|
215
|
+
describe "#exec_tran_pay_easy" do
|
|
216
|
+
it "gets data about a transaction", :vcr do
|
|
217
|
+
order_id = generate_id
|
|
218
|
+
result = @service.entry_tran_pay_easy({
|
|
219
|
+
:order_id => order_id,
|
|
220
|
+
:amount => 100
|
|
221
|
+
})
|
|
222
|
+
access_id = result["AccessID"]
|
|
223
|
+
access_pass = result["AccessPass"]
|
|
224
|
+
result = @service.exec_tran_pay_easy({
|
|
225
|
+
:order_id => order_id,
|
|
226
|
+
:access_id => access_id,
|
|
227
|
+
:access_pass => access_pass,
|
|
228
|
+
:customer_name => 'ペイ太郎',
|
|
229
|
+
:customer_kana => 'ペイタロウ',
|
|
230
|
+
:tel_no => '0300000001',
|
|
231
|
+
:receipts_disp_11 => 'RSpec Helpdesk',
|
|
232
|
+
:receipts_disp_12 => '0300000001',
|
|
233
|
+
:receipts_disp_13 => '00:00-00:15'
|
|
234
|
+
})
|
|
235
|
+
result["OrderID"].nil?.should_not be_true
|
|
236
|
+
result["CustID"].nil?.should_not be_true
|
|
237
|
+
result["BkCode"].nil?.should_not be_true
|
|
238
|
+
result["ConfNo"].nil?.should_not be_true
|
|
239
|
+
result["EncryptReceiptNo"].nil?.should_not be_true
|
|
240
|
+
result["PaymentTerm"].nil?.should_not be_true
|
|
241
|
+
result["TranDate"].nil?.should_not be_true
|
|
242
|
+
result["CheckString"].nil?.should_not be_true
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
it "got error if missing options", :vcr do
|
|
246
|
+
lambda {
|
|
247
|
+
result = @service.exec_tran_pay_easy()
|
|
248
|
+
}.should raise_error("Required access_id, access_pass, order_id, customer_name, customer_kana, tel_no, receipts_disp_11, receipts_disp_12, receipts_disp_13 were not provided.")
|
|
249
|
+
end
|
|
250
|
+
end
|
|
251
|
+
|
|
197
252
|
describe "#alter_tran" do
|
|
198
253
|
it "gets data about order", :vcr do
|
|
199
254
|
order_id = generate_id
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gmo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tatsuo Kaniwa
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2015-11-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rack
|
|
@@ -42,16 +42,16 @@ dependencies:
|
|
|
42
42
|
name: rspec
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- - "
|
|
45
|
+
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
47
|
+
version: '2'
|
|
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
|
-
version: '
|
|
54
|
+
version: '2'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: rake
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -120,10 +120,12 @@ files:
|
|
|
120
120
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_cvs_got_error_if_missing_options.yml
|
|
121
121
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_gets_data_about_a_transaction.yml
|
|
122
122
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_got_error_if_missing_options.yml
|
|
123
|
+
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_pay_easy_gets_data_about_a_transaction.yml
|
|
123
124
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_cvs_gets_data_about_a_transaction.yml
|
|
124
125
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_gets_data_about_a_transaction.yml
|
|
125
126
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_got_error_if_missing_options.yml
|
|
126
127
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_parameter_contains_Japanese_characters_should_correctly_handle_Japanese.yml
|
|
128
|
+
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_pay_easy_gets_data_about_a_transaction.yml
|
|
127
129
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_search_trade_gets_data_about_order.yml
|
|
128
130
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_search_trade_got_error_if_missing_options.yml
|
|
129
131
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_search_trade_multi_gets_data_about_order.yml
|
|
@@ -185,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
185
187
|
version: '0'
|
|
186
188
|
requirements: []
|
|
187
189
|
rubyforge_project:
|
|
188
|
-
rubygems_version: 2.
|
|
190
|
+
rubygems_version: 2.4.6
|
|
189
191
|
signing_key:
|
|
190
192
|
specification_version: 4
|
|
191
193
|
summary: 'GMO Payment API client: Ruby client library for the GMO Payment Platform.'
|