gmo 0.5.5 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (23) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +1 -1
  3. data/CHANGELOG.md +9 -0
  4. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_cancel_link_redirect_url_with_invalid_options_got_error.yml +53 -0
  5. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_cancel_link_redirect_url_with_valid_options_gets_data_about_a_link_edirect_url.yml +103 -0
  6. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_create_link_redirect_url_with_valid_options_gets_data_about_link_redirect_url.yml +53 -0
  7. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_create_mail_deposit_with_valid_options_gets_data_about_a_mail_deposit.yml +47 -0
  8. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_create_mail_deposit_with_valid_options_makes_request_with_correct_parameters.yml +47 -0
  9. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_ganb_gets_data_about_a_transaction.yml +35 -0
  10. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_paypal_gets_data_about_a_transaction.yml +35 -0
  11. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_ganb_gets_data_about_a_transaction.yml +68 -0
  12. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_paypal_gets_data_about_a_transaction.yml +67 -0
  13. data/gmo.gemspec +1 -0
  14. data/lib/gmo/const.rb +15 -0
  15. data/lib/gmo/http_services.rb +6 -1
  16. data/lib/gmo/remittance_api.rb +63 -1
  17. data/lib/gmo/shop_api.rb +40 -0
  18. data/lib/gmo/version.rb +1 -1
  19. data/lib/gmo.rb +10 -3
  20. data/spec/gmo/remittance_api_spec.rb +123 -36
  21. data/spec/gmo/shop_api_spec.rb +104 -0
  22. metadata +25 -3
  23. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_create_mail_deposit_gets_data_about_a_mail_deposit.yml +0 -38
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6861bfcbf102510765f34d115714b020460501010d579fa47271ecd6d49a82bb
4
- data.tar.gz: cc08cab39ff1b6ce6c67f0eb4d9fb7cbf6d906ea8ea5bb5f147749bb07690292
3
+ metadata.gz: 777d9df05c7ce84b2a312a791db6eb4d9185f98d9091a6d1e8c1a6b2a910e805
4
+ data.tar.gz: 49c6446f6c5ae13f9a329c2f8a260eebf3a13f99af0114f7e553aa0c4229081d
5
5
  SHA512:
6
- metadata.gz: 0c33264930291e6afc1f42fadf25e62943041251e5c345cfd7f6baf889a56c8e3e10333b4fdeb105491cc7c906ee9e459485e021f62db9a8133c4c5c11c1b8b7
7
- data.tar.gz: 4b2935f52820e0ec21238d637822c452ac33b8c56cc239038875509ebf58a1999e3a094d207ef933708bcfb10df7d8e399b6dcbaf2d94e357772412a7f981308
6
+ metadata.gz: 93dd5945e58cbcfee6a5546b8be9bdd092ebbd3a5038c197dd317dc78a3b19d34d1328cf30994e19329ca68ec588c3d93ba7533072a219dd1c0daaf4b1b2cd37
7
+ data.tar.gz: edc8f3b52dc18c6fffda4255262189a2e48bb5bc79700ac5e72fe7861461dbe7d6c925de21a8c856275d10bbb3543aee8a1d03fd8666d103a37adc3b5f497baa
@@ -26,7 +26,7 @@ jobs:
26
26
  timeout-minutes: 10
27
27
  strategy:
28
28
  matrix:
29
- ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2']
29
+ ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3']
30
30
 
31
31
  steps:
32
32
  - uses: actions/checkout@v3
data/CHANGELOG.md CHANGED
@@ -1,4 +1,13 @@
1
1
  # CHANGELOG
2
+ ## 0.5.7
3
+ - Added `nkf` as a dependency. This fixes the warning that appears with Ruby 3.3.0 and later versions. [#67](https://github.com/t-k/gmo-payment-ruby/pull/69)
4
+
5
+ ## 0.5.6
6
+ - Support PayPal決済 [#63](https://github.com/t-k/gmo-payment-ruby/pull/63)
7
+ - Support 銀行振込(バーチャル口座 あおぞら)[#64](https://github.com/t-k/gmo-payment-ruby/pull/64)
8
+ - Update 送金サービス リンクタイプURL取得 [#65](https://github.com/t-k/gmo-payment-ruby/pull/65)
9
+ - Update 送金サービス メール送金指示 [#66](https://github.com/t-k/gmo-payment-ruby/pull/66)
10
+
2
11
  ## 0.5.5
3
12
  - Enhanced encoding handling to prevent misjudgments during UTF-8 conversion [#57](https://github.com/t-k/gmo-payment-ruby/pull/57) (Thanks [@y-yagi](https://github.com/y-yagi))
4
13
 
@@ -0,0 +1,53 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<REMITTANCE_HOST>/api/shop/LinkRedirectUrl.json
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"Deposit_ID":"dep00001","Call_Back_Url":"https://example.com/callback","Amount":"100","Auth_Code":"AUTH001","Shop_ID":"<REMITTANCE_SHOP_ID>","Shop_Pass":"<REMITTANCE_SHOP_PASS>"}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: ''
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Mon, 09 Oct 2023 08:25:18 GMT
27
+ Content-Type:
28
+ - application/json;charset=UTF-8
29
+ Content-Length:
30
+ - "177"
31
+ Connection:
32
+ - close
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ Cache-Control:
36
+ - no-cache, no-store
37
+ Pragma:
38
+ - no-cache
39
+ Expires:
40
+ - '0'
41
+ Content-Disposition:
42
+ - attachment;filename="LinkRedirectUrl.json"
43
+ X-Frame-Options:
44
+ - SAMEORIGIN
45
+ X-Xss-Protection:
46
+ - "1; mode=block"
47
+ Strict-Transport-Security:
48
+ - max-age=63072000
49
+ body:
50
+ encoding: UTF-8
51
+ string: '{"Redirect_Url":"https://<REMITTANCE_HOST>/mail/mail-deposit?token=7c0bbc6531f42138eca9b8caf63b7735b5ad8d2faf8fe2ede3c364fd71f88e85","Deposit_ID":"dep00001","Method":"1"}'
52
+ recorded_at: Mon, 09 Oct 2023 08:25:18 GMT
53
+ recorded_with: VCR 6.1.0
@@ -0,0 +1,103 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<REMITTANCE_HOST>/api/shop/LinkRedirectUrl.json
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"Deposit_ID":"dep00001","Call_Back_Url":"https://example.com/callback","Amount":"100","Auth_Code":"AUTH001","Shop_ID":"<REMITTANCE_SHOP_ID>","Shop_Pass":"<REMITTANCE_SHOP_PASS>"}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: ''
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Mon, 09 Oct 2023 08:25:18 GMT
27
+ Content-Type:
28
+ - application/json;charset=UTF-8
29
+ Content-Length:
30
+ - "177"
31
+ Connection:
32
+ - close
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ Cache-Control:
36
+ - no-cache, no-store
37
+ Pragma:
38
+ - no-cache
39
+ Expires:
40
+ - '0'
41
+ Content-Disposition:
42
+ - attachment;filename="LinkRedirectUrl.json"
43
+ X-Frame-Options:
44
+ - SAMEORIGIN
45
+ X-Xss-Protection:
46
+ - "1; mode=block"
47
+ Strict-Transport-Security:
48
+ - max-age=63072000
49
+ body:
50
+ encoding: UTF-8
51
+ string: '{"Redirect_Url":"https://<REMITTANCE_HOST>/mail/mail-deposit?token=cbc777b18666b7aa21f42e98fa972c493530c3d5d6bfd9125b262075512bf285","Deposit_ID":"dep00001","Method":"1"}'
52
+ recorded_at: Mon, 09 Oct 2023 08:25:18 GMT
53
+ - request:
54
+ method: post
55
+ uri: https://<REMITTANCE_HOST>/api/shop/LinkRedirectUrl.json
56
+ body:
57
+ encoding: UTF-8
58
+ string: '{"Deposit_ID":"dep00001","Method":2,"Shop_ID":"<REMITTANCE_SHOP_ID>","Shop_Pass":"<REMITTANCE_SHOP_PASS>"}'
59
+ headers:
60
+ Content-Type:
61
+ - application/json
62
+ Accept-Encoding:
63
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
64
+ Accept:
65
+ - "*/*"
66
+ User-Agent:
67
+ - Ruby
68
+ response:
69
+ status:
70
+ code: 200
71
+ message: ''
72
+ headers:
73
+ Server:
74
+ - nginx
75
+ Date:
76
+ - Mon, 09 Oct 2023 08:26:00 GMT
77
+ Content-Type:
78
+ - application/json;charset=UTF-8
79
+ Content-Length:
80
+ - '38'
81
+ Connection:
82
+ - close
83
+ X-Content-Type-Options:
84
+ - nosniff
85
+ Cache-Control:
86
+ - no-cache, no-store
87
+ Pragma:
88
+ - no-cache
89
+ Expires:
90
+ - '0'
91
+ Content-Disposition:
92
+ - attachment;filename="LinkRedirectUrl.json"
93
+ X-Frame-Options:
94
+ - SAMEORIGIN
95
+ X-Xss-Protection:
96
+ - "1; mode=block"
97
+ Strict-Transport-Security:
98
+ - max-age=63072000
99
+ body:
100
+ encoding: UTF-8
101
+ string: '{"Deposit_ID":"dep00001","Method":"2"}'
102
+ recorded_at: Mon, 09 Oct 2023 08:26:00 GMT
103
+ recorded_with: VCR 6.1.0
@@ -0,0 +1,53 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<REMITTANCE_HOST>/api/shop/LinkRedirectUrl.json
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"Deposit_ID":"dep00001","Amount":"1000","Auth_Code":"auth00001","Call_Back_Url":"https://example.com/callback","Shop_ID":"<REMITTANCE_SHOP_ID>","Shop_Pass":"<REMITTANCE_SHOP_PASS>"}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: ''
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Fri, 06 Oct 2023 10:30:26 GMT
27
+ Content-Type:
28
+ - application/json;charset=UTF-8
29
+ Content-Length:
30
+ - "177"
31
+ Connection:
32
+ - close
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ Cache-Control:
36
+ - no-cache, no-store
37
+ Pragma:
38
+ - no-cache
39
+ Expires:
40
+ - '0'
41
+ Content-Disposition:
42
+ - attachment;filename="LinkRedirectUrl.json"
43
+ X-Frame-Options:
44
+ - SAMEORIGIN
45
+ X-Xss-Protection:
46
+ - "1; mode=block"
47
+ Strict-Transport-Security:
48
+ - max-age=63072000
49
+ body:
50
+ encoding: UTF-8
51
+ string: '{"Redirect_Url":"https://<REMITTANCE_HOST>/mail/mail-deposit?token=cfd81440aef67210b6f3eccf3cb8e7d7020013d67108ca4d13d1ca897fb0d0f6","Deposit_ID":"dep00001","Method":"1"}'
52
+ recorded_at: Fri, 06 Oct 2023 10:30:26 GMT
53
+ recorded_with: VCR 6.1.0
@@ -0,0 +1,47 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<REMITTANCE_HOST>/api/MailDepositRegistration.idPass
6
+ body:
7
+ encoding: UTF-8
8
+ string: Deposit_ID=dep00001&Mail_Address=anyutzy%40demo.com&Amount=1000&Mail_Deposit_Account_Name=An+Yutzy&Expire=5&Shop_Mail_Address=anyutzy%40demo.com&Auth_Code=auth00001&Auth_Code2=auth00002&Auth_Code3=auth00003&Remit_Method_Bank=1&Mail_Template_Free1=mail_template_free_1&Mail_Template_Free2=mail_template_free_2&Mail_Template_Free3=mail_template_free_3&Mail_Template_Number=1&Bank_ID=bank_id00001&Select_Key=select00001&Client_Name=%83C%83%89%83C%83j%83%93%83%5E%83%8D%83E&Method=1&Shop_ID=<REMITTANCE_SHOP_ID>&Shop_Pass=<REMITTANCE_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: ''
20
+ headers:
21
+ Server:
22
+ - nginx
23
+ Date:
24
+ - Thu, 12 Oct 2023 07:13:06 GMT
25
+ Content-Type:
26
+ - text/plain;charset=windows-31j
27
+ Content-Length:
28
+ - '56'
29
+ Connection:
30
+ - close
31
+ Cache-Control:
32
+ - no-cache, no-store
33
+ Pragma:
34
+ - no-cache
35
+ Expires:
36
+ - '0'
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Xss-Protection:
40
+ - "1; mode=block"
41
+ Strict-Transport-Security:
42
+ - max-age=63072000
43
+ body:
44
+ encoding: UTF-8
45
+ string: Deposit_ID=dep00001&Method=1&Amount=1000&Expire=20231018
46
+ recorded_at: Thu, 12 Oct 2023 07:13:06 GMT
47
+ recorded_with: VCR 6.1.0
@@ -0,0 +1,47 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<REMITTANCE_HOST>/api/MailDepositRegistration.idPass
6
+ body:
7
+ encoding: UTF-8
8
+ string: Deposit_ID=dep00001&Mail_Address=anyutzy%40demo.com&Amount=1000&Mail_Deposit_Account_Name=An+Yutzy&Expire=5&Shop_Mail_Address=anyutzy%40demo.com&Auth_Code=auth00001&Auth_Code2=auth00002&Auth_Code3=auth00003&Remit_Method_Bank=1&Mail_Template_Free1=mail_template_free_1&Mail_Template_Free2=mail_template_free_2&Mail_Template_Free3=mail_template_free_3&Mail_Template_Number=1&Bank_ID=bank_id00001&Select_Key=select00001&Client_Name=%83C%83%89%83C%83j%83%93%83%5E%83%8D%83E&Method=1&Shop_ID=<REMITTANCE_SHOP_ID>&Shop_Pass=<REMITTANCE_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: ''
20
+ headers:
21
+ Server:
22
+ - nginx
23
+ Date:
24
+ - Thu, 12 Oct 2023 07:13:06 GMT
25
+ Content-Type:
26
+ - text/plain;charset=windows-31j
27
+ Content-Length:
28
+ - '56'
29
+ Connection:
30
+ - close
31
+ Cache-Control:
32
+ - no-cache, no-store
33
+ Pragma:
34
+ - no-cache
35
+ Expires:
36
+ - '0'
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Xss-Protection:
40
+ - "1; mode=block"
41
+ Strict-Transport-Security:
42
+ - max-age=63072000
43
+ body:
44
+ encoding: UTF-8
45
+ string: Deposit_ID=dep00001&Method=1&Amount=1000&Expire=20231018
46
+ recorded_at: Thu, 12 Oct 2023 07:13:06 GMT
47
+ recorded_with: VCR 6.1.0
@@ -0,0 +1,35 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<HOST>/payment/EntryTranGANB.idPass
6
+ body:
7
+ encoding: UTF-8
8
+ string: OrderID=1696341308&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
+ - Tue, 03 Oct 2023 13:55:08 GMT
25
+ Content-Type:
26
+ - text/plain;charset=Shift_JIS
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - close
31
+ body:
32
+ encoding: UTF-8
33
+ string: OrderID=1696341308&AccessID=e297cc560cc91e226d0affef26f9ca10&AccessPass=e81b3b1af08488e16d73dcf5e0ecd6b0
34
+ recorded_at: Tue, 03 Oct 2023 13:55:08 GMT
35
+ recorded_with: VCR 6.1.0
@@ -0,0 +1,35 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<HOST>/payment/EntryTranPaypal.idPass
6
+ body:
7
+ encoding: UTF-8
8
+ string: OrderID=1665961543&JobCd=CAPTURE&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
+ - Sun, 16 Oct 2022 23:05:43 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: OrderID=1665961543&AccessID=37dc5228bcca9474fbe7cc4c911e898b&AccessPass=f59990590602293bd9b1aefdde90bf8c
34
+ recorded_at: Sun, 16 Oct 2022 23:05:43 GMT
35
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,68 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<HOST>/payment/EntryTranGANB.idPass
6
+ body:
7
+ encoding: UTF-8
8
+ string: OrderID=1696418445&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
+ - Wed, 04 Oct 2023 11:20:50 GMT
25
+ Content-Type:
26
+ - text/plain;charset=Shift_JIS
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - close
31
+ body:
32
+ encoding: UTF-8
33
+ string: OrderID=1696418445&AccessID=ef73b56f6daf8fb36fa8e0a2133a0613&AccessPass=f9e832b3b9c886b70d98c5e857571033
34
+ recorded_at: Wed, 04 Oct 2023 11:20:45 GMT
35
+ - request:
36
+ method: post
37
+ uri: https://<HOST>/payment/ExecTranGANB.idPass
38
+ body:
39
+ encoding: UTF-8
40
+ string: OrderID=1696418445&AccessID=ef73b56f6daf8fb36fa8e0a2133a0613&AccessPass=f9e832b3b9c886b70d98c5e857571033&ClientField1=%89%C1%96%BF%93X%8E%A9%97R%8D%80%96%DA1%82%C5%82%B7%81B&ClientField2=%89%C1%96%BF%93X%8E%A9%97R%8D%80%96%DA2%82%C5%82%B7%81B&ClientField3=%89%C1%96%BF%93X%8E%A9%97R%8D%80%96%DA3%82%C5%82%B7%81B&=irai%40example.com&TradeDays=3&TradeReason=%8E%E6%88%F8%8E%96%97R%82%C5%82%B7%81B&TradeClientName=%88%CB%97%8A%89%D4%8Eq&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>
41
+ headers:
42
+ Accept-Encoding:
43
+ - gzip;q=1.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
+ - Wed, 04 Oct 2023 11:21:05 GMT
57
+ Content-Type:
58
+ - text/plain;charset=Shift_JIS
59
+ Transfer-Encoding:
60
+ - chunked
61
+ Connection:
62
+ - close
63
+ body:
64
+ encoding: ASCII-8BIT
65
+ string: !binary |-
66
+ QWNjZXNzSUQ9ZWY3M2I1NmY2ZGFmOGZiMzZmYThlMGEyPFRPS0VOPjMzYTA2PFRPS0VOPjMmQmFua0NvZGU9MDM8VE9LRU4+MCZCYW5rTmFtZT283i200bUtsbW/3tfIwsQmQnJhbmNoQ29kZT01MDMmQnJhbmNoTmFtZT22v7O8w90mQWNjb3VudFR5cGU9PFRPS0VOPiZBY2NvdW50TnVtYmVyPTg5Mjk2OTYmQWNjb3VudEhvbGRlck5hbWU9w73EvK6vzN8mQXZhaWxhYmxlRGF0ZT0yMDIzPFRPS0VOPjAwNw==
67
+ recorded_at: Wed, 04 Oct 2023 11:21:00 GMT
68
+ recorded_with: VCR 6.1.0
@@ -0,0 +1,67 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<HOST>/payment/EntryTranPaypal.idPass
6
+ body:
7
+ encoding: UTF-8
8
+ string: OrderID=1666049036&JobCd=CAPTURE&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
+ - Mon, 17 Oct 2022 23:23:57 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: OrderID=1666049036&AccessID=0c3ce8ac4d8578942bdc2fb0bbee7657&AccessPass=cbc4fa24f0061c779f4f60a214785c5f
34
+ recorded_at: Mon, 17 Oct 2022 23:23:57 GMT
35
+ - request:
36
+ method: post
37
+ uri: https://<HOST>/payment/ExecTranPaypal.idPass
38
+ body:
39
+ encoding: UTF-8
40
+ string: OrderID=1666049036&AccessID=0c3ce8ac4d8578942bdc2fb0bbee7657&AccessPass=cbc4fa24f0061c779f4f60a214785c5f&RedirectURL=https%3A%2F%2Fexample.com%2Fpath%2Fto%2Fredirect&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=1.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
+ - Mon, 17 Oct 2022 23:23:57 GMT
57
+ Content-Type:
58
+ - text/plain;charset=Windows-31J
59
+ Transfer-Encoding:
60
+ - chunked
61
+ Connection:
62
+ - close
63
+ body:
64
+ encoding: UTF-8
65
+ string: OrderID=1666049036
66
+ recorded_at: Mon, 17 Oct 2022 23:23:57 GMT
67
+ recorded_with: VCR 6.0.0
data/gmo.gemspec CHANGED
@@ -23,6 +23,7 @@ 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_runtime_dependency "nkf"
26
27
  gem.add_development_dependency "rspec", "~> 3"
27
28
  gem.add_development_dependency "rake"
28
29
  gem.add_development_dependency "vcr"
data/lib/gmo/const.rb CHANGED
@@ -33,11 +33,15 @@ module GMO
33
33
  :address_4 => "Address4",
34
34
  :address_5 => "Address5",
35
35
  :address_6 => "Address6",
36
+ :auth_code => "Auth_Code",
37
+ :auth_code_2 => "Auth_Code2",
38
+ :auth_code_3 => "Auth_Code3",
36
39
  :amount => "Amount",
37
40
  :bank_code => "Bank_Code",
38
41
  :bank_id => "Bank_ID",
39
42
  :branch_code => "Branch_Code",
40
43
  :branch_code_jp => "Branch_Code_Jpbank",
44
+ :call_back_url => "Call_Back_Url",
41
45
  :cancel_amount => "CancelAmount",
42
46
  :cancel_tax => "CancelTax",
43
47
  :card_name => "CardName",
@@ -52,6 +56,7 @@ module GMO
52
56
  :client_field_2 => "ClientField2",
53
57
  :client_field_3 => "ClientField3",
54
58
  :client_field_flg => "ClientFieldFlag",
59
+ :client_name => "Client_Name",
55
60
  :commodity => "Commodity",
56
61
  :confirm_base_date => "ConfirmBaseDate",
57
62
  :continuance_month => "ContinuanceMonth",
@@ -87,6 +92,10 @@ module GMO
87
92
  :locale => "Locale",
88
93
  :md => "MD",
89
94
  :mail_address => "MailAddress",
95
+ :mail_template_free_1 => "Mail_Template_Free1",
96
+ :mail_template_free_2 => "Mail_Template_Free2",
97
+ :mail_template_free_3 => "Mail_Template_Free3",
98
+ :mail_template_number => "Mail_Template_Number",
90
99
  :member_id => "MemberID",
91
100
  :member_name => "MemberName",
92
101
  :member_no => "MemberNo",
@@ -123,12 +132,18 @@ module GMO
123
132
  :register_disp_6 => "RegisterDisp6",
124
133
  :register_disp_7 => "RegisterDisp7",
125
134
  :register_disp_8 => "RegisterDisp8",
135
+ :remit_method_amazongift => "Remit_Method_Amazongift",
136
+ :remit_method_aupay => "Remit_Method_Aupay",
137
+ :remit_method_bank => "Remit_Method_Bank",
138
+ :remit_method_sevenatm => "Remit_Method_Sevenatm",
126
139
  :reserve_no => "ReserveNo",
127
140
  :ret_url => "RetURL",
128
141
  :security_code => "SecurityCode",
142
+ :select_key => "Select_Key",
129
143
  :seq_mode => "SeqMode",
130
144
  :service_name => "ServiceName",
131
145
  :service_tel => "ServiceTel",
146
+ :sevenatm_payment_term_day => "Sevenatm_Payment_Term_Day",
132
147
  :shop_id => "ShopID",
133
148
  :shop_mail_address => "ShopMailAddress",
134
149
  :shop_pass => "ShopPass",
@@ -40,7 +40,12 @@ module GMO
40
40
 
41
41
  http.start do |h|
42
42
  response = if verb == "post"
43
- h.post(path, encode_params(args))
43
+ if /\.json\Z/ =~ path
44
+ headers = { "Content-Type" => "application/json" }
45
+ h.post(path, args.to_json, headers)
46
+ else
47
+ h.post(path, encode_params(args))
48
+ end
44
49
  else
45
50
  h.get("#{path}?#{encode_params(args)}")
46
51
  end
@@ -250,6 +250,17 @@ module GMO
250
250
  # Mail_Deposit_Account_Name
251
251
  # Expire
252
252
  # Shop_Mail_Address
253
+ # Auth_Code
254
+ # Auth_Code2
255
+ # Auth_Code3
256
+ # Remit_Method_Bank
257
+ # Mail_Template_Free1
258
+ # Mail_Template_Free2
259
+ # Mail_Template_Free3
260
+ # Mail_Template_Number
261
+ # Bank_ID
262
+ # Select_Key
263
+ # Client_Name
253
264
  ### @return ###
254
265
  # Method
255
266
  # Amount
@@ -268,7 +279,7 @@ module GMO
268
279
  def create_mail_deposit(options = {})
269
280
  name = "/api/MailDepositRegistration.idPass"
270
281
  options[:method] = 1
271
- required = %i(deposit_id deposit_email amount deposit_account_name expire deposit_shop_email)
282
+ required = %i(deposit_id deposit_email amount expire deposit_shop_email)
272
283
  assert_required_options(required, options)
273
284
  post_request name, options
274
285
  end
@@ -314,6 +325,57 @@ module GMO
314
325
  post_request name, options
315
326
  end
316
327
 
328
+ #########
329
+ # Deposit_ID
330
+ # Call_Back_Url
331
+ # Amount
332
+ # Auth_Code
333
+ # Auth_Code2
334
+ # Auth_Code3
335
+ # Remit_Method_Bank
336
+ # Remit_Method_Sevenatm
337
+ # Sevenatm_Payment_Term_Day
338
+ # Remit_Method_Amazongift
339
+ # Remit_Method_Aup ay
340
+ # Bank_ID
341
+ # Client_Name
342
+ ### @return ###
343
+ # Deposit_ID
344
+ # Redirect_Url
345
+ # Method
346
+ ### example ###
347
+ # gmo.create_link_redirect_url({
348
+ # deposit_id: 'dep00001',
349
+ # call_back_url: 'https://XXXX/XXXX/XXXX/XXXX',
350
+ # amount: '1000',
351
+ # auth_code: 'auth00001',
352
+ # })
353
+ # {"Deposit_ID"=>"dep00001", "Redirect_Url"=>"https://XXXX/XXXX/XXXX/XXXX", "Method"=>"1"}
354
+ def create_link_redirect_url(options = {})
355
+ name = "/api/shop/LinkRedirectUrl.json"
356
+ required = %i(deposit_id call_back_url amount auth_code)
357
+ assert_required_options(required, options)
358
+ post_request name, options
359
+ end
360
+
361
+ #########
362
+ # Deposit_ID
363
+ ### @return ###
364
+ # Deposit_ID
365
+ # Method
366
+ ### example ###
367
+ # gmo.cancel_link_redirect_url({
368
+ # deposit_id: 'dep00001',
369
+ # })
370
+ # {"Deposit_ID"=>"dep00001", "Method"=>"2"}
371
+ def cancel_link_redirect_url(options = {})
372
+ name = "/api/shop/LinkRedirectUrl.json"
373
+ required = %i(deposit_id)
374
+ options[:method] = 2
375
+ assert_required_options(required, options)
376
+ post_request name, options
377
+ end
378
+
317
379
  private
318
380
 
319
381
  def api_call(name, args = {}, verb = "post", options = {})
data/lib/gmo/shop_api.rb CHANGED
@@ -73,6 +73,26 @@ module GMO
73
73
  post_request name, options
74
74
  end
75
75
 
76
+ # 【PayPal決済】
77
+ # 取引登録
78
+ # これ以降の決済取引で必要となる取引IDと取引パスワードの発行を行い、取引を開始します。
79
+ def entry_tran_paypal(options = {})
80
+ name = "EntryTranPaypal.idPass"
81
+ required = [:order_id, :job_cd, :amount]
82
+ assert_required_options(required, options)
83
+ post_request name, options
84
+ end
85
+
86
+ # 【銀行振込(バーチャル口座 あおぞら)】
87
+ # 取引登録
88
+ # オーダーIDを指定して取引を登録します。
89
+ def entry_tran_ganb(options = {})
90
+ name = "EntryTranGANB.idPass"
91
+ required = [:order_id, :amount]
92
+ assert_required_options(required, options)
93
+ post_request name, options
94
+ end
95
+
76
96
  # 【LINE Pay決済】
77
97
  # 20.1.2.1. 取引登録
78
98
  # これ以降の決済取引で必要となる取引IDと取引パスワードの発行を行い、取引を開始します。
@@ -322,6 +342,26 @@ module GMO
322
342
  post_request name, options
323
343
  end
324
344
 
345
+ # 【PayPal決済】
346
+ # 決済実行
347
+ # PayPalと通信を行い決済要求結果を返します。
348
+ def exec_tran_paypal(options = {})
349
+ name = "ExecTranPaypal.idPass"
350
+ required = [:access_id, :access_pass, :order_id, :item_name, :redirect_url]
351
+ assert_required_options(required, options)
352
+ post_request name, options
353
+ end
354
+
355
+ # 【銀行振込(バーチャル口座 あおぞら)】
356
+ # 決済実行
357
+ # 登録された取引に対してバーチャル口座を発行します。
358
+ def exec_tran_ganb(options = {})
359
+ name = "ExecTranGANB.idPass"
360
+ required = [:access_id, :access_pass, :order_id]
361
+ assert_required_options(required, options)
362
+ post_request name, options
363
+ end
364
+
325
365
  # 【LINE Pay決済】
326
366
  # 20.1.2.2. 決済実行
327
367
  def exec_tran_linepay(options = {})
data/lib/gmo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module GMO
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.7"
3
3
  end
data/lib/gmo.rb CHANGED
@@ -38,9 +38,16 @@ module GMO
38
38
  raise GMO::Payment::ServerError.new(result.body, error_detail)
39
39
  end
40
40
  # Transform the body to Hash
41
- # "ACS=1&ACSUrl=url" => { "ACS" => "1", ACSUrl => "url" }
42
- key_values = result.body.to_s.split('&').map { |str| str.split('=', 2) }.flatten
43
- response = Hash[*key_values]
41
+ if /\.json\Z/ =~ path
42
+ # Parse the body as JSON
43
+ parsed_result = ::JSON.parse(result.body)
44
+ response = parsed_result.is_a?(Array) ? parsed_result[0] : parsed_result
45
+ else
46
+ # Parse the body as Query string
47
+ # "ACS=1&ACSUrl=url" => { "ACS" => "1", ACSUrl => "url" }
48
+ key_values = result.body.to_s.split('&').map { |str| str.split('=', 2) }.flatten
49
+ response = Hash[*key_values]
50
+ end
44
51
  # converting to UTF-8
45
52
  body = response = Hash[response.map { |k,v| [k, NKF.nkf('-S -w',v)] }]
46
53
  # Check for errors if provided a error_checking_block
@@ -376,54 +376,76 @@ describe "GMO::Payment::RemittanceAPI" do
376
376
  end
377
377
 
378
378
  describe "#create_mail_deposit" do
379
- let(:do_api_call) {
380
- @service.create_mail_deposit({
381
- :deposit_id => "dep00001",
382
- :deposit_email => "anyutzy@demo.com",
383
- :amount => 1000,
384
- :deposit_account_name => "An Yutzy",
385
- :expire => 5,
386
- :deposit_shop_email => "anyutzy@demo.com"
387
- })
388
- }
379
+ subject(:do_api_call) { @service.create_mail_deposit(options) }
380
+
381
+ context 'with valid options', :vcr do
382
+ let(:options) do
383
+ {
384
+ :deposit_id => "dep00001",
385
+ :deposit_email => "anyutzy@demo.com",
386
+ :amount => 1000,
387
+ :deposit_account_name => "An Yutzy",
388
+ :expire => 5,
389
+ :deposit_shop_email => "anyutzy@demo.com",
390
+ :auth_code => "auth00001",
391
+ :auth_code_2 => "auth00002",
392
+ :auth_code_3 => "auth00003",
393
+ :remit_method_bank => "1",
394
+ :mail_template_free_1 => "mail_template_free_1",
395
+ :mail_template_free_2 => "mail_template_free_2",
396
+ :mail_template_free_3 => "mail_template_free_3",
397
+ :mail_template_number => 1,
398
+ :bank_id => "bank_id00001",
399
+ :select_key => "select00001",
400
+ :client_name => "イライニンタロウ",
401
+ }
402
+ end
389
403
 
390
- it "gets data about a mail deposit", :vcr do
391
- result = do_api_call
392
- result["Deposit_ID"].nil?.should_not be_truthy
393
- result["Method"].nil?.should_not be_truthy
394
- result["Amount"].nil?.should_not be_truthy
395
- result["Expire"].nil?.should_not be_truthy
396
- end
404
+ before { allow(GMO).to receive(:make_request).and_call_original }
397
405
 
398
- context 'with all required options' do
399
- let(:response) { OpenStruct.new(status: 200, body: nil ) }
400
- before { allow(GMO).to receive(:make_request) { response } }
406
+ it "gets data about a mail deposit" do
407
+ result = do_api_call
408
+ expect(result["Deposit_ID"]).to eq options[:deposit_id]
409
+ expect(result["Method"]).to eq "1"
410
+ expect(result["Amount"]).to eq options[:amount].to_s
411
+ expect(result["Expire"]).not_to be_nil
412
+ end
401
413
 
402
- it "makes request with correct parameters", :vcr do
414
+ it "makes request with correct parameters" do
415
+ do_api_call
403
416
  path = "/api/MailDepositRegistration.idPass"
404
417
  args = {
405
- "Deposit_ID" => "dep00001",
406
- "Mail_Address" => "anyutzy@demo.com",
407
- "Amount" => 1000,
408
- "Mail_Deposit_Account_Name" => "An Yutzy",
409
- "Expire" => 5,
410
- "Shop_Mail_Address" => "anyutzy@demo.com",
418
+ "Deposit_ID" => options[:deposit_id],
419
+ "Mail_Address" => options[:deposit_email],
420
+ "Amount" => options[:amount],
421
+ "Mail_Deposit_Account_Name" => options[:deposit_account_name],
422
+ "Expire" => options[:expire],
423
+ "Shop_Mail_Address" => options[:deposit_shop_email],
424
+ "Auth_Code" => options[:auth_code],
425
+ "Auth_Code2" => options[:auth_code_2],
426
+ "Auth_Code3" => options[:auth_code_3],
427
+ "Remit_Method_Bank" => options[:remit_method_bank],
428
+ "Mail_Template_Free1" => options[:mail_template_free_1],
429
+ "Mail_Template_Free2" => options[:mail_template_free_2],
430
+ "Mail_Template_Free3" => options[:mail_template_free_3],
431
+ "Mail_Template_Number" => options[:mail_template_number],
432
+ "Bank_ID" => options[:bank_id],
433
+ "Select_Key" => options[:select_key],
434
+ "Client_Name" => options[:client_name],
411
435
  "Method" => 1,
412
436
  "Shop_ID" => @service.shop_id,
413
437
  "Shop_Pass" => @service.shop_pass
414
438
  }
415
- verb = "post"
416
- options = { :host => @service.host }
417
- expect(GMO).to receive(:make_request).with(path, args, verb, options)
439
+ expect(GMO).to have_received(:make_request).with(path, args, "post", { :host => @service.host })
418
440
  end
419
-
420
- after { do_api_call }
421
441
  end
422
442
 
423
- it "got error if missing options", :vcr do
424
- lambda {
425
- result = @service.create_mail_deposit()
426
- }.should raise_error("Required deposit_id, deposit_email, amount, deposit_account_name, expire, deposit_shop_email were not provided.")
443
+ context "with invalid options" do
444
+ let(:options) { {} }
445
+
446
+ it "got error" do
447
+ expect { do_api_call }.to raise_error("Required deposit_id, deposit_email, amount, expire, deposit_shop_email were not provided.")
448
+ end
427
449
  end
428
450
  end
429
451
 
@@ -503,4 +525,69 @@ describe "GMO::Payment::RemittanceAPI" do
503
525
  end
504
526
  end
505
527
 
528
+ describe "#create_link_redirect_url" do
529
+ subject(:do_api_call) { @service.create_link_redirect_url(options) }
530
+
531
+ context 'with valid options', :vcr do
532
+ let(:deposit_id) { "dep00001" }
533
+ let(:options) do
534
+ {
535
+ deposit_id: deposit_id,
536
+ call_back_url: "https://example.com/callback",
537
+ amount: "1000",
538
+ auth_code: "auth00005",
539
+ auth_code_2: "auth00002",
540
+ auth_code_3: "auth00003",
541
+ remit_method_bank: "1",
542
+ remit_method_sevenatm: "1",
543
+ sevenatm_payment_term_day: "15",
544
+ remit_method_amazongift: "1",
545
+ remit_method_aupay: "1",
546
+ bank_id: "bank_id00001",
547
+ client_name: "リンクユーアールエル",
548
+ }
549
+ end
550
+
551
+ it "gets data about link redirect url" do
552
+ result = do_api_call
553
+ expect(result["Deposit_ID"]).to eq(deposit_id)
554
+ expect(result["Redirect_Url"]).not_to be_nil
555
+ expect(result["Method"]).to eq("1")
556
+ end
557
+ end
558
+
559
+ context "with invalid options", :vcr do
560
+ let(:options) { {} }
561
+
562
+ it "got error" do
563
+ expect { do_api_call }.to raise_error("Required deposit_id, call_back_url, amount, auth_code were not provided.")
564
+ end
565
+ end
566
+ end
567
+
568
+ describe "#cancel_link_redirect_url" do
569
+ subject (:do_api_call) { @service.cancel_link_redirect_url(options) }
570
+
571
+ before { @service.create_link_redirect_url(deposit_id: deposit_id, call_back_url: 'https://example.com/callback', amount: '100', auth_code: 'AUTH001') }
572
+
573
+ context 'with valid options', :vcr do
574
+ let(:options) { { deposit_id: deposit_id } }
575
+ let(:deposit_id) { "dep00001" }
576
+
577
+ it "gets data about a link edirect url" do
578
+ result = do_api_call
579
+ expect(result["Deposit_ID"]).not_to be_nil
580
+ expect(result["Method"]).to eq "2"
581
+ end
582
+ end
583
+
584
+ context "with invalid options", :vcr do
585
+ let(:options) { {} }
586
+ let(:deposit_id) { "dep00001" }
587
+
588
+ it "got error" do
589
+ expect { do_api_call }.to raise_error("Required deposit_id were not provided.")
590
+ end
591
+ end
592
+ end
506
593
  end
@@ -98,6 +98,44 @@ describe "GMO::Payment::ShopAPI" do
98
98
  end
99
99
  end
100
100
 
101
+ describe "#entry_tran_paypal" do
102
+ it "gets data about a transaction", :vcr do
103
+ order_id = @order_id
104
+ result = @service.entry_tran_paypal({
105
+ :order_id => order_id,
106
+ :job_cd => 'CAPTURE',
107
+ :amount => 100
108
+ })
109
+ result["AccessID"].nil?.should_not be_truthy
110
+ result["AccessPass"].nil?.should_not be_truthy
111
+ end
112
+
113
+ it "got error if missing options", :vcr do
114
+ lambda {
115
+ result = @service.entry_tran_paypal()
116
+ }.should raise_error("Required order_id, job_cd, amount were not provided.")
117
+ end
118
+ end
119
+
120
+ describe "#entry_tran_ganb" do
121
+ it "gets data about a transaction", :vcr do
122
+ order_id = @order_id
123
+ result = @service.entry_tran_ganb({
124
+ :order_id => order_id,
125
+ :amount => 100
126
+ })
127
+ result["AccessID"].nil?.should_not be_truthy
128
+ result["AccessPass"].nil?.should_not be_truthy
129
+ end
130
+
131
+ it "got error if missing options", :vcr do
132
+ lambda {
133
+ result = @service.entry_tran_ganb()
134
+ }.should raise_error("Required order_id, amount were not provided.")
135
+ end
136
+ end
137
+
138
+
101
139
  describe "#entry_tran_linepay" do
102
140
  it "gets data about a transaction", :vcr do
103
141
  order_id = @order_id
@@ -429,6 +467,72 @@ describe "GMO::Payment::ShopAPI" do
429
467
  end
430
468
  end
431
469
 
470
+ describe "#exec_tran_paypal" do
471
+ it "gets data about a transaction", :vcr do
472
+ order_id = generate_id
473
+ result = @service.entry_tran_paypal({
474
+ :order_id => order_id,
475
+ :job_cd => 'CAPTURE',
476
+ :amount => 100
477
+ })
478
+ access_id = result["AccessID"]
479
+ access_pass = result["AccessPass"]
480
+ result = @service.exec_tran_paypal({
481
+ :order_id => order_id,
482
+ :access_id => access_id,
483
+ :access_pass => access_pass,
484
+ :redirect_url => 'https://example.com/path/to/redirect',
485
+ :item_name => '購入する商品名'
486
+ })
487
+ result["OrderID"].nil?.should_not be_truthy
488
+ end
489
+
490
+ it "got error if missing options", :vcr do
491
+ lambda {
492
+ result = @service.exec_tran_paypal()
493
+ }.should raise_error("Required access_id, access_pass, order_id, item_name, redirect_url were not provided.")
494
+ end
495
+ end
496
+
497
+ describe "#exec_tran_ganb" do
498
+ it "gets data about a transaction", :vcr do
499
+ order_id = generate_id
500
+ result = @service.entry_tran_ganb({
501
+ :order_id => order_id,
502
+ :amount => 100
503
+ })
504
+ access_id = result["AccessID"]
505
+ access_pass = result["AccessPass"]
506
+ result = @service.exec_tran_ganb({
507
+ :order_id => order_id,
508
+ :access_id => access_id,
509
+ :access_pass => access_pass,
510
+ :client_field_1 => '加盟店自由項目1です。',
511
+ :client_field_2 => '加盟店自由項目2です。',
512
+ :client_field_3 => '加盟店自由項目3です。',
513
+ :account_holder_optional_name => 'コウザタロウ',
514
+ :trade_days => '3',
515
+ :trade_reason => '取引事由です。',
516
+ :trade_client_name => '依頼花子',
517
+ :trade_client_mailaddress => 'irai@example.com'
518
+ })
519
+ result["BankCode"].nil?.should_not be_truthy
520
+ result["BankName"].nil?.should_not be_truthy
521
+ result["BranchCode"].nil?.should_not be_truthy
522
+ result["BranchName"].nil?.should_not be_truthy
523
+ result["AccountType"].nil?.should_not be_truthy
524
+ result["AccountNumber"].nil?.should_not be_truthy
525
+ result["AccountHolderName"].nil?.should_not be_truthy
526
+ result["AvailableDate"].nil?.should_not be_truthy
527
+ end
528
+
529
+ it "got error if missing options", :vcr do
530
+ lambda {
531
+ result = @service.exec_tran_ganb()
532
+ }.should raise_error("Required access_id, access_pass, order_id were not provided.")
533
+ end
534
+ end
535
+
432
536
  describe "#exec_tran_linepay" do
433
537
  it "gets data about a transaction", :vcr do
434
538
  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.5
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tatsuo Kaniwa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-03 00:00:00.000000000 Z
11
+ date: 2024-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: nkf
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rspec
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -112,10 +126,14 @@ files:
112
126
  - Rakefile
113
127
  - autotest/discover.rb
114
128
  - fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_cancel_deposit_gets_data_about_a_deposit.yml
129
+ - fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_cancel_link_redirect_url_with_invalid_options_got_error.yml
130
+ - fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_cancel_link_redirect_url_with_valid_options_gets_data_about_a_link_edirect_url.yml
115
131
  - fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_cancel_mail_deposit_gets_data_about_a_mail_deposit.yml
116
132
  - fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_create_account_gets_data_about_an_account.yml
117
133
  - fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_create_deposit_gets_data_about_a_deposit.yml
118
- - fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_create_mail_deposit_gets_data_about_a_mail_deposit.yml
134
+ - fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_create_link_redirect_url_with_valid_options_gets_data_about_link_redirect_url.yml
135
+ - fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_create_mail_deposit_with_valid_options_gets_data_about_a_mail_deposit.yml
136
+ - fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_create_mail_deposit_with_valid_options_makes_request_with_correct_parameters.yml
119
137
  - fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_delete_account_gets_data_about_an_account.yml
120
138
  - fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_search_account_gets_data_about_an_account.yml
121
139
  - fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_search_balance_gets_data_about_balance.yml
@@ -134,10 +152,12 @@ files:
134
152
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_cvs_got_error_if_missing_options.yml
135
153
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_docomo_gets_data_about_a_transaction.yml
136
154
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_edy_gets_data_about_a_transaction.yml
155
+ - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_ganb_gets_data_about_a_transaction.yml
137
156
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_gets_data_about_a_transaction.yml
138
157
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_got_error_if_missing_options.yml
139
158
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_linepay_gets_data_about_a_transaction.yml
140
159
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_pay_easy_gets_data_about_a_transaction.yml
160
+ - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_paypal_gets_data_about_a_transaction.yml
141
161
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_rakuten_id_gets_data_about_a_transaction.yml
142
162
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_suica_gets_data_about_a_transaction.yml
143
163
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_virtualaccount_gets_data_about_a_transaction.yml
@@ -147,11 +167,13 @@ files:
147
167
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_docomo_gets_data_about_a_transaction.yml
148
168
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_doesn_t_require_card_info_if_token_is_present.yml
149
169
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_edy_gets_data_about_a_transaction.yml
170
+ - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_ganb_gets_data_about_a_transaction.yml
150
171
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_gets_data_about_a_transaction.yml
151
172
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_got_error_if_missing_options.yml
152
173
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_linepay_gets_data_about_a_transaction.yml
153
174
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_parameter_contains_Japanese_characters_should_correctly_handle_Japanese.yml
154
175
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_pay_easy_gets_data_about_a_transaction.yml
176
+ - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_paypal_gets_data_about_a_transaction.yml
155
177
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_rakuten_id_gets_data_about_a_transaction.yml
156
178
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_suica_gets_data_about_a_transaction.yml
157
179
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_virtualaccount_gets_data_about_a_transaction.yml
@@ -1,38 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://<REMITTANCE_HOST>/api/MailDepositRegistration.idPass
6
- body:
7
- encoding: Windows-31J
8
- string: Deposit_ID=dep0000<SHOP_PASS>&Mail_Address=anyutzy%40demo.com&Amount=<SHOP_PASS>000&Mail_Deposit_Account_Name=An+Yutzy&Expire=5&Shop_Mail_Address=anyutzy%40demo.com&Method=<SHOP_PASS>&Shop_ID=<REMITTANCE_SHOP_ID>&Shop_Pass=<REMITTANCE_SHOP_PASS>
9
- headers:
10
- Accept-Encoding:
11
- - gzip;q=<SHOP_PASS>.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
- - Mon, 0<SHOP_PASS> May 20<SHOP_PASS>7 05:58:27 GMT
25
- Content-Type:
26
- - text/plain;charset=Windows-3<SHOP_PASS>J
27
- Transfer-Encoding:
28
- - chunked
29
- Connection:
30
- - close
31
- X-Frame-Options:
32
- - SAMEORIGIN
33
- body:
34
- encoding: Windows-31J
35
- string: Deposit_ID=dep00001&Method=1&Amount=1000&Expire=20170503
36
- http_version:
37
- recorded_at: Mon, 01 May 2017 05:58:27 GMT
38
- recorded_with: VCR 3.0.3