gmo 0.5.4 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +39 -0
  3. data/CHANGELOG.md +8 -0
  4. data/Gemfile +3 -4
  5. data/README.md +3 -3
  6. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_cancel_deposit_gets_data_about_a_deposit.yml +2 -2
  7. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_cancel_link_redirect_url_with_invalid_options_got_error.yml +53 -0
  8. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_cancel_link_redirect_url_with_valid_options_gets_data_about_a_link_edirect_url.yml +103 -0
  9. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_cancel_mail_deposit_gets_data_about_a_mail_deposit.yml +2 -2
  10. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_create_account_gets_data_about_an_account.yml +2 -2
  11. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_create_deposit_gets_data_about_a_deposit.yml +2 -2
  12. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_create_link_redirect_url_with_valid_options_gets_data_about_link_redirect_url.yml +53 -0
  13. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_create_mail_deposit_with_valid_options_gets_data_about_a_mail_deposit.yml +47 -0
  14. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_create_mail_deposit_with_valid_options_makes_request_with_correct_parameters.yml +47 -0
  15. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_delete_account_gets_data_about_an_account.yml +2 -2
  16. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_search_account_gets_data_about_an_account.yml +2 -2
  17. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_search_balance_gets_data_about_balance.yml +2 -2
  18. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_search_deposit_gets_data_about_a_deposit.yml +2 -2
  19. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_search_mail_deposit_gets_data_about_a_mail_deposit.yml +2 -2
  20. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_update_account_gets_data_about_an_account.yml +2 -2
  21. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_alter_tran_change_order_auth_to_sale.yml +3 -3
  22. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_alter_tran_gets_data_about_order.yml +3 -3
  23. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_alter_tran_got_error_if_missing_options.yml +1 -1
  24. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_change_tran_brandtoken_gets_data_about_order.yml +6 -6
  25. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_change_tran_gets_data_about_order.yml +3 -3
  26. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_change_tran_got_error_if_missing_options.yml +1 -1
  27. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_cvs_cancel_gets_data_about_a_transaction.yml +2 -2
  28. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_brandtoken_gets_data_about_a_transaction.yml +2 -2
  29. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_cvs_gets_data_about_a_transaction.yml +1 -1
  30. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_cvs_got_error_if_missing_options.yml +1 -1
  31. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_docomo_gets_data_about_a_transaction.yml +2 -2
  32. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_edy_gets_data_about_a_transaction.yml +2 -2
  33. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_ganb_gets_data_about_a_transaction.yml +35 -0
  34. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_gets_data_about_a_transaction.yml +1 -1
  35. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_got_error_if_missing_options.yml +1 -1
  36. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_linepay_gets_data_about_a_transaction.yml +2 -2
  37. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_pay_easy_gets_data_about_a_transaction.yml +2 -2
  38. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_paypal_gets_data_about_a_transaction.yml +35 -0
  39. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_rakuten_id_gets_data_about_a_transaction.yml +2 -2
  40. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_suica_gets_data_about_a_transaction.yml +2 -2
  41. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_entry_tran_virtualaccount_gets_data_about_a_transaction.yml +2 -2
  42. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_brandtoken_gets_data_about_a_transaction.yml +4 -4
  43. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_brandtoken_parameter_contains_Japanese_characters_should_correctly_handle_Japanese.yml +5 -5
  44. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_cvs_gets_data_about_a_transaction.yml +2 -2
  45. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_docomo_gets_data_about_a_transaction.yml +4 -4
  46. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_doesn_t_require_card_info_if_token_is_present.yml +4 -4
  47. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_edy_gets_data_about_a_transaction.yml +4 -4
  48. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_ganb_gets_data_about_a_transaction.yml +68 -0
  49. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_gets_data_about_a_transaction.yml +2 -2
  50. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_got_error_if_missing_options.yml +1 -1
  51. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_linepay_gets_data_about_a_transaction.yml +4 -4
  52. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_parameter_contains_Japanese_characters_should_correctly_handle_Japanese.yml +3 -3
  53. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_pay_easy_gets_data_about_a_transaction.yml +4 -4
  54. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_paypal_gets_data_about_a_transaction.yml +67 -0
  55. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_rakuten_id_gets_data_about_a_transaction.yml +4 -4
  56. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_suica_gets_data_about_a_transaction.yml +4 -4
  57. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_exec_tran_virtualaccount_gets_data_about_a_transaction.yml +3 -3
  58. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_refund_tran_brandtoken_gets_data_about_a_transaction.yml +6 -6
  59. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_sales_tran_brandtoken_gets_data_about_a_transaction.yml +8 -8
  60. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_search_trade_gets_data_about_order.yml +1 -1
  61. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_search_trade_got_error_if_missing_options.yml +1 -1
  62. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_search_trade_multi_gets_data_about_order.yml +1 -1
  63. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_search_trade_multi_got_error_if_missing_options.yml +1 -1
  64. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_secure_tran_gets_data_about_a_transaction.yml +2 -2
  65. data/fixtures/vcr_cassettes/GMO_Payment_ShopAPI/_void_tran_brandtoken_gets_data_about_order.yml +6 -6
  66. data/fixtures/vcr_cassettes/GMO_Payment_ShopAndSiteAPI/_exec_tran_brandtoken_got_data.yml +4 -4
  67. data/fixtures/vcr_cassettes/GMO_Payment_ShopAndSiteAPI/_register_recurring_credit_got_data.yml +2 -2
  68. data/fixtures/vcr_cassettes/GMO_Payment_ShopAndSiteAPI/_trade_brandtoken_got_data.yml +6 -6
  69. data/fixtures/vcr_cassettes/GMO_Payment_ShopAndSiteAPI/_trade_card_got_data.yml +8 -8
  70. data/fixtures/vcr_cassettes/GMO_Payment_ShopAndSiteAPI/_trade_card_got_error_if_missing_options.yml +1 -1
  71. data/fixtures/vcr_cassettes/GMO_Payment_ShopAndSiteAPI/_unregister_recurring_success_unregister.yml +4 -4
  72. data/fixtures/vcr_cassettes/GMO_Payment_SiteAPI/_delete_brandtoken_gets_data_about_a_brandtoken.yml +4 -4
  73. data/fixtures/vcr_cassettes/GMO_Payment_SiteAPI/_delete_card_gets_data_about_a_card.yml +1 -1
  74. data/fixtures/vcr_cassettes/GMO_Payment_SiteAPI/_delete_member_gets_data_about_a_member.yml +2 -2
  75. data/fixtures/vcr_cassettes/GMO_Payment_SiteAPI/_save_card_doesn_t_require_card_info_if_token_is_present.yml +2 -2
  76. data/fixtures/vcr_cassettes/GMO_Payment_SiteAPI/_save_card_gets_data_about_a_card.yml +1 -1
  77. data/fixtures/vcr_cassettes/GMO_Payment_SiteAPI/_save_member_gets_data_about_a_transaction.yml +1 -1
  78. data/fixtures/vcr_cassettes/GMO_Payment_SiteAPI/_search_brandtoken_gets_data_about_a_brandtoken.yml +4 -4
  79. data/fixtures/vcr_cassettes/GMO_Payment_SiteAPI/_search_card_detail_by_member_id_gets_data_about_card_detail.yml +1 -1
  80. data/fixtures/vcr_cassettes/GMO_Payment_SiteAPI/_search_card_gets_data_about_a_card.yml +2 -2
  81. data/fixtures/vcr_cassettes/GMO_Payment_SiteAPI/_search_member_gets_data_about_a_member.yml +2 -2
  82. data/fixtures/vcr_cassettes/GMO_Payment_SiteAPI/_update_member_gets_data_about_a_transaction.yml +1 -1
  83. data/lib/gmo/const.rb +15 -0
  84. data/lib/gmo/http_services.rb +6 -1
  85. data/lib/gmo/remittance_api.rb +63 -1
  86. data/lib/gmo/shop_api.rb +40 -0
  87. data/lib/gmo/version.rb +1 -1
  88. data/lib/gmo.rb +11 -4
  89. data/spec/gmo/remittance_api_spec.rb +123 -36
  90. data/spec/gmo/shop_api_spec.rb +108 -5
  91. data/spec/spec_helper.rb +2 -5
  92. metadata +16 -9
  93. data/.travis.yml +0 -21
  94. data/fixtures/vcr_cassettes/GMO_Payment_RemittanceAPI/_create_mail_deposit_gets_data_about_a_mail_deposit.yml +0 -38
  95. data/spec/support/encoding.rb +0 -33
@@ -4,7 +4,7 @@ http_interactions:
4
4
  method: post
5
5
  uri: https://<HOST>/payment/EntryTran.idPass
6
6
  body:
7
- encoding: UTF-8
7
+ encoding: Windows-31J
8
8
  string: OrderID=1371958258&JobCd=AUTH&Amount=100&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>
9
9
  headers:
10
10
  Accept-Encoding:
@@ -27,7 +27,7 @@ http_interactions:
27
27
  Transfer-Encoding:
28
28
  - chunked
29
29
  body:
30
- encoding: UTF-8
30
+ encoding: Windows-31J
31
31
  string: AccessID=1da06187345d613ce206f4cd05bc5322&AccessPass=45a21e63323c3795d26e22338eaa6b7f
32
32
  http_version:
33
33
  recorded_at: Sun, 23 Jun 2013 03:30:59 GMT
@@ -35,7 +35,7 @@ http_interactions:
35
35
  method: post
36
36
  uri: https://<HOST>/payment/ExecTran.idPass
37
37
  body:
38
- encoding: UTF-8
38
+ encoding: Windows-31J
39
39
  string: OrderID=1371958258&AccessID=1da06187345d613ce206f4cd05bc5322&AccessPass=45a21e63323c3795d26e22338eaa6b7f&Method=1&PayTimes=1&CardNo=4111111111111111&Expire=1405&ClientFieldFlag=0&DeviceCategory=0&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>
40
40
  headers:
41
41
  Accept-Encoding:
@@ -58,7 +58,7 @@ http_interactions:
58
58
  Transfer-Encoding:
59
59
  - chunked
60
60
  body:
61
- encoding: UTF-8
61
+ encoding: Windows-31J
62
62
  string: ACS=0&OrderID=1371958258&Forward=2a99662&Method=1&PayTimes=&Approve=7214787&TranID=1306231226111111111111199359&TranDate=20130623123059&CheckString=74f54b788565f291e65f67c606f90ca2
63
63
  http_version:
64
64
  recorded_at: Sun, 23 Jun 2013 03:30:59 GMT
@@ -66,7 +66,7 @@ http_interactions:
66
66
  method: post
67
67
  uri: https://<HOST>/payment/SaveMember.idPass
68
68
  body:
69
- encoding: UTF-8
69
+ encoding: Windows-31J
70
70
  string: MemberID=1371958259&MemberName=John+Smith&SiteID=<SITE_ID>&SitePass=<SITE_PASS>
71
71
  headers:
72
72
  Accept-Encoding:
@@ -89,7 +89,7 @@ http_interactions:
89
89
  Transfer-Encoding:
90
90
  - chunked
91
91
  body:
92
- encoding: UTF-8
92
+ encoding: Windows-31J
93
93
  string: MemberID=1371958259
94
94
  http_version:
95
95
  recorded_at: Sun, 23 Jun 2013 03:30:59 GMT
@@ -97,7 +97,7 @@ http_interactions:
97
97
  method: post
98
98
  uri: https://<HOST>/payment/TradedCard.idPass
99
99
  body:
100
- encoding: UTF-8
100
+ encoding: Windows-31J
101
101
  string: OrderID=1371958258&MemberID=1371958259&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>&SiteID=<SITE_ID>&SitePass=<SITE_PASS>
102
102
  headers:
103
103
  Accept-Encoding:
@@ -120,7 +120,7 @@ http_interactions:
120
120
  Transfer-Encoding:
121
121
  - chunked
122
122
  body:
123
- encoding: UTF-8
123
+ encoding: Windows-31J
124
124
  string: CardSeq=0&CardNo=************1111&Forward=2a99662
125
125
  http_version:
126
126
  recorded_at: Sun, 23 Jun 2013 03:31:00 GMT
@@ -4,7 +4,7 @@ http_interactions:
4
4
  method: post
5
5
  uri: https://<HOST>/payment/TradedCard.idPass
6
6
  body:
7
- encoding: UTF-8
7
+ encoding: Windows-31J
8
8
  string: OrderID=null&MemberID=null&SeqMode=0&DefaultFlag=0&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>&SiteID=<SITE_ID>&SitePass=<SITE_PASS>
9
9
  headers:
10
10
  Accept:
@@ -4,7 +4,7 @@ http_interactions:
4
4
  method: post
5
5
  uri: https://<HOST>/payment/RegisterRecurringCredit.idPass
6
6
  body:
7
- encoding: UTF-8
7
+ encoding: Windows-31J
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
9
  headers:
10
10
  Accept-Encoding:
@@ -29,7 +29,7 @@ http_interactions:
29
29
  Connection:
30
30
  - close
31
31
  body:
32
- encoding: UTF-8
32
+ encoding: Windows-31J
33
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
34
  http_version:
35
35
  recorded_at: Tue, 04 Sep 2018 05:36:34 GMT
@@ -37,7 +37,7 @@ http_interactions:
37
37
  method: post
38
38
  uri: https://<HOST>/payment/UnregisterRecurring.idPass
39
39
  body:
40
- encoding: UTF-8
40
+ encoding: Windows-31J
41
41
  string: RecurringID=<TOKEN>536039393&SiteID=<SITE_ID>&SitePass=<SITE_PASS>&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>
42
42
  headers:
43
43
  Accept-Encoding:
@@ -62,7 +62,7 @@ http_interactions:
62
62
  Connection:
63
63
  - close
64
64
  body:
65
- encoding: UTF-8
65
+ encoding: Windows-31J
66
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
67
  http_version:
68
68
  recorded_at: Tue, 04 Sep 2018 05:36:34 GMT
@@ -4,7 +4,7 @@ http_interactions:
4
4
  method: post
5
5
  uri: https://<HOST>/payment/TradedBrandtoken.idPass
6
6
  body:
7
- encoding: UTF-8
7
+ encoding: Windows-31J
8
8
  string: OrderID=<SHOP_PASS>502<SHOP_PASS>9<SHOP_PASS>295&MemberID=<SHOP_PASS>502<SHOP_PASS>9<SHOP_PASS>295&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>&SiteID=<SITE_ID>&SitePass=<SHOP_PASS>
9
9
  headers:
10
10
  Accept-Encoding:
@@ -31,7 +31,7 @@ http_interactions:
31
31
  Content-Language:
32
32
  - ja-JP
33
33
  body:
34
- encoding: UTF-8
34
+ encoding: Windows-31J
35
35
  string: TokenSeq=0&CardNoToken=*************<SHOP_PASS><SHOP_PASS><SHOP_PASS>&Forward=2a99663
36
36
  http_version:
37
37
  recorded_at: Tue, 08 Aug 2017 11:21:35 GMT
@@ -39,7 +39,7 @@ http_interactions:
39
39
  method: post
40
40
  uri: https://<HOST>/payment/DeleteBrandtoken.idPass
41
41
  body:
42
- encoding: UTF-8
42
+ encoding: Windows-31J
43
43
  string: MemberID=<SHOP_PASS>502<SHOP_PASS>9<SHOP_PASS>329&SeqMode=0&TokenSeq=0&SiteID=<SITE_ID>&SitePass=<SHOP_PASS>
44
44
  headers:
45
45
  Accept-Encoding:
@@ -66,7 +66,7 @@ http_interactions:
66
66
  Content-Language:
67
67
  - ja-JP
68
68
  body:
69
- encoding: UTF-8
69
+ encoding: Windows-31J
70
70
  string: TokenSeq=0
71
71
  http_version:
72
72
  recorded_at: Tue, 08 Aug 2017 11:22:09 GMT
@@ -4,7 +4,7 @@ http_interactions:
4
4
  method: post
5
5
  uri: https://<HOST>/payment/DeleteCard.idPass
6
6
  body:
7
- encoding: UTF-8
7
+ encoding: Windows-31J
8
8
  string: MemberID=1362106780&CardSeq=0&SiteID=<SITE_ID>&SitePass=<SITE_PASS>
9
9
  headers:
10
10
  Accept:
@@ -4,7 +4,7 @@ http_interactions:
4
4
  method: post
5
5
  uri: https://<HOST>/payment/SaveMember.idPass
6
6
  body:
7
- encoding: UTF-8
7
+ encoding: Windows-31J
8
8
  string: MemberID=1362106781&MemberName=John+Smith&SiteID=<SITE_ID>&SitePass=<SITE_PASS>
9
9
  headers:
10
10
  Accept:
@@ -33,7 +33,7 @@ http_interactions:
33
33
  method: post
34
34
  uri: https://<HOST>/payment/DeleteMember.idPass
35
35
  body:
36
- encoding: UTF-8
36
+ encoding: Windows-31J
37
37
  string: MemberID=1362106781&SiteID=<SITE_ID>&SitePass=<SITE_PASS>
38
38
  headers:
39
39
  Accept:
@@ -4,7 +4,7 @@ http_interactions:
4
4
  method: post
5
5
  uri: https://<HOST>/payment/SaveCard.idPass
6
6
  body:
7
- encoding: UTF-8
7
+ encoding: Windows-31J
8
8
  string: MemberID=<TOKEN_MEMBER_ID>&Token=<TOKEN>&SiteID=<SITE_ID>&SitePass=<SITE_PASS>
9
9
  headers:
10
10
  Accept-Encoding:
@@ -29,7 +29,7 @@ http_interactions:
29
29
  Connection:
30
30
  - close
31
31
  body:
32
- encoding: UTF-8
32
+ encoding: Windows-31J
33
33
  string: CardSeq=0&CardNo=*************111&Forward=2a99662
34
34
  http_version:
35
35
  recorded_at: Fri, 03 Feb 2017 09:42:25 GMT
@@ -4,7 +4,7 @@ http_interactions:
4
4
  method: post
5
5
  uri: https://<HOST>/payment/SaveCard.idPass
6
6
  body:
7
- encoding: UTF-8
7
+ encoding: Windows-31J
8
8
  string: MemberID=1362106780&CardNo=4111111111111111&Expire=1405&SiteID=<SITE_ID>&SitePass=<SITE_PASS>
9
9
  headers:
10
10
  Accept:
@@ -4,7 +4,7 @@ http_interactions:
4
4
  method: post
5
5
  uri: https://<HOST>/payment/SaveMember.idPass
6
6
  body:
7
- encoding: UTF-8
7
+ encoding: Windows-31J
8
8
  string: MemberID=1362106780&MemberName=John+Smith&SiteID=<SITE_ID>&SitePass=<SITE_PASS>
9
9
  headers:
10
10
  Accept:
@@ -4,7 +4,7 @@ http_interactions:
4
4
  method: post
5
5
  uri: https://<HOST>/payment/TradedBrandtoken.idPass
6
6
  body:
7
- encoding: UTF-8
7
+ encoding: Windows-31J
8
8
  string: OrderID=<SHOP_PASS>502<SHOP_PASS>90974&MemberID=<SHOP_PASS>502<SHOP_PASS>90974&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>&SiteID=<SITE_ID>&SitePass=<SHOP_PASS>
9
9
  headers:
10
10
  Accept-Encoding:
@@ -32,7 +32,7 @@ http_interactions:
32
32
  Content-Language:
33
33
  - ja-JP
34
34
  body:
35
- encoding: UTF-8
35
+ encoding: Windows-31J
36
36
  string: TokenSeq=0&CardNoToken=*************<SHOP_PASS><SHOP_PASS><SHOP_PASS>&Forward=2a99663
37
37
  http_version:
38
38
  recorded_at: Tue, 08 Aug 2017 11:16:15 GMT
@@ -40,7 +40,7 @@ http_interactions:
40
40
  method: post
41
41
  uri: https://<HOST>/payment/SearchBrandtoken.idPass
42
42
  body:
43
- encoding: UTF-8
43
+ encoding: Windows-31J
44
44
  string: MemberID=<SHOP_PASS>502<SHOP_PASS>9<SHOP_PASS><SHOP_PASS><SHOP_PASS>7&SeqMode=0&SiteID=<SITE_ID>&SitePass=<SHOP_PASS>
45
45
  headers:
46
46
  Accept-Encoding:
@@ -67,7 +67,7 @@ http_interactions:
67
67
  Content-Language:
68
68
  - ja-JP
69
69
  body:
70
- encoding: UTF-8
70
+ encoding: Windows-31J
71
71
  string: TokenSeq=0&DefaultFlag=0&CardName=&CardNoToken=*************111&Expire=2212&HolderName=&DeleteFlag=0
72
72
  http_version:
73
73
  recorded_at: Tue, 08 Aug 2017 11:18:38 GMT
@@ -4,7 +4,7 @@ http_interactions:
4
4
  method: post
5
5
  uri: https://pt0<SHOP_PASS>.mul-pay.jp/payment/SearchCardDetail.idPass
6
6
  body:
7
- encoding: UTF-8
7
+ encoding: Windows-31J
8
8
  string: MemberID=50292464&SeqMode=0&ShopID=<SHOP_ID>&ShopPass=<SHOP_PASS>
9
9
  headers:
10
10
  Accept-Encoding:
@@ -4,7 +4,7 @@ http_interactions:
4
4
  method: post
5
5
  uri: https://<HOST>/payment/SaveCard.idPass
6
6
  body:
7
- encoding: UTF-8
7
+ encoding: Windows-31J
8
8
  string: MemberID=1362106780&CardNo=4111111111111111&Expire=1405&SiteID=<SITE_ID>&SitePass=<SITE_PASS>
9
9
  headers:
10
10
  Accept:
@@ -33,7 +33,7 @@ http_interactions:
33
33
  method: post
34
34
  uri: https://<HOST>/payment/SearchCard.idPass
35
35
  body:
36
- encoding: UTF-8
36
+ encoding: Windows-31J
37
37
  string: MemberID=1362106780&CardSeq=0&SeqMode=0&SiteID=<SITE_ID>&SitePass=<SITE_PASS>
38
38
  headers:
39
39
  Accept:
@@ -4,7 +4,7 @@ http_interactions:
4
4
  method: post
5
5
  uri: https://<HOST>/payment/SaveMember.idPass
6
6
  body:
7
- encoding: UTF-8
7
+ encoding: Windows-31J
8
8
  string: MemberID=1362106992&MemberName=John+Smith&SiteID=<SITE_ID>&SitePass=<SITE_PASS>
9
9
  headers:
10
10
  Accept:
@@ -33,7 +33,7 @@ http_interactions:
33
33
  method: post
34
34
  uri: https://<HOST>/payment/SearchMember.idPass
35
35
  body:
36
- encoding: UTF-8
36
+ encoding: Windows-31J
37
37
  string: MemberID=1362106992&SiteID=<SITE_ID>&SitePass=<SITE_PASS>
38
38
  headers:
39
39
  Accept:
@@ -4,7 +4,7 @@ http_interactions:
4
4
  method: post
5
5
  uri: https://<HOST>/payment/UpdateMember.idPass
6
6
  body:
7
- encoding: UTF-8
7
+ encoding: Windows-31J
8
8
  string: MemberID=1362106780&MemberName=John+Smith2&SiteID=<SITE_ID>&SitePass=<SITE_PASS>
9
9
  headers:
10
10
  Accept:
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.4"
2
+ VERSION = "0.5.6"
3
3
  end
data/lib/gmo.rb CHANGED
@@ -38,11 +38,18 @@ 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
- body = response = Hash[response.map { |k,v| [k, NKF.nkf('-w',v)] }]
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
47
54
  yield(body) if error_checking_block
48
55
  # Return result