gmo 0.5.2 → 0.5.4

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/.travis.yml +0 -3
  3. data/CHANGELOG.md +9 -0
  4. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_search_mail_deposit_gets_data_about_a_mail_deposit.yml +1 -1
  5. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_edy_gets_data_about_a_transaction.yml +35 -0
  6. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_suica_gets_data_about_a_transaction.yml +35 -0
  7. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_virtualaccount_gets_data_about_a_transaction.yml +35 -0
  8. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_edy_gets_data_about_a_transaction.yml +67 -0
  9. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_suica_gets_data_about_a_transaction.yml +67 -0
  10. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_virtualaccount_gets_data_about_a_transaction.yml +68 -0
  11. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_secure_tran_gets_data_about_a_transaction.yml +36 -0
  12. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/secure_tran_request_params.yml +2 -0
  13. data/fixtures/vcr_cassettes/GMO_Payment_ShopAndSiteAPI/_register_recurring_credit_got_data.yml +36 -0
  14. data/fixtures/vcr_cassettes/GMO_Payment_ShopAndSiteAPI/_unregister_recurring_success_unregister.yml +69 -0
  15. data/lib/gmo/const.rb +19 -1
  16. data/lib/gmo/shop_and_site_api.rb +90 -0
  17. data/lib/gmo/shop_api.rb +98 -0
  18. data/lib/gmo/version.rb +1 -1
  19. data/lib/gmo.rb +4 -2
  20. data/spec/gmo/remittance_api_spec.rb +1 -1
  21. data/spec/gmo/shop_and_site_api_spec.rb +24 -0
  22. data/spec/gmo/shop_api_spec.rb +178 -0
  23. metadata +16 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eaa71623e6e73094b9ca7c3855b7d691d9afd1f66b7ffd1131748f9185d73419
4
- data.tar.gz: fa66755179642177d794da8f41cb82445a1666aeab49a5d4e2b946dcfe807044
3
+ metadata.gz: a382627bdae7005db8cdb14727ad253739950a9b5134392dbcff019c3f85af80
4
+ data.tar.gz: b090836a299173cbd347378c3c7ddc09d460f93228e85d77a49913ad29c2efdf
5
5
  SHA512:
6
- metadata.gz: e64017b8bb1f8499741273c014d804c15e480bac887d334dab6739c482a7b93ed2a8236928b6b4f1b2de0ed5c871df4b69e2d596f20edb671c85670359af6897
7
- data.tar.gz: eff2c76d2515c0d106dc514119341b78b94cfc08e0318372c096a9b94c6a1057780159594a55d8060fbe98eaa7499488a1ed75d57354f61d6ee7a34f8774d834
6
+ metadata.gz: 9259cbed99b87ec9f436cd5e8675ef53597bf63291430f7e9456cf6d201f3f7dd9573061314e2495f1c6a9a737e49941df4150db650856f8c38c7c6b528c4d7d
7
+ data.tar.gz: 94b6ffeace738a1283b1be9674ca3366fe6fd99a5c03a0c5a4920fcf66311ead68f0c923a1eed806033094130c1e219ef14ce31768e62d7c082f612e42eaf4aa
data/.travis.yml CHANGED
@@ -1,8 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - ruby-head
4
- - 1.8.7
5
- - 2.0
6
4
  - 2.1
7
5
  - 2.2
8
6
  - 2.3
@@ -21,4 +19,3 @@ matrix:
21
19
  - rvm: jruby-18mode
22
20
  - rvm: jruby-19mode
23
21
  - rvm: jruby-head
24
- - rvm: 1.8.7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.5.4
4
+ * Support 銀行振込(バーチャル口座)決済, モバイルSuica, 楽天Edy決済 [#53](https://github.com/t-k/gmo-payment-ruby/pull/53) (Thanks [@valda](https://github.com/valda))
5
+ * Support 継続課金 [#31](https://github.com/t-k/gmo-payment-ruby/pull/31) (Thanks [@yalab](https://github.com/yalab))
6
+
7
+ ## 0.5.3
8
+ * Support 認証後決済実行 [#45](https://github.com/t-k/gmo-payment-ruby/pull/45) (Thanks [@darren987469](https://github.com/darren987469))
9
+ * Support SearchType of INPUT_PARAMS [#47](https://github.com/t-k/gmo-payment-ruby/pull/47) (Thanks [@nkuroda](https://github.com/nkuroda))
10
+ * Drop ruby 2.0.0 [#48](https://github.com/t-k/gmo-payment-ruby/pull/48)
11
+
3
12
  ## 0.5.2
4
13
  * Support d払い/ドコモ払い(docomo payment), 楽天ペイ(Rakuten payment) [#42](https://github.com/t-k/gmo-payment-ruby/pull/42) (Thanks [@valda](https://github.com/valda))
5
14
  * Add more G-series error codes [#41](https://github.com/t-k/gmo-payment-ruby/pull/41) (Thanks [@ermaac](https://github.com/ermaac))
@@ -32,7 +32,7 @@ http_interactions:
32
32
  - SAMEORIGIN
33
33
  body:
34
34
  encoding: UTF-8
35
- string: Deposit_ID=dep00001&Mail_Address=anyutzy@demo.com&Shop_Mail_Address=anyutzy@demo.com&Account_Name=An Yutzy&Amount=1000&Expire=20170503&Status=0
35
+ string: Deposit_ID=dep00001&Mail_Address=anyutzy+test@demo.com&Shop_Mail_Address=anyutzy@demo.com&Account_Name=An Yutzy&Amount=1000&Expire=20170503&Status=0
36
36
  http_version:
37
37
  recorded_at: Mon, 01 May 2017 05:58:30 GMT
38
38
  recorded_with: VCR 3.0.3
@@ -0,0 +1,35 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<HOST>/payment/EntryTranEdy.idPass
6
+ body:
7
+ encoding: UTF-8
8
+ string: OrderID=<TOKEN>662969828&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
+ - Mon, <TOKEN>2 Sep 2022 08:03:49 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=63bff23f2cb9bfc9c528fd82f03<TOKEN>d04e&AccessPass=509ced83bb0acd48c958f3baff94452<TOKEN>
34
+ recorded_at: Mon, 12 Sep 2022 08:03:49 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/EntryTranSuica.idPass
6
+ body:
7
+ encoding: UTF-8
8
+ string: OrderID=<TOKEN>662969828&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
+ - Mon, <TOKEN>2 Sep 2022 08:03:48 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=63bff23f2cb9bfc9c528fd82f03<TOKEN>d04e&AccessPass=4737074<TOKEN>2<TOKEN>9075004e2a4f74fbca48db
34
+ recorded_at: Mon, 12 Sep 2022 08:03:48 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/EntryTranVirtualaccount.idPass
6
+ body:
7
+ encoding: UTF-8
8
+ string: OrderID=<TOKEN>66262<TOKEN>284&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
+ - Thu, 08 Sep 2022 07:<TOKEN>4:44 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>66262<TOKEN>284&AccessID=672560ef8bfede4aece2bdd43a66dd59&AccessPass=b436e6b362b89c622<TOKEN>f266be<TOKEN>43<TOKEN>b290
34
+ recorded_at: Thu, 08 Sep 2022 07:14:44 GMT
35
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,67 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<HOST>/payment/EntryTranEdy.idPass
6
+ body:
7
+ encoding: UTF-8
8
+ string: OrderID=<TOKEN>662970040&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
+ - Mon, <TOKEN>2 Sep 2022 08:07:20 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=<TOKEN>e85e402df4ae23036f6de940c4eb2d7&AccessPass=<TOKEN>6440b8df892<TOKEN>f<TOKEN>0a2dba3<TOKEN>cb2<TOKEN>03805
34
+ recorded_at: Mon, 12 Sep 2022 08:07:20 GMT
35
+ - request:
36
+ method: post
37
+ uri: https://<HOST>/payment/ExecTranEdy.idPass
38
+ body:
39
+ encoding: UTF-8
40
+ string: OrderID=<TOKEN>662970040&AccessID=<TOKEN>e85e402df4ae23036f6de940c4eb2d7&AccessPass=<TOKEN>6440b8df892<TOKEN>f<TOKEN>0a2dba3<TOKEN>cb2<TOKEN>03805&MailAddress=test%40example.com&ClientField<TOKEN>=client_field<TOKEN>&ClientFieldFlag=<TOKEN>&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
+ - Mon, <TOKEN>2 Sep 2022 08:07:23 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: OrderID=<TOKEN>662970040&ReceiptNo=EDY<TOKEN>662970042705&EdyOrderNo=<TOKEN>662970040-2209<TOKEN>204852<TOKEN>&PaymentTerm=20220922<TOKEN>70722&TranDate=202209<TOKEN>2<TOKEN>70722&CheckString=8db002858a8d3b8<TOKEN>eaf4b3<TOKEN>e7a2c<TOKEN>d20&ClientField<TOKEN>=client_field<TOKEN>&ClientField2=&ClientField3=
66
+ recorded_at: Mon, 12 Sep 2022 08:07:23 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/EntryTranSuica.idPass
6
+ body:
7
+ encoding: UTF-8
8
+ string: OrderID=<TOKEN>662969936&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
+ - Mon, <TOKEN>2 Sep 2022 08:05:37 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=288a3a<TOKEN>5032a<TOKEN>25e723dad49<TOKEN>5d3b28a&AccessPass=d2dea7b2b94eab5ab3bddcfbd9cf58bc
34
+ recorded_at: Mon, 12 Sep 2022 08:05:37 GMT
35
+ - request:
36
+ method: post
37
+ uri: https://<HOST>/payment/ExecTranSuica.idPass
38
+ body:
39
+ encoding: UTF-8
40
+ string: OrderID=<TOKEN>662969936&AccessID=288a3a<TOKEN>5032a<TOKEN>25e723dad49<TOKEN>5d3b28a&AccessPass=d2dea7b2b94eab5ab3bddcfbd9cf58bc&ItemName=%8Dw%93%FC%82%B7%82%E9%8F%A4%95i%96%BC&MailAddress=test%40example.com&ClientField<TOKEN>=client_field<TOKEN>&ClientFieldFlag=<TOKEN>&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
+ - Mon, <TOKEN>2 Sep 2022 08:05:39 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: OrderID=<TOKEN>662969936&SuicaOrderNo=<TOKEN>662969936-2209<TOKEN>2052836&ReceiptNo=SCA93925<TOKEN>&PaymentTerm=20220922<TOKEN>70637&TranDate=202209<TOKEN>2<TOKEN>70539&CheckString=d<TOKEN>fca947cffe2aa892<TOKEN>7f3fcbb403d02&ClientField<TOKEN>=client_field<TOKEN>&ClientField2=&ClientField3=
66
+ recorded_at: Mon, 12 Sep 2022 08:05:39 GMT
67
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,68 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<HOST>/payment/EntryTranVirtualaccount.idPass
6
+ body:
7
+ encoding: UTF-8
8
+ string: OrderID=<TOKEN>66262<TOKEN>552&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
+ - Thu, 08 Sep 2022 07:<TOKEN>9:<TOKEN>3 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>66262<TOKEN>552&AccessID=dda76d2bb678f82<TOKEN>ad3e4a7ded59d5b0&AccessPass=fdeccc446bb3320f48259062055ad926
34
+ recorded_at: Thu, 08 Sep 2022 07:19:13 GMT
35
+ - request:
36
+ method: post
37
+ uri: https://<HOST>/payment/ExecTranVirtualaccount.idPass
38
+ body:
39
+ encoding: UTF-8
40
+ string: OrderID=<TOKEN>66262<TOKEN>552&AccessID=dda76d2bb678f82<TOKEN>ad3e4a7ded59d5b0&AccessPass=fdeccc446bb3320f48259062055ad926&TradeDays=<TOKEN>4&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
+ - Thu, 08 Sep 2022 07:<TOKEN>9:<TOKEN>3 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: ASCII-8BIT
65
+ string: !binary |-
66
+ QWNjZXNzSUQ9ZGRhNzZkMmJiNjc4ZjgyPFRPS0VOPmFkM2U0YTdkZWQ1OWQ1YjAmQmFua0NvZGU9OTk5OCZCYW5rTmFtZT2DZYNYg2eL4o1zJkJyYW5jaENvZGU9OTk5JkJyYW5jaE5hbWU9g2WDWINnjniTWCZBY2NvdW50VHlwZT08VE9LRU4+JkFjY291bnROdW1iZXI9PFRPS0VOPjAyOTMyOSZBdmFpbGFibGVEYXRlPTIwMjIwOTIyJlRyYWRlQ29kZT00MjY8VE9LRU4+PFRPS0VOPjM4
67
+ recorded_at: Thu, 08 Sep 2022 07:19:13 GMT
68
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,36 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<HOST>/payment/SecureTran.idPass
6
+ body:
7
+ encoding: UTF-8
8
+ string: PaRes=eJydVluTokoSfvdXdPR5NGa4ycUJ2o0CSgRBuQu%2BIXfkooKA%2FvqFdk5Px4mN2I0lAq36yPwyKzM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T%2FJhwuogfIC0hLLBluezVOkXTxlliYRYdaxkB46rteNHR8c833gxuUBY7bKxUs7mT4ftXP%2B4De4%0D%0AHBOwQ<SITE_PASS><SITE_PASS>KL%2BFpE8W0PrX3f%2FbuF%2FLq68hXr%2F9zCnxeQT%2FvzdOt6ft9%2Bt%2FDNsF7%0D%0A&MD=a6ae35ca097e266b<SITE_PASS><SITE_PASS>e<SITE_PASS>8024f000034d&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=<SITE_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<SITE_PASS> Mar 202<SITE_PASS> 0<SITE_PASS>:24:44 GMT
25
+ Content-Type:
26
+ - text/plain;charset=windows-3<SITE_PASS>j
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - close
31
+ body:
32
+ encoding: UTF-8
33
+ string: OrderID=Darren-test-202<SITE_PASS>030<SITE_PASS><SITE_PASS>022<SITE_PASS>8&Forward=2a99662&Method=<SITE_PASS>&PayTimes=&Approve=
34
+ 004536&TranID=2<SITE_PASS>030<SITE_PASS><SITE_PASS>003<SITE_PASS><SITE_PASS><SITE_PASS><SITE_PASS><SITE_PASS><SITE_PASS><SITE_PASS><SITE_PASS><SITE_PASS><SITE_PASS><SITE_PASS><SITE_PASS>8<SITE_PASS>075<SITE_PASS>&TranDate=202<SITE_PASS>030<SITE_PASS><SITE_PASS>02444&CheckString=54686df6bad0b4ca3366024c7806ff66
35
+ recorded_at: Mon, 01 Mar 2021 01:24:44 GMT
36
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,2 @@
1
+ pa_res: "eJydVluTokoSfvdXdPR5NGa4ycUJ2o0CSgRBuQu+IXfkooKA/vqFdk5Px4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OOawsZf98UBaNtonBu7cj648Fq9zHsujCCrjchzLxnON\r\nQuU+t10oJPphxnHWrXuuF0EAy2t/huZmgbVwr5x6JuFzEE+FuTFVKArgkHBWaacH0Hj10t2U+74l\r\nNTRRTg3UDVMAuxmXnK/pOROXPTrVy3j87HmgQ6BTEmnjulx1A06JSkEcLRCfMXQY8u3JzJxOQwv6\r\nqt+Fhcf0YjGMDYeYzam9SxNNN3+0begv5NvScweD7u+tIVA01KRue5Q7Zz9HsXVrWTamVl2+VirB\r\nIrdw3mfJSV+ml5QUa4uckZmXdShan1L3KnJcsFeQWsQW7bWBBXFzcMrSgh3FyFxm7qUYxMFuuBzJ\r\nUCYdLY/nGdgtr3dPoNBuIRszyTQKfrho5w1cBs9ec7eL/D4X5FyqzPBZSeG6jGLtuD/OH+qNS+gH\r\noT/JhwuogfIC0hLLBluezVOkXTxlliYRYdaxkB46rteNHR8c833gxuUBY7bKxUs7mT4ftXP+4De4\r\nHBOwQ11KL+FpE8W0PrX3f/buF/Lq68hXr/9zCnxeQT/vzdOt6ft9+t/DNsF7\r\n"
2
+ md: "a6ae35ca097e266b11e18024f000034d"
@@ -0,0 +1,36 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<HOST>/payment/RegisterRecurringCredit.idPass
6
+ body:
7
+ encoding: UTF-8
8
+ string: RecurringID=<TOKEN>53596492<TOKEN>&Amount=<TOKEN>00&ChargeDay=3<TOKEN>&RegistType=<TOKEN>&MemberID=smama_development_user_<TOKEN>&SiteID=<SITE_ID>&SitePass=<SITE_PASS>&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
+ - Mon, 03 Sep 20<TOKEN>8 08:55:2<TOKEN> 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: ShopID=<SHOP_ID>&RecurringID=<TOKEN>53596492<TOKEN>&Amount=<TOKEN>00&Tax=0&ChargeDay=3<TOKEN>&ChargeMonth=0<TOKEN>|02|03|04|05|06|07|08|09|<TOKEN>0|<TOKEN><TOKEN>|<TOKEN>2&ChargeStartDate=20<TOKEN>80904&ChargeStopDate=&NextChargeDate=20<TOKEN>80930&Method=RECURRING_CREDIT&CardNo=&Expire=&SiteID=<SITE_ID>&MemberID=smama_development_user_<TOKEN>
34
+ http_version:
35
+ recorded_at: Mon, 03 Sep 2018 08:55:22 GMT
36
+ recorded_with: VCR 4.0.0
@@ -0,0 +1,69 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<HOST>/payment/RegisterRecurringCredit.idPass
6
+ body:
7
+ encoding: UTF-8
8
+ string: RecurringID=<TOKEN>536039393&Amount=<TOKEN>00&ChargeDay=3<TOKEN>&RegistType=<TOKEN>&MemberID=smama_development_user_<TOKEN>&SiteID=<SITE_ID>&SitePass=<SITE_PASS>&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, 04 Sep 20<TOKEN>8 05:36:34 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: ShopID=<SHOP_ID>&RecurringID=<TOKEN>536039393&Amount=<TOKEN>00&Tax=0&ChargeDay=3<TOKEN>&ChargeMonth=0<TOKEN>|02|03|04|05|06|07|08|09|<TOKEN>0|<TOKEN><TOKEN>|<TOKEN>2&ChargeStartDate=20<TOKEN>80905&ChargeStopDate=&NextChargeDate=20<TOKEN>80930&Method=RECURRING_CREDIT&CardNo=&Expire=&SiteID=<SITE_ID>&MemberID=smama_development_user_<TOKEN>
34
+ http_version:
35
+ recorded_at: Tue, 04 Sep 2018 05:36:34 GMT
36
+ - request:
37
+ method: post
38
+ uri: https://<HOST>/payment/UnregisterRecurring.idPass
39
+ body:
40
+ encoding: UTF-8
41
+ string: RecurringID=<TOKEN>536039393&SiteID=<SITE_ID>&SitePass=<SITE_PASS>&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>
42
+ headers:
43
+ Accept-Encoding:
44
+ - gzip;q=<TOKEN>.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
+ - Tue, 04 Sep 20<TOKEN>8 05:36:34 GMT
58
+ Content-Type:
59
+ - text/plain;charset=Windows-3<TOKEN>J
60
+ Transfer-Encoding:
61
+ - chunked
62
+ Connection:
63
+ - close
64
+ body:
65
+ encoding: UTF-8
66
+ string: ShopID=<SHOP_ID>&RecurringID=<TOKEN>536039393&Amount=<TOKEN>00&Tax=0&ChargeDay=3<TOKEN>&ChargeMonth=0<TOKEN>|02|03|04|05|06|07|08|09|<TOKEN>0|<TOKEN><TOKEN>|<TOKEN>2&ChargeStartDate=20<TOKEN>80905&ChargeStopDate=&NextChargeDate=&Method=RECURRING_CREDIT&CardNo=&Expire=&SiteID=<SITE_ID>&MemberID=smama_development_user_<TOKEN>&PrintStr=
67
+ http_version:
68
+ recorded_at: Tue, 04 Sep 2018 05:36:34 GMT
69
+ recorded_with: VCR 4.0.0
data/lib/gmo/const.rb CHANGED
@@ -14,6 +14,12 @@ module GMO
14
14
  apple_pay: 'APay'
15
15
  }.freeze
16
16
 
17
+ RECURRING_REGIST_TYPE = {
18
+ member_id: '1',
19
+ card_number: '2',
20
+ order_id: '3'
21
+ }
22
+
17
23
  INPUT_PARAMS = {
18
24
  :access_id => "AccessID",
19
25
  :access_pass => "AccessPass",
@@ -38,6 +44,10 @@ module GMO
38
44
  :card_no => "CardNo",
39
45
  :card_pass => "CardPass",
40
46
  :card_seq => "CardSeq",
47
+ :charge_day => "ChargeDay",
48
+ :charge_month => "ChargeMonth",
49
+ :charge_start_date => "ChargeStartDate",
50
+ :charge_stop_date => "ChargeStopDate",
41
51
  :client_field_1 => "ClientField1",
42
52
  :client_field_2 => "ClientField2",
43
53
  :client_field_3 => "ClientField3",
@@ -102,7 +112,9 @@ module GMO
102
112
  :receipts_disp_11 => "ReceiptsDisp11",
103
113
  :receipts_disp_12 => "ReceiptsDisp12",
104
114
  :receipts_disp_13 => "ReceiptsDisp13",
115
+ :recurring_id => "RecurringID",
105
116
  :redirect_url => "RedirectURL",
117
+ :regist_type => "RegistType",
106
118
  :register_disp_1 => "RegisterDisp1",
107
119
  :register_disp_2 => "RegisterDisp2",
108
120
  :register_disp_3 => "RegisterDisp3",
@@ -122,6 +134,7 @@ module GMO
122
134
  :shop_pass => "ShopPass",
123
135
  :site_id => "SiteID",
124
136
  :site_pass => "SitePass",
137
+ :src_order_id => "SrcOrderID",
125
138
  :suica_add_info_1 => "SuicaAddInfo1",
126
139
  :suica_add_info_2 => "SuicaAddInfo2",
127
140
  :suica_add_info_3 => "SuicaAddInfo3",
@@ -140,7 +153,12 @@ module GMO
140
153
  :delivery_place_phone => "DeliveryPlacePhone",
141
154
  :lang_cd => "LangCd",
142
155
  :user_info => "UserInfo",
143
- :package_name => "PackageName"
156
+ :package_name => "PackageName",
157
+ :search_type => "SearchType",
158
+ :trade_days => "TradeDays",
159
+ :trade_reason => "TradeReason",
160
+ :trade_client_name => "TradeClientName",
161
+ :trade_client_mail_address => "TradeClientMailAddress"
144
162
  }.freeze
145
163
 
146
164
  API_ERROR_MESSAGES_EN = {
@@ -103,6 +103,96 @@ module GMO
103
103
  post_request name, options
104
104
  end
105
105
 
106
+ ### @params ###
107
+ # ShopID
108
+ # ShopPass
109
+ # RecurringID
110
+ # Amount
111
+ # Tax
112
+ # ChargeDay
113
+ # ChargeMonth
114
+ # ChargeStartDate
115
+ # ChargeStopDate
116
+ # RegistType
117
+ # SiteID
118
+ # SitePass
119
+ # MemberID
120
+ # CardNo
121
+ # Expire
122
+ # SrcOrderID
123
+ # ClientField1
124
+ # ClientField2
125
+ # ClientField3
126
+ ### @return ###
127
+ # ShopID
128
+ # RecurringID
129
+ # Amount
130
+ # Tax
131
+ # ChargeDay
132
+ # ChargeMonth
133
+ # ChargeStartDate
134
+ # ChargeStopDate
135
+ # NextChargeDate
136
+ # Method
137
+ ### example ###
138
+ # gmo.register_recurring_credit({
139
+ # recurring_id: "1535964921",
140
+ # amount: 100,
141
+ # regist_type: GMO::Const::RECURRING_REGIST_TYPE[:member_id],
142
+ # member_id: "mem10001"
143
+ # })
144
+ # => {"ShopID"=>"tshop0001", "RecurringID"=>"1535964921", "Amount"=>"100", "Tax"=>"0", "ChargeDay"=>"31", "ChargeMonth"=>"01|02|03|04|05|06|07|08|09|10|11|12", "ChargeStartDate"=>"20180904", "ChargeStopDate"=>"", "NextChargeDate"=>"20180930", "Method"=>"RECURRING_CREDIT", "CardNo"=>"", "Expire"=>"", "SiteID"=>"", "MemberID"=>"mem1001"}
145
+ def register_recurring_credit(options = {})
146
+ name = "RegisterRecurringCredit.idPass"
147
+ required = [:recurring_id, :charge_day, :amount, :regist_type]
148
+ required += case options[:regist_type].to_i
149
+ when 1
150
+ options.update(site_id: @site_id, site_pass: @site_pass)
151
+ [:member_id]
152
+ when 2
153
+ [:card_no, :expire]
154
+ when 3
155
+ [:src_order_id]
156
+ end
157
+ assert_required_options(required, options)
158
+ post_request name, options
159
+ end
160
+
161
+ ### @params ###
162
+ # ShopID
163
+ # ShopPass
164
+ # RecurringID
165
+ ### @return ###
166
+ # ShopID
167
+ # RecurringID
168
+ # Amount
169
+ # Tax
170
+ # ChargeDay
171
+ # ChargeMonth
172
+ # ChargeStartDate
173
+ # ChargeStopDate
174
+ # NextChargeDate
175
+ # Method
176
+ # SiteID
177
+ # MemberID
178
+ # CardNo
179
+ # Expire
180
+ # PrintStr
181
+ # ErrCode
182
+ # ErrInfo
183
+ ### example ###
184
+ # gmo.unregister_recurring({
185
+ # recurring_id: "1535964921"
186
+ # })
187
+ # => {"ShopID"=>"tshop0001", "RecurringID"=>"1536039145", "Amount"=>"100", "Tax"=>"0", "ChargeDay"=>"31", "ChargeMonth"=>"01|02|03|04|05|06|07|08|09|10|11|12", "ChargeStartDate"=>"20180905", "ChargeStopDate"=>"", "NextChargeDate"=>"", "Method"=>"RECURRING_CREDIT", "CardNo"=>"", "Expire"=>"", "SiteID"=>"tsite0001", "MemberID"=>"mem1001", "PrintStr"=>""}
188
+ def unregister_recurring(options = {})
189
+ name = "UnregisterRecurring.idPass"
190
+ options.merge!(site_id: @site_id, site_pass: @site_pass)
191
+ required = [:recurring_id]
192
+ assert_required_options(required, options)
193
+ post_request name, options
194
+ end
195
+
106
196
  private
107
197
 
108
198
  def api_call(name, args = {}, verb = "post", options = {})
data/lib/gmo/shop_api.rb CHANGED
@@ -158,6 +158,69 @@ module GMO
158
158
  post_request name, options
159
159
  end
160
160
 
161
+ ### @params ###
162
+ # OrderID
163
+ # Amount
164
+ # Tax
165
+ ### @return ###
166
+ # AccessID
167
+ # AccessPass
168
+ ### example ###
169
+ # gmo.entry_tran_virtualaccount({
170
+ # order_id: "ord12345",
171
+ # tax: "0001001",
172
+ # amount: 100
173
+ # })
174
+ # => {"AccessID"=>"139f8ec33a07c55f406937c52ce4473d", "AccessPass"=>"2689b204d2c17192fa35f9269fa7e744"}
175
+ def entry_tran_virtualaccount(options = {})
176
+ name = "EntryTranVirtualaccount.idPass"
177
+ required = [:order_id, :amount]
178
+ assert_required_options(required, options)
179
+ post_request name, options
180
+ end
181
+
182
+ ### @params ###
183
+ # OrderID
184
+ # Amount
185
+ # Tax
186
+ ### @return ###
187
+ # AccessID
188
+ # AccessPass
189
+ ### example ###
190
+ # gmo.entry_tran_suica({
191
+ # order_id: "ord12345",
192
+ # tax: "0001001",
193
+ # amount: 100
194
+ # })
195
+ # => {"AccessID"=>"139f8ec33a07c55f406937c52ce4473d", "AccessPass"=>"2689b204d2c17192fa35f9269fa7e744"}
196
+ def entry_tran_suica(options = {})
197
+ name = "EntryTranSuica.idPass"
198
+ required = [:order_id, :amount]
199
+ assert_required_options(required, options)
200
+ post_request name, options
201
+ end
202
+
203
+ ### @params ###
204
+ # OrderID
205
+ # Amount
206
+ # Tax
207
+ ### @return ###
208
+ # AccessID
209
+ # AccessPass
210
+ ### example ###
211
+ # gmo.entry_tran_edy({
212
+ # order_id: "ord12345",
213
+ # tax: "0001001",
214
+ # amount: 100
215
+ # })
216
+ # => {"AccessID"=>"139f8ec33a07c55f406937c52ce4473d", "AccessPass"=>"2689b204d2c17192fa35f9269fa7e744"}
217
+ def entry_tran_edy(options = {})
218
+ name = "EntryTranEdy.idPass"
219
+ required = [:order_id, :amount]
220
+ assert_required_options(required, options)
221
+ post_request name, options
222
+ end
223
+
161
224
  ## 2.2.2.2.決済実行
162
225
  # 指定されたサイトに会員を登録します。
163
226
  # return
@@ -231,6 +294,14 @@ module GMO
231
294
  post_request name, options
232
295
  end
233
296
 
297
+ # 2.2.2.4 認証後決済実行
298
+ def secure_tran(options = {})
299
+ name = "SecureTran.idPass"
300
+ required = [:pa_res, :md]
301
+ assert_required_options(required, options)
302
+ post_request name, options
303
+ end
304
+
234
305
  # 【コンビニ払い】
235
306
  # 2.1.2.2. 決済実行
236
307
  # お客様が入力した情報で後続の決済センターと通信を行い決済を実施し、結果を返します。
@@ -278,6 +349,33 @@ module GMO
278
349
  post_request name, options
279
350
  end
280
351
 
352
+ # 【銀行振込(バーチャル口座)決済】
353
+ # 18.1.2.2. 決済実行
354
+ def exec_tran_virtualaccount(options = {})
355
+ name = "ExecTranVirtualaccount.idPass"
356
+ required = [:access_id, :access_pass, :order_id, :trade_days]
357
+ assert_required_options(required, options)
358
+ post_request name, options
359
+ end
360
+
361
+ # 【モバイルSuica決済】
362
+ # 18.1.2.2. 決済実行
363
+ def exec_tran_suica(options = {})
364
+ name = "ExecTranSuica.idPass"
365
+ required = [:access_id, :access_pass, :order_id, :item_name, :mail_address]
366
+ assert_required_options(required, options)
367
+ post_request name, options
368
+ end
369
+
370
+ # 【楽天Edy決済】
371
+ # 18.1.2.2. 決済実行
372
+ def exec_tran_edy(options = {})
373
+ name = "ExecTranEdy.idPass"
374
+ required = [:access_id, :access_pass, :order_id, :mail_address]
375
+ assert_required_options(required, options)
376
+ post_request name, options
377
+ end
378
+
281
379
  ### @params ###
282
380
  # AccessID
283
381
  # AccessPass
data/lib/gmo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module GMO
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.4"
3
3
  end
data/lib/gmo.rb CHANGED
@@ -37,8 +37,10 @@ module GMO
37
37
  }
38
38
  raise GMO::Payment::ServerError.new(result.body, error_detail)
39
39
  end
40
- # Parse the body as Query string
41
- response = Rack::Utils.parse_nested_query(result.body.to_s)
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]
42
44
  # converting to UTF-8
43
45
  body = response = Hash[response.map { |k,v| [k, NKF.nkf('-w',v)] }]
44
46
  # Check for errors if provided a error_checking_block
@@ -469,7 +469,7 @@ describe "GMO::Payment::RemittanceAPI" do
469
469
  it "gets data about a mail deposit", :vcr do
470
470
  result = do_api_call
471
471
  result["Deposit_ID"].nil?.should_not be_truthy
472
- result["Mail_Address"].nil?.should_not be_truthy
472
+ result["Mail_Address"].should eq('anyutzy+test@demo.com')
473
473
  result["Shop_Mail_Address"].nil?.should_not be_truthy
474
474
  result["Account_Name"].nil?.should_not be_truthy
475
475
  result["Amount"].nil?.should_not be_truthy
@@ -171,4 +171,28 @@ describe "GMO::Payment::ShopAndSiteAPI" do
171
171
  end
172
172
  end
173
173
 
174
+ describe "#register_recurring_credit" do
175
+ it "got data", :vcr do
176
+ recurring_id = generate_id
177
+ member_id = 'mem1001'
178
+ result = @service.register_recurring_credit({
179
+ :recurring_id => recurring_id,
180
+ :amount => 100,
181
+ :charge_day => 31,
182
+ :regist_type => GMO::Const::RECURRING_REGIST_TYPE[:member_id],
183
+ :member_id => member_id,
184
+ })
185
+ result["NextChargeDate"].nil?.should_not be true
186
+ end
187
+ end
188
+
189
+ describe "#unregister_recurring" do
190
+ it "success unregister", :vcr do
191
+ recurring_id = generate_id
192
+ result = @service.unregister_recurring({
193
+ recurring_id: recurring_id
194
+ })
195
+ result["Method"].should == "RECURRING_CREDIT"
196
+ end
197
+ end
174
198
  end
@@ -174,6 +174,60 @@ describe "GMO::Payment::ShopAPI" do
174
174
  end
175
175
  end
176
176
 
177
+ describe "#entry_tran_virtualaccount" do
178
+ it "gets data about a transaction", :vcr do
179
+ order_id = @order_id
180
+ result = @service.entry_tran_virtualaccount({
181
+ :order_id => order_id,
182
+ :amount => 100
183
+ })
184
+ result["AccessID"].nil?.should_not be true
185
+ result["AccessPass"].nil?.should_not be true
186
+ end
187
+
188
+ it "got error if missing options", :vcr do
189
+ lambda {
190
+ result = @service.entry_tran_virtualaccount()
191
+ }.should raise_error('Required order_id, amount were not provided.')
192
+ end
193
+ end
194
+
195
+ describe "#entry_tran_suica" do
196
+ it "gets data about a transaction", :vcr do
197
+ order_id = @order_id
198
+ result = @service.entry_tran_suica({
199
+ :order_id => order_id,
200
+ :amount => 100
201
+ })
202
+ result["AccessID"].nil?.should_not be true
203
+ result["AccessPass"].nil?.should_not be true
204
+ end
205
+
206
+ it "got error if missing options", :vcr do
207
+ lambda {
208
+ result = @service.entry_tran_suica()
209
+ }.should raise_error('Required order_id, amount were not provided.')
210
+ end
211
+ end
212
+
213
+ describe "#entry_tran_edy" do
214
+ it "gets data about a transaction", :vcr do
215
+ order_id = @order_id
216
+ result = @service.entry_tran_edy({
217
+ :order_id => order_id,
218
+ :amount => 100
219
+ })
220
+ result["AccessID"].nil?.should_not be true
221
+ result["AccessPass"].nil?.should_not be true
222
+ end
223
+
224
+ it "got error if missing options", :vcr do
225
+ lambda {
226
+ result = @service.entry_tran_edy()
227
+ }.should raise_error('Required order_id, amount were not provided.')
228
+ end
229
+ end
230
+
177
231
  describe "#exec_tran" do
178
232
  it "gets data about a transaction", :vcr do
179
233
  order_id = generate_id
@@ -276,6 +330,26 @@ describe "GMO::Payment::ShopAPI" do
276
330
  end
277
331
  end
278
332
 
333
+ describe "#secure_tran" do
334
+ it "gets data about a transaction", :vcr do
335
+ params = File.read("fixtures/vcr_cassettes/GMO_Payment_ShopAPI/secure_tran_request_params.yml")
336
+ params = YAML.load(params)
337
+
338
+ result = @service.secure_tran({
339
+ :pa_res => params["pa_res"],
340
+ :md => params["md"]
341
+ })
342
+ result["OrderID"].nil?.should_not be_truthy
343
+ result["Forward"].nil?.should_not be_truthy
344
+ result["Method"].nil?.should_not be_truthy
345
+ result["PayTimes"].nil?.should_not be_truthy
346
+ result["Approve"].nil?.should_not be_truthy
347
+ result["TranID"].nil?.should_not be_truthy
348
+ result["TranDate"].nil?.should_not be_truthy
349
+ result["CheckString"].nil?.should_not be_truthy
350
+ end
351
+ end
352
+
279
353
  describe "#exec_tran_cvs" do
280
354
  it "gets data about a transaction", :vcr do
281
355
  order_id = generate_id
@@ -450,6 +524,110 @@ describe "GMO::Payment::ShopAPI" do
450
524
  end
451
525
  end
452
526
 
527
+ describe "#exec_tran_virtualaccount" do
528
+ it "gets data about a transaction", :vcr do
529
+ order_id = generate_id
530
+ result = @service.entry_tran_virtualaccount({
531
+ :order_id => order_id,
532
+ :amount => 100
533
+ })
534
+ access_id = result["AccessID"]
535
+ access_pass = result["AccessPass"]
536
+ result = @service.exec_tran_virtualaccount({
537
+ :order_id => order_id,
538
+ :access_id => access_id,
539
+ :access_pass => access_pass,
540
+ :trade_days => 14
541
+ })
542
+ result["AccessID"].nil?.should_not be_truthy
543
+ result["BankCode"].nil?.should_not be_truthy
544
+ result["BankName"].nil?.should_not be_truthy
545
+ result["BranchCode"].nil?.should_not be_truthy
546
+ result["BranchName"].nil?.should_not be_truthy
547
+ result["AccountType"].nil?.should_not be_truthy
548
+ result["AccountNumber"].nil?.should_not be_truthy
549
+ result["AvailableDate"].nil?.should_not be_truthy
550
+ result["TradeCode"].nil?.should_not be_truthy
551
+ end
552
+
553
+ it "got error if missing options", :vcr do
554
+ lambda {
555
+ result = @service.exec_tran_virtualaccount()
556
+ }.should raise_error("Required access_id, access_pass, order_id, trade_days were not provided.")
557
+ end
558
+ end
559
+
560
+ describe "#exec_tran_suica" do
561
+ it "gets data about a transaction", :vcr do
562
+ order_id = generate_id
563
+ client_field_1 = "client_field1"
564
+ result = @service.entry_tran_suica({
565
+ :order_id => order_id,
566
+ :amount => 100
567
+ })
568
+ access_id = result["AccessID"]
569
+ access_pass = result["AccessPass"]
570
+ result = @service.exec_tran_suica({
571
+ :order_id => order_id,
572
+ :access_id => access_id,
573
+ :access_pass => access_pass,
574
+ :item_name => '購入する商品名',
575
+ :mail_address => 'test@example.com',
576
+ :client_field_1 => client_field_1,
577
+ :client_field_flg => 1
578
+ })
579
+ result["OrderID"].nil?.should_not be_truthy
580
+ result["SuicaOrderNo"].nil?.should_not be_truthy
581
+ result["ReceiptNo"].nil?.should_not be_truthy
582
+ result["PaymentTerm"].nil?.should_not be_truthy
583
+ result["TranDate"].nil?.should_not be_truthy
584
+ result["CheckString"].nil?.should_not be_truthy
585
+ (result["ClientField1"] == client_field_1).should be_truthy
586
+ result["ClientField3"].nil?.should_not be_truthy
587
+ end
588
+
589
+ it "got error if missing options", :vcr do
590
+ lambda {
591
+ result = @service.exec_tran_suica()
592
+ }.should raise_error("Required access_id, access_pass, order_id, item_name, mail_address were not provided.")
593
+ end
594
+ end
595
+
596
+ describe "#exec_tran_edy" do
597
+ it "gets data about a transaction", :vcr do
598
+ order_id = generate_id
599
+ client_field_1 = "client_field1"
600
+ result = @service.entry_tran_edy({
601
+ :order_id => order_id,
602
+ :amount => 100
603
+ })
604
+ access_id = result["AccessID"]
605
+ access_pass = result["AccessPass"]
606
+ result = @service.exec_tran_edy({
607
+ :order_id => order_id,
608
+ :access_id => access_id,
609
+ :access_pass => access_pass,
610
+ :mail_address => 'test@example.com',
611
+ :client_field_1 => client_field_1,
612
+ :client_field_flg => 1
613
+ })
614
+ result["OrderID"].nil?.should_not be_truthy
615
+ result["ReceiptNo"].nil?.should_not be_truthy
616
+ result["EdyOrderNo"].nil?.should_not be_truthy
617
+ result["PaymentTerm"].nil?.should_not be_truthy
618
+ result["TranDate"].nil?.should_not be_truthy
619
+ result["CheckString"].nil?.should_not be_truthy
620
+ (result["ClientField1"] == client_field_1).should be_truthy
621
+ result["ClientField3"].nil?.should_not be_truthy
622
+ end
623
+
624
+ it "got error if missing options", :vcr do
625
+ lambda {
626
+ result = @service.exec_tran_edy()
627
+ }.should raise_error("Required access_id, access_pass, order_id, mail_address were not provided.")
628
+ end
629
+ end
630
+
453
631
  describe "#exec_tran_brandtoken" do
454
632
  it "gets data about a transaction", :vcr do
455
633
  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.2
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tatsuo Kaniwa
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-15 00:00:00.000000000 Z
11
+ date: 2022-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -133,33 +133,43 @@ files:
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
135
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_docomo_gets_data_about_a_transaction.yml
136
+ - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_edy_gets_data_about_a_transaction.yml
136
137
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_gets_data_about_a_transaction.yml
137
138
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_got_error_if_missing_options.yml
138
139
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_linepay_gets_data_about_a_transaction.yml
139
140
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_pay_easy_gets_data_about_a_transaction.yml
140
141
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_rakuten_id_gets_data_about_a_transaction.yml
142
+ - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_suica_gets_data_about_a_transaction.yml
143
+ - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_virtualaccount_gets_data_about_a_transaction.yml
141
144
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_brandtoken_gets_data_about_a_transaction.yml
142
145
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_brandtoken_parameter_contains_Japanese_characters_should_correctly_handle_Japanese.yml
143
146
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_cvs_gets_data_about_a_transaction.yml
144
147
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_docomo_gets_data_about_a_transaction.yml
145
148
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_doesn_t_require_card_info_if_token_is_present.yml
149
+ - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_edy_gets_data_about_a_transaction.yml
146
150
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_gets_data_about_a_transaction.yml
147
151
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_got_error_if_missing_options.yml
148
152
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_linepay_gets_data_about_a_transaction.yml
149
153
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_parameter_contains_Japanese_characters_should_correctly_handle_Japanese.yml
150
154
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_pay_easy_gets_data_about_a_transaction.yml
151
155
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_rakuten_id_gets_data_about_a_transaction.yml
156
+ - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_suica_gets_data_about_a_transaction.yml
157
+ - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_virtualaccount_gets_data_about_a_transaction.yml
152
158
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_refund_tran_brandtoken_gets_data_about_a_transaction.yml
153
159
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_sales_tran_brandtoken_gets_data_about_a_transaction.yml
154
160
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_search_trade_gets_data_about_order.yml
155
161
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_search_trade_got_error_if_missing_options.yml
156
162
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_search_trade_multi_gets_data_about_order.yml
157
163
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_search_trade_multi_got_error_if_missing_options.yml
164
+ - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_secure_tran_gets_data_about_a_transaction.yml
158
165
  - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_void_tran_brandtoken_gets_data_about_order.yml
166
+ - fixtures/vcr_cassettes/GMO_Payment_ShopAPI/secure_tran_request_params.yml
159
167
  - fixtures/vcr_cassettes/GMO_Payment_ShopAndSiteAPI/_exec_tran_brandtoken_got_data.yml
168
+ - fixtures/vcr_cassettes/GMO_Payment_ShopAndSiteAPI/_register_recurring_credit_got_data.yml
160
169
  - fixtures/vcr_cassettes/GMO_Payment_ShopAndSiteAPI/_trade_brandtoken_got_data.yml
161
170
  - fixtures/vcr_cassettes/GMO_Payment_ShopAndSiteAPI/_trade_card_got_data.yml
162
171
  - fixtures/vcr_cassettes/GMO_Payment_ShopAndSiteAPI/_trade_card_got_error_if_missing_options.yml
172
+ - fixtures/vcr_cassettes/GMO_Payment_ShopAndSiteAPI/_unregister_recurring_success_unregister.yml
163
173
  - fixtures/vcr_cassettes/GMO_Payment_SiteAPI/_delete_brandtoken_gets_data_about_a_brandtoken.yml
164
174
  - fixtures/vcr_cassettes/GMO_Payment_SiteAPI/_delete_card_gets_data_about_a_card.yml
165
175
  - fixtures/vcr_cassettes/GMO_Payment_SiteAPI/_delete_member_gets_data_about_a_member.yml
@@ -201,7 +211,7 @@ homepage: https://github.com/t-k/gmo-payment-ruby
201
211
  licenses:
202
212
  - MIT
203
213
  metadata: {}
204
- post_install_message:
214
+ post_install_message:
205
215
  rdoc_options:
206
216
  - "--line-numbers"
207
217
  - "--inline-source"
@@ -220,9 +230,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
230
  - !ruby/object:Gem::Version
221
231
  version: '0'
222
232
  requirements: []
223
- rubyforge_project:
224
- rubygems_version: 2.7.8
225
- signing_key:
233
+ rubygems_version: 3.0.3.1
234
+ signing_key:
226
235
  specification_version: 4
227
236
  summary: 'GMO Payment API client: Ruby client library for the GMO Payment Platform.'
228
237
  test_files: []