gmo 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_docomo_gets_data_about_a_transaction.yml +35 -0
- data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_rakuten_id_gets_data_about_a_transaction.yml +35 -0
- data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_docomo_gets_data_about_a_transaction.yml +67 -0
- data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_rakuten_id_gets_data_about_a_transaction.yml +67 -0
- data/lib/gmo/const.rb +9 -0
- data/lib/gmo/shop_api.rb +68 -0
- data/lib/gmo/version.rb +1 -1
- data/spec/gmo/shop_api_spec.rb +102 -0
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eaa71623e6e73094b9ca7c3855b7d691d9afd1f66b7ffd1131748f9185d73419
|
4
|
+
data.tar.gz: fa66755179642177d794da8f41cb82445a1666aeab49a5d4e2b946dcfe807044
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e64017b8bb1f8499741273c014d804c15e480bac887d334dab6739c482a7b93ed2a8236928b6b4f1b2de0ed5c871df4b69e2d596f20edb671c85670359af6897
|
7
|
+
data.tar.gz: eff2c76d2515c0d106dc514119341b78b94cfc08e0318372c096a9b94c6a1057780159594a55d8060fbe98eaa7499488a1ed75d57354f61d6ee7a34f8774d834
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 0.5.2
|
4
|
+
* Support d払い/ドコモ払い(docomo payment), 楽天ペイ(Rakuten payment) [#42](https://github.com/t-k/gmo-payment-ruby/pull/42) (Thanks [@valda](https://github.com/valda))
|
5
|
+
* Add more G-series error codes [#41](https://github.com/t-k/gmo-payment-ruby/pull/41) (Thanks [@ermaac](https://github.com/ermaac))
|
6
|
+
|
3
7
|
## 0.5.1
|
4
8
|
* Add more error codes [#37](https://github.com/t-k/gmo-payment-ruby/pull/37) (Thanks [@jagdeepsingh](https://github.com/jagdeepsingh))
|
5
9
|
|
data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_docomo_gets_data_about_a_transaction.yml
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://<HOST>/payment/EntryTranDocomo.idPass
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: OrderID=<TOKEN>6092250<TOKEN>3&JobCd=AUTH&Amount=<TOKEN>00&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=<TOKEN>.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
|
+
- Tue, 29 Dec 2020 06:56:54 GMT
|
25
|
+
Content-Type:
|
26
|
+
- text/plain;charset=Windows-3<TOKEN>J
|
27
|
+
Transfer-Encoding:
|
28
|
+
- chunked
|
29
|
+
Connection:
|
30
|
+
- close
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: AccessID=bcda2c8fbc952<TOKEN>5dd37ad8f2a37<TOKEN>facf&AccessPass=fd3<TOKEN>337495ade97b96<TOKEN>2bb7cb9228b58
|
34
|
+
recorded_at: Tue, 29 Dec 2020 06:56:54 GMT
|
35
|
+
recorded_with: VCR 6.0.0
|
@@ -0,0 +1,35 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://<HOST>/payment/EntryTranRakutenId.idPass
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: OrderID=<TOKEN>609222<TOKEN>40&JobCd=AUTH&Amount=<TOKEN>00&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=<TOKEN>.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
|
+
- Tue, 29 Dec 2020 06:09:00 GMT
|
25
|
+
Content-Type:
|
26
|
+
- text/plain;charset=Windows-3<TOKEN>J
|
27
|
+
Transfer-Encoding:
|
28
|
+
- chunked
|
29
|
+
Connection:
|
30
|
+
- close
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: OrderID=<TOKEN>609222<TOKEN>40&AccessID=8e9d8824c386409e247eb<TOKEN>badf34ff68&AccessPass=c963<TOKEN>bd080cebf5c0869feef<TOKEN>a638ddb
|
34
|
+
recorded_at: Tue, 29 Dec 2020 06:09:00 GMT
|
35
|
+
recorded_with: VCR 6.0.0
|
data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_docomo_gets_data_about_a_transaction.yml
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://<HOST>/payment/EntryTranDocomo.idPass
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: OrderID=<TOKEN>6092250<TOKEN>4&JobCd=CAPTURE&Amount=<TOKEN>00&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=<TOKEN>.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
|
+
- Tue, 29 Dec 2020 06:56:54 GMT
|
25
|
+
Content-Type:
|
26
|
+
- text/plain;charset=Windows-3<TOKEN>J
|
27
|
+
Transfer-Encoding:
|
28
|
+
- chunked
|
29
|
+
Connection:
|
30
|
+
- close
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: AccessID=980a<TOKEN>cf8<TOKEN>a58ea7<TOKEN>2828f82b5cab36b4&AccessPass=30e<TOKEN>87<TOKEN>76420ef72d743e<TOKEN>923f60c228
|
34
|
+
recorded_at: Tue, 29 Dec 2020 06:56:54 GMT
|
35
|
+
- request:
|
36
|
+
method: post
|
37
|
+
uri: https://<HOST>/payment/ExecTranDocomo.idPass
|
38
|
+
body:
|
39
|
+
encoding: UTF-8
|
40
|
+
string: OrderID=<TOKEN>6092250<TOKEN>4&AccessID=980a<TOKEN>cf8<TOKEN>a58ea7<TOKEN>2828f82b5cab36b4&AccessPass=30e<TOKEN>87<TOKEN>76420ef72d743e<TOKEN>923f60c228&RetURL=https%3A%2F%2Fexample.com%2Fpath%2Fto%2Freturn%2Fsuccess&ErrorRcvURL=https%3A%2F%2Fexample.com%2Fpath%2Fto%2Freturn%2Ffailure&ItemId=000<TOKEN>&ItemName=%8Dw%93%FC%82%B7%82%E9%8F%A4%95i%96%BC&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>
|
41
|
+
headers:
|
42
|
+
Accept-Encoding:
|
43
|
+
- gzip;q=<TOKEN>.0,deflate;q=0.6,identity;q=0.3
|
44
|
+
Accept:
|
45
|
+
- "*/*"
|
46
|
+
User-Agent:
|
47
|
+
- Ruby
|
48
|
+
response:
|
49
|
+
status:
|
50
|
+
code: 200
|
51
|
+
message: OK
|
52
|
+
headers:
|
53
|
+
Server:
|
54
|
+
- nginx
|
55
|
+
Date:
|
56
|
+
- Tue, 29 Dec 2020 06:56:55 GMT
|
57
|
+
Content-Type:
|
58
|
+
- text/plain;charset=Windows-3<TOKEN>J
|
59
|
+
Transfer-Encoding:
|
60
|
+
- chunked
|
61
|
+
Connection:
|
62
|
+
- close
|
63
|
+
body:
|
64
|
+
encoding: UTF-8
|
65
|
+
string: AccessID=980a<TOKEN>cf8<TOKEN>a58ea7<TOKEN>2828f82b5cab36b4&Token=MUPNG5Kkc3cF3W2yFjT6DXACIf+qn<TOKEN>h7bqaBFFxarXKwBS7yYvxSiC0zeMVH+O4F&StartURL=https://<HOST>/payment/DocomoStart.idPass&StartLimitDate=2020<TOKEN>229<TOKEN>55854
|
66
|
+
recorded_at: Tue, 29 Dec 2020 06:56:55 GMT
|
67
|
+
recorded_with: VCR 6.0.0
|
@@ -0,0 +1,67 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://<HOST>/payment/EntryTranRakutenId.idPass
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: OrderID=<TOKEN>609222947&JobCd=CAPTURE&Amount=<TOKEN>00&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=<TOKEN>.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
|
+
- Tue, 29 Dec 2020 06:22:28 GMT
|
25
|
+
Content-Type:
|
26
|
+
- text/plain;charset=Windows-3<TOKEN>J
|
27
|
+
Transfer-Encoding:
|
28
|
+
- chunked
|
29
|
+
Connection:
|
30
|
+
- close
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: OrderID=<TOKEN>609222947&AccessID=a890<TOKEN><TOKEN><TOKEN>530f250c<TOKEN>3e3c884ae273060a&AccessPass=55fff26783<TOKEN>070a<TOKEN>040edd36f73b26ec
|
34
|
+
recorded_at: Tue, 29 Dec 2020 06:22:28 GMT
|
35
|
+
- request:
|
36
|
+
method: post
|
37
|
+
uri: https://<HOST>/payment/ExecTranRakutenId.idPass
|
38
|
+
body:
|
39
|
+
encoding: UTF-8
|
40
|
+
string: OrderID=<TOKEN>609222947&AccessID=a890<TOKEN><TOKEN><TOKEN>530f250c<TOKEN>3e3c884ae273060a&AccessPass=55fff26783<TOKEN>070a<TOKEN>040edd36f73b26ec&RetURL=https%3A%2F%2Fexample.com%2Fpath%2Fto%2Freturn%2Fsuccess&ErrorRcvURL=https%3A%2F%2Fexample.com%2Fpath%2Fto%2Freturn%2Ffailure&ItemId=000<TOKEN>&ItemName=%8Dw%93%FC%82%B7%82%E9%8F%A4%95i%96%BC&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>
|
41
|
+
headers:
|
42
|
+
Accept-Encoding:
|
43
|
+
- gzip;q=<TOKEN>.0,deflate;q=0.6,identity;q=0.3
|
44
|
+
Accept:
|
45
|
+
- "*/*"
|
46
|
+
User-Agent:
|
47
|
+
- Ruby
|
48
|
+
response:
|
49
|
+
status:
|
50
|
+
code: 200
|
51
|
+
message: OK
|
52
|
+
headers:
|
53
|
+
Server:
|
54
|
+
- nginx
|
55
|
+
Date:
|
56
|
+
- Tue, 29 Dec 2020 06:22:28 GMT
|
57
|
+
Content-Type:
|
58
|
+
- text/plain;charset=Windows-3<TOKEN>J
|
59
|
+
Transfer-Encoding:
|
60
|
+
- chunked
|
61
|
+
Connection:
|
62
|
+
- close
|
63
|
+
body:
|
64
|
+
encoding: UTF-8
|
65
|
+
string: AccessID=a890<TOKEN><TOKEN><TOKEN>530f250c<TOKEN>3e3c884ae273060a&Token=givwPbv44WyJuP66kQHXNHJ99gPQ6Yh/I5NrE0wMHxWwBS7yYvxSiC0zeMVH+O4F&StartURL=https://<HOST>/payment/RakutenIdStart.idPass&StartLimitDate=2020<TOKEN>229<TOKEN>52428
|
66
|
+
recorded_at: Tue, 29 Dec 2020 06:22:28 GMT
|
67
|
+
recorded_with: VCR 6.0.0
|
data/lib/gmo/const.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module GMO
|
2
4
|
module Const
|
3
5
|
DEFAULT_LOCALE = :en
|
@@ -68,6 +70,7 @@ module GMO
|
|
68
70
|
:inquiry_data => "InquiryData",
|
69
71
|
:inquiry_id => "InquiryID",
|
70
72
|
:item_code => "ItemCode",
|
73
|
+
:item_id => "ItemId",
|
71
74
|
:item_name => "ItemName",
|
72
75
|
:job_cd => "JobCd",
|
73
76
|
:last_month_free_flag => "LastMonthFreeFlag",
|
@@ -194,6 +197,8 @@ module GMO
|
|
194
197
|
'42G030000' => 'Card limit has been exceeded',
|
195
198
|
'42G040000' => 'Card balance is insufficient',
|
196
199
|
'42G050000' => 'Card limit has been exceeded',
|
200
|
+
'42G060000' => 'The balance of the account is insufficient with the debit card.',
|
201
|
+
'42G070000' => 'Payment could not be completed because the card limit was exceeded.',
|
197
202
|
'42G120000' => 'Card is not valid for transactions',
|
198
203
|
'42G220000' => 'Card is not valid for transactions',
|
199
204
|
'42G300000' => 'Card is not valid for transactions',
|
@@ -222,6 +227,7 @@ module GMO
|
|
222
227
|
'42G800000' => 'Cancellation classification is incorrect',
|
223
228
|
'42G810000' => 'Cancellation handling classification is incorrect',
|
224
229
|
'42G830000' => 'Expiration date is incorrect',
|
230
|
+
'42G920000' => 'Payment could not be completed at the discretion of the card company.',
|
225
231
|
'42G950000' => 'Card is not valid for transactions',
|
226
232
|
'42G960000' => 'Card is not valid for transactions',
|
227
233
|
'42G970000' => 'Card is not valid for transactions',
|
@@ -1425,6 +1431,8 @@ module GMO
|
|
1425
1431
|
'42G030000' => 'カード限度額を超えているために、決済を完了する事が出来ませんでした。',
|
1426
1432
|
'42G040000' => 'カード残高が不足しているために、決済を完了する事が出来ませんでした。',
|
1427
1433
|
'42G050000' => 'カード限度額を超えているために、決済を完了する事が出来ませんでした。',
|
1434
|
+
'42G060000' => 'デビットカードで口座の残高が不足しています。',
|
1435
|
+
'42G070000' => 'カード限度額を超えているために、決済を完了する事ができませんでした。',
|
1428
1436
|
'42G120000' => 'このカードでは取引をする事が出来ません。',
|
1429
1437
|
'42G220000' => 'このカードでは取引をする事が出来ません。',
|
1430
1438
|
'42G300000' => 'このカードでは取引をする事が出来ません。',
|
@@ -1453,6 +1461,7 @@ module GMO
|
|
1453
1461
|
'42G800000' => '取引区分に誤りがあるために、決済を完了する事が出来ませんでした。',
|
1454
1462
|
'42G810000' => '取消取扱区分に誤りがあるために、決済を完了する事が出来ませんでした。',
|
1455
1463
|
'42G830000' => '有効期限に誤りがあるために、決済を完了する事が出来ませんでした。',
|
1464
|
+
'42G920000' => 'カード会社判断により、決済を完了することができませんでした。',
|
1456
1465
|
'42G950000' => 'このカードでは取引をする事が出来ません。',
|
1457
1466
|
'42G960000' => 'このカードでは取引をする事が出来ません。',
|
1458
1467
|
'42G970000' => 'このカードでは取引をする事が出来ません。',
|
data/lib/gmo/shop_api.rb
CHANGED
@@ -108,6 +108,56 @@ module GMO
|
|
108
108
|
post_request name, options
|
109
109
|
end
|
110
110
|
|
111
|
+
### @params ###
|
112
|
+
# OrderID
|
113
|
+
# JobCd
|
114
|
+
# Amount
|
115
|
+
# ItemCode
|
116
|
+
# Tax
|
117
|
+
### @return ###
|
118
|
+
# AccessID
|
119
|
+
# AccessPass
|
120
|
+
### example ###
|
121
|
+
# gmo.entry_tran_rakuten_id({
|
122
|
+
# order_id: "ord12345",
|
123
|
+
# job_cd: "AUTH",
|
124
|
+
# item_code: "1000001",
|
125
|
+
# tax: "0001001",
|
126
|
+
# amount: 100
|
127
|
+
# })
|
128
|
+
# => {"AccessID"=>"139f8ec33a07c55f406937c52ce4473d", "AccessPass"=>"2689b204d2c17192fa35f9269fa7e744"}
|
129
|
+
def entry_tran_rakuten_id(options = {})
|
130
|
+
name = "EntryTranRakutenId.idPass"
|
131
|
+
required = [:order_id, :job_cd, :amount]
|
132
|
+
assert_required_options(required, options)
|
133
|
+
post_request name, options
|
134
|
+
end
|
135
|
+
|
136
|
+
### @params ###
|
137
|
+
# OrderID
|
138
|
+
# JobCd
|
139
|
+
# Amount
|
140
|
+
# ItemCode
|
141
|
+
# Tax
|
142
|
+
### @return ###
|
143
|
+
# AccessID
|
144
|
+
# AccessPass
|
145
|
+
### example ###
|
146
|
+
# gmo.entry_tran_docomo({
|
147
|
+
# order_id: "ord12345",
|
148
|
+
# job_cd: "AUTH",
|
149
|
+
# item_code: "1000001",
|
150
|
+
# tax: "0001001",
|
151
|
+
# amount: 100
|
152
|
+
# })
|
153
|
+
# => {"AccessID"=>"139f8ec33a07c55f406937c52ce4473d", "AccessPass"=>"2689b204d2c17192fa35f9269fa7e744"}
|
154
|
+
def entry_tran_docomo(options = {})
|
155
|
+
name = "EntryTranDocomo.idPass"
|
156
|
+
required = [:order_id, :job_cd, :amount]
|
157
|
+
assert_required_options(required, options)
|
158
|
+
post_request name, options
|
159
|
+
end
|
160
|
+
|
111
161
|
## 2.2.2.2.決済実行
|
112
162
|
# 指定されたサイトに会員を登録します。
|
113
163
|
# return
|
@@ -210,6 +260,24 @@ module GMO
|
|
210
260
|
post_request name, options
|
211
261
|
end
|
212
262
|
|
263
|
+
# 【楽天ペイ決済】
|
264
|
+
# 18.1.2.2. 決済実行
|
265
|
+
def exec_tran_rakuten_id(options = {})
|
266
|
+
name = "ExecTranRakutenId.idPass"
|
267
|
+
required = [:access_id, :access_pass, :order_id]
|
268
|
+
assert_required_options(required, options)
|
269
|
+
post_request name, options
|
270
|
+
end
|
271
|
+
|
272
|
+
# 【ドコモ払い決済】
|
273
|
+
# 18.1.2.2. 決済実行
|
274
|
+
def exec_tran_docomo(options = {})
|
275
|
+
name = "ExecTranDocomo.idPass"
|
276
|
+
required = [:access_id, :access_pass, :order_id]
|
277
|
+
assert_required_options(required, options)
|
278
|
+
post_request name, options
|
279
|
+
end
|
280
|
+
|
213
281
|
### @params ###
|
214
282
|
# AccessID
|
215
283
|
# AccessPass
|
data/lib/gmo/version.rb
CHANGED
data/spec/gmo/shop_api_spec.rb
CHANGED
@@ -136,6 +136,44 @@ describe "GMO::Payment::ShopAPI" do
|
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
139
|
+
describe "#entry_tran_rakuten_id" do
|
140
|
+
it "gets data about a transaction", :vcr do
|
141
|
+
order_id = @order_id
|
142
|
+
result = @service.entry_tran_rakuten_id({
|
143
|
+
:order_id => order_id,
|
144
|
+
:job_cd => "AUTH",
|
145
|
+
:amount => 100
|
146
|
+
})
|
147
|
+
result["AccessID"].nil?.should_not be true
|
148
|
+
result["AccessPass"].nil?.should_not be true
|
149
|
+
end
|
150
|
+
|
151
|
+
it "got error if missing options", :vcr do
|
152
|
+
lambda {
|
153
|
+
result = @service.entry_tran_rakuten_id()
|
154
|
+
}.should raise_error('Required order_id, job_cd, amount were not provided.')
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
describe "#entry_tran_docomo" do
|
159
|
+
it "gets data about a transaction", :vcr do
|
160
|
+
order_id = @order_id
|
161
|
+
result = @service.entry_tran_docomo({
|
162
|
+
:order_id => order_id,
|
163
|
+
:job_cd => "AUTH",
|
164
|
+
:amount => 100
|
165
|
+
})
|
166
|
+
result["AccessID"].nil?.should_not be true
|
167
|
+
result["AccessPass"].nil?.should_not be true
|
168
|
+
end
|
169
|
+
|
170
|
+
it "got error if missing options", :vcr do
|
171
|
+
lambda {
|
172
|
+
result = @service.entry_tran_docomo()
|
173
|
+
}.should raise_error('Required order_id, job_cd, amount were not provided.')
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
139
177
|
describe "#exec_tran" do
|
140
178
|
it "gets data about a transaction", :vcr do
|
141
179
|
order_id = generate_id
|
@@ -348,6 +386,70 @@ describe "GMO::Payment::ShopAPI" do
|
|
348
386
|
end
|
349
387
|
end
|
350
388
|
|
389
|
+
describe "#exec_tran_rakuten_id" do
|
390
|
+
it "gets data about a transaction", :vcr do
|
391
|
+
order_id = generate_id
|
392
|
+
result = @service.entry_tran_rakuten_id({
|
393
|
+
:order_id => order_id,
|
394
|
+
:job_cd => 'CAPTURE',
|
395
|
+
:amount => 100
|
396
|
+
})
|
397
|
+
access_id = result["AccessID"]
|
398
|
+
access_pass = result["AccessPass"]
|
399
|
+
result = @service.exec_tran_rakuten_id({
|
400
|
+
:order_id => order_id,
|
401
|
+
:access_id => access_id,
|
402
|
+
:access_pass => access_pass,
|
403
|
+
:ret_url => 'https://example.com/path/to/return/success',
|
404
|
+
:error_rcv_url => 'https://example.com/path/to/return/failure',
|
405
|
+
:item_id => '0001',
|
406
|
+
:item_name => '購入する商品名'
|
407
|
+
})
|
408
|
+
result["AccessID"].nil?.should_not be_truthy
|
409
|
+
result["Token"].nil?.should_not be_truthy
|
410
|
+
result["StartURL"].nil?.should_not be_truthy
|
411
|
+
result["StartLimitDate"].nil?.should_not be_truthy
|
412
|
+
end
|
413
|
+
|
414
|
+
it "got error if missing options", :vcr do
|
415
|
+
lambda {
|
416
|
+
result = @service.exec_tran_rakuten_id()
|
417
|
+
}.should raise_error("Required access_id, access_pass, order_id were not provided.")
|
418
|
+
end
|
419
|
+
end
|
420
|
+
|
421
|
+
describe "#exec_tran_docomo" do
|
422
|
+
it "gets data about a transaction", :vcr do
|
423
|
+
order_id = generate_id
|
424
|
+
result = @service.entry_tran_docomo({
|
425
|
+
:order_id => order_id,
|
426
|
+
:job_cd => 'CAPTURE',
|
427
|
+
:amount => 100
|
428
|
+
})
|
429
|
+
access_id = result["AccessID"]
|
430
|
+
access_pass = result["AccessPass"]
|
431
|
+
result = @service.exec_tran_docomo({
|
432
|
+
:order_id => order_id,
|
433
|
+
:access_id => access_id,
|
434
|
+
:access_pass => access_pass,
|
435
|
+
:ret_url => 'https://example.com/path/to/return/success',
|
436
|
+
:error_rcv_url => 'https://example.com/path/to/return/failure',
|
437
|
+
:item_id => '0001',
|
438
|
+
:item_name => '購入する商品名'
|
439
|
+
})
|
440
|
+
result["AccessID"].nil?.should_not be_truthy
|
441
|
+
result["Token"].nil?.should_not be_truthy
|
442
|
+
result["StartURL"].nil?.should_not be_truthy
|
443
|
+
result["StartLimitDate"].nil?.should_not be_truthy
|
444
|
+
end
|
445
|
+
|
446
|
+
it "got error if missing options", :vcr do
|
447
|
+
lambda {
|
448
|
+
result = @service.exec_tran_docomo()
|
449
|
+
}.should raise_error("Required access_id, access_pass, order_id were not provided.")
|
450
|
+
end
|
451
|
+
end
|
452
|
+
|
351
453
|
describe "#exec_tran_brandtoken" do
|
352
454
|
it "gets data about a transaction", :vcr do
|
353
455
|
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.5.
|
4
|
+
version: 0.5.2
|
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: 2021-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -132,19 +132,23 @@ files:
|
|
132
132
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_brandtoken_gets_data_about_a_transaction.yml
|
133
133
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_cvs_gets_data_about_a_transaction.yml
|
134
134
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_cvs_got_error_if_missing_options.yml
|
135
|
+
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_docomo_gets_data_about_a_transaction.yml
|
135
136
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_gets_data_about_a_transaction.yml
|
136
137
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_got_error_if_missing_options.yml
|
137
138
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_linepay_gets_data_about_a_transaction.yml
|
138
139
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_pay_easy_gets_data_about_a_transaction.yml
|
140
|
+
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_rakuten_id_gets_data_about_a_transaction.yml
|
139
141
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_brandtoken_gets_data_about_a_transaction.yml
|
140
142
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_brandtoken_parameter_contains_Japanese_characters_should_correctly_handle_Japanese.yml
|
141
143
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_cvs_gets_data_about_a_transaction.yml
|
144
|
+
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_docomo_gets_data_about_a_transaction.yml
|
142
145
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_doesn_t_require_card_info_if_token_is_present.yml
|
143
146
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_gets_data_about_a_transaction.yml
|
144
147
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_got_error_if_missing_options.yml
|
145
148
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_linepay_gets_data_about_a_transaction.yml
|
146
149
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_parameter_contains_Japanese_characters_should_correctly_handle_Japanese.yml
|
147
150
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_pay_easy_gets_data_about_a_transaction.yml
|
151
|
+
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_rakuten_id_gets_data_about_a_transaction.yml
|
148
152
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_refund_tran_brandtoken_gets_data_about_a_transaction.yml
|
149
153
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_sales_tran_brandtoken_gets_data_about_a_transaction.yml
|
150
154
|
- fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_search_trade_gets_data_about_order.yml
|
@@ -217,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
221
|
version: '0'
|
218
222
|
requirements: []
|
219
223
|
rubyforge_project:
|
220
|
-
rubygems_version: 2.7.
|
224
|
+
rubygems_version: 2.7.8
|
221
225
|
signing_key:
|
222
226
|
specification_version: 4
|
223
227
|
summary: 'GMO Payment API client: Ruby client library for the GMO Payment Platform.'
|