active_merchant-epsilon 0.9.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +2 -3
  3. data/CHANGELOG.md +20 -0
  4. data/README.md +48 -0
  5. data/active_merchant-epsilon.gemspec +3 -3
  6. data/lib/active_merchant/billing/gateways/epsilon.rb +13 -0
  7. data/lib/active_merchant/billing/gateways/epsilon/epsilon_base.rb +2 -1
  8. data/lib/active_merchant/billing/gateways/epsilon_link_payment.rb +51 -0
  9. data/lib/active_merchant/billing/gateways/response_parser.rb +13 -1
  10. data/lib/active_merchant/epsilon.rb +1 -0
  11. data/lib/active_merchant/epsilon/version.rb +1 -1
  12. data/test/fixtures/vcr_cassettes/capture_failure.yml +45 -0
  13. data/test/fixtures/vcr_cassettes/capture_success.yml +45 -0
  14. data/test/fixtures/vcr_cassettes/capture_success_authorize.yml +49 -0
  15. data/test/fixtures/vcr_cassettes/epsilon_link_type_purchase_fail.yml +43 -0
  16. data/test/fixtures/vcr_cassettes/epsilon_link_type_purchase_successfull.yml +44 -0
  17. data/test/fixtures/vcr_cassettes/epsilon_link_type_void_fail.yml +45 -0
  18. data/test/fixtures/vcr_cassettes/epsilon_link_type_void_successfull.yml +45 -0
  19. data/test/fixtures/vcr_cassettes/gmo_after_purchase_fail.yml +44 -0
  20. data/test/fixtures/vcr_cassettes/gmo_after_purchase_successful.yml +45 -0
  21. data/test/fixtures/vcr_cassettes/purchase_with_capture_false_successful.yml +49 -0
  22. data/test/fixtures/vcr_cassettes/purchase_with_capture_true_successful.yml +49 -0
  23. data/test/remote/gateways/remote_epsilon_convenience_store_test.rb +1 -0
  24. data/test/remote/gateways/remote_epsilon_gmo_after_test.rb +30 -0
  25. data/test/remote/gateways/remote_epsilon_gmo_id_test.rb +1 -0
  26. data/test/remote/gateways/remote_epsilon_link_payment_test.rb +46 -0
  27. data/test/remote/gateways/remote_epsilon_test.rb +44 -0
  28. data/test/remote/gateways/remote_epsilon_virtual_account_test.rb +2 -1
  29. data/test/test_helper.rb +71 -1
  30. metadata +40 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 47c8ebb3aaa32f424787d2b5c842250ee06aeb65
4
- data.tar.gz: 4feb0998d3dc9422908b18c17867e0fbab12f404
2
+ SHA256:
3
+ metadata.gz: 4a03c39c4cec54b9fc58239c06fa68f6cc744f23eae1f24d1d358adee4b9690d
4
+ data.tar.gz: ad13565004a9be017201bf3e7943119f454ce02e15de7525b862842a6d826181
5
5
  SHA512:
6
- metadata.gz: c2d4ea004d1f5e2b511c3ac8722389b98f790bc17bd9970a8bdc01724e7ab7323bbfb44ca3f2ae49d2ac2f26f08a25bd5a094bfdad821b78a37cc7dc7532dfe8
7
- data.tar.gz: 4ac64c7b58f282109c8edcbdb96394926d98947549aa3a333b36cffba8c304d3c32ac72a4b5eb2e9c7348b6056c2eab540c1d08e9eafd2e4a300efcdd7c75b17
6
+ metadata.gz: bb9788ea30e77a481f94435e89b82469a96bc66a385e7a0cc73a8f581487dc0129f148e53e2fc9a7114edf632a2cf2b11d1d189c52e53deb899b70b925225989
7
+ data.tar.gz: 527de254d4c3e0d64bdcbb067c10f6ff6428a007b920742125288e33e6362d22f89d16ab0c0356cc4046ffb1c4ab35037b30492f56174b2d73c2a40d761f5ad0
@@ -1,8 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.7
4
- - 2.2.3
5
- - 2.3.0
3
+ - 2.4.5
4
+ - 2.5.3
6
5
 
7
6
  script: bundle exec rake test:remote
8
7
  script: bundle exec rake test:unit
@@ -1,5 +1,25 @@
1
1
  # CHANGELOG
2
2
 
3
+ ### 0.11.0
4
+
5
+ - [Add void mehotd for Epsilon Link Payment](https://github.com/pepabo/active_merchant-epsilon/pull/114)
6
+
7
+ ### 0.10.0
8
+
9
+ * [Capture authorized payments](https://github.com/pepabo/active_merchant-epsilon/pull/112)
10
+
11
+ ### 0.9.4
12
+
13
+ * [Support Epsilon Link Payment instead of GMO Payment After Delivery](https://github.com/pepabo/active_merchant-epsilon/pull/110)
14
+
15
+ ### 0.9.3
16
+
17
+ * [Fix API version for GMO Payment After Delivery](https://github.com/pepabo/active_merchant-epsilon/pull/108)
18
+
19
+ ### 0.9.2
20
+
21
+ * [Support GMO Payment After Delivery](https://github.com/pepabo/active_merchant-epsilon/pull/106)
22
+
3
23
  ### 0.9.1
4
24
 
5
25
  * [Add amount to response parameters when find order](https://github.com/pepabo/active_merchant-epsilon/pull/99)
data/README.md CHANGED
@@ -302,6 +302,54 @@ else
302
302
  end
303
303
  ```
304
304
 
305
+ ### Epsilon Link Payment
306
+
307
+ EpsilosLinkPaymentGateway is available in all link payments.
308
+ For example, GMO Payment After Delivery.
309
+
310
+ ```ruby
311
+ ActiveMerchant::Billing::EpsilonLinkPaymentGateway.contract_code = 'YOUR_CONTRACT_CODE'
312
+
313
+ gateway = ActiveMerchant::Billing::EpsilonLinkPaymentGateway.new
314
+
315
+ amount = 10000
316
+
317
+ purchase_detail = {
318
+ user_id: 'YOUR_APP_USER_IDENTIFIER',
319
+ user_name: '山田 太郎',
320
+ user_email: 'yamada-taro@example.com',
321
+ user_tel: '0312345678',
322
+ item_code: 'ITEM001',
323
+ item_name: 'Greate Product',
324
+ order_number: 'UNIQUE ORDER NUMBER',
325
+ st_code: 'SETTLEMENT_CODE',
326
+ consignee_postal: '1500002',
327
+ consignee_name: '山田 太郎',
328
+ consignee_address: '東京都渋谷区1-1-1',
329
+ consignee_tel: '0312345678',
330
+ orderer_postal: '1500002',
331
+ orderer_name: '山田 太郎',
332
+ orderer_address: '東京都渋谷区1-1-1',
333
+ orderer_tel: '0312345678',
334
+ memo1: 'memo1',
335
+ memo2: 'memo2',
336
+ }
337
+
338
+ response = gateway.purchase(amount, purchase_detail)
339
+
340
+ if response.success?
341
+ puts "Successfully send order data"
342
+ puts "Redirect url is #{response.params['redirect']}"
343
+ else
344
+ raise StandardError, response.message
345
+ end
346
+ ```
347
+
348
+ ### Epsilon Link Payment Void Transaction
349
+ ```ruby
350
+ gateway.void('order_number')
351
+ ```
352
+
305
353
  ### Error handling
306
354
 
307
355
  If epsilon server returns status excepted 200, `#purchase` method raise `ActiveMerchant::ResponseError`.
@@ -18,13 +18,13 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency 'activemerchant', '~> 1.66.0'
21
+ spec.add_dependency 'activemerchant', '~> 1.88'
22
22
  spec.add_dependency 'nokogiri'
23
23
 
24
- spec.add_development_dependency 'bundler', '~> 1.7'
24
+ spec.add_development_dependency 'bundler'
25
25
  spec.add_development_dependency 'dotenv'
26
26
  spec.add_development_dependency 'pry-byebug'
27
- spec.add_development_dependency 'rake', '~> 10.0'
27
+ spec.add_development_dependency 'rake'
28
28
  spec.add_development_dependency 'tapp'
29
29
  spec.add_development_dependency 'webmock'
30
30
  spec.add_development_dependency 'vcr'
@@ -19,6 +19,7 @@ module ActiveMerchant #:nodoc:
19
19
  find_user: 'get_user_info.cgi',
20
20
  change_recurring_amount: 'change_amount_payment.cgi',
21
21
  find_order: 'getsales2.cgi',
22
+ capture: 'sales_payment.cgi',
22
23
  }.freeze
23
24
 
24
25
  self.supported_cardtypes = [:visa, :master, :american_express, :discover]
@@ -51,6 +52,7 @@ module ActiveMerchant #:nodoc:
51
52
 
52
53
  params[:memo1] = detail[:memo1] if detail.has_key?(:memo1)
53
54
  params[:memo2] = detail[:memo2] if detail.has_key?(:memo2)
55
+ params[:kari_flag] = detail[:capture] ? 2 : 1 if detail.has_key?(:capture)
54
56
 
55
57
  commit(PATHS[:registered_purchase], params)
56
58
  end
@@ -83,6 +85,7 @@ module ActiveMerchant #:nodoc:
83
85
 
84
86
  params[:memo1] = detail[:memo1] if detail.has_key?(:memo1)
85
87
  params[:memo2] = detail[:memo2] if detail.has_key?(:memo2)
88
+ params[:kari_flag] = detail[:capture] ? 2 : 1 if detail.has_key?(:capture)
86
89
 
87
90
  commit(PATHS[:registered_recurring], params)
88
91
  end
@@ -182,6 +185,15 @@ module ActiveMerchant #:nodoc:
182
185
  commit(PATHS[:find_order], params, response_keys)
183
186
  end
184
187
 
188
+ def capture(order_number)
189
+ params = {
190
+ contract_code: self.contract_code,
191
+ order_number: order_number,
192
+ }
193
+
194
+ commit(PATHS[:capture], params)
195
+ end
196
+
185
197
  private
186
198
 
187
199
  def billing_params(amount, payment_method, detail)
@@ -208,6 +220,7 @@ module ActiveMerchant #:nodoc:
208
220
 
209
221
  params[:memo1] = detail[:memo1] if detail.has_key?(:memo1)
210
222
  params[:memo2] = detail[:memo2] if detail.has_key?(:memo2)
223
+ params[:kari_flag] = detail[:capture] ? 2 : 1 if detail.has_key?(:capture)
211
224
 
212
225
  if detail.has_key?(:token)
213
226
  params[:token] = detail[:token]
@@ -49,7 +49,8 @@ module ActiveMerchant #:nodoc:
49
49
  :acs_url,
50
50
  :pa_req,
51
51
  :receipt_number,
52
- :receipt_date
52
+ :receipt_date,
53
+ :captured,
53
54
  ].freeze
54
55
 
55
56
  private
@@ -0,0 +1,51 @@
1
+ module ActiveMerchant #:nodoc:
2
+ module Billing #:nodoc:
3
+ class EpsilonLinkPaymentGateway < EpsilonBaseGateway
4
+
5
+ RESPONSE_KEYS = DEFAULT_RESPONSE_KEYS + [
6
+ :redirect,
7
+ ]
8
+
9
+ def purchase(amount, detail = {})
10
+ params = {
11
+ contract_code: self.contract_code,
12
+ user_id: detail[:user_id],
13
+ user_name: detail[:user_name],
14
+ user_mail_add: detail[:user_email],
15
+ item_code: detail[:item_code],
16
+ item_name: detail[:item_name],
17
+ order_number: detail[:order_number],
18
+ st_code: detail[:st_code],
19
+ mission_code: EpsilonMissionCode::PURCHASE,
20
+ item_price: amount,
21
+ process_code: EpsilonProcessCode::FIRST,
22
+ xml: 1, # 応答形式。1: xml形式を固定
23
+ delivery_code: 99, # 配送区分。99で固定
24
+ consignee_postal: detail[:consignee_postal],
25
+ consignee_name: detail[:consignee_name],
26
+ consignee_address: detail[:consignee_address],
27
+ consignee_tel: detail[:consignee_tel],
28
+ orderer_postal: detail[:orderer_postal],
29
+ orderer_name: detail[:orderer_name],
30
+ orderer_address: detail[:orderer_address],
31
+ orderer_tel: detail[:orderer_tel],
32
+ }
33
+
34
+ params[:memo1] = detail[:memo1] if detail.has_key?(:memo1)
35
+ params[:memo2] = detail[:memo2] if detail.has_key?(:memo2)
36
+ params[:user_tel] = detail[:user_tel] if detail.has_key?(:user_tel)
37
+
38
+ commit('receive_order3.cgi', params, RESPONSE_KEYS)
39
+ end
40
+
41
+ def void(order_number)
42
+ params = {
43
+ contract_code: self.contract_code,
44
+ order_number: order_number
45
+ }
46
+
47
+ commit('cancel_payment.cgi', params)
48
+ end
49
+ end
50
+ end
51
+ end
@@ -1,3 +1,5 @@
1
+ require 'cgi'
2
+
1
3
  module ActiveMerchant #:nodoc:
2
4
  module Billing #:nodoc:
3
5
  class ResponseParser
@@ -117,8 +119,16 @@ module ActiveMerchant #:nodoc:
117
119
  @xml.xpath(ResponseXpath::AMOUNT).to_s
118
120
  end
119
121
 
122
+ def redirect
123
+ uri_decode(@xml.xpath(ResponseXpath::REDIRECT).to_s)
124
+ end
125
+
126
+ def captured
127
+ @xml.xpath(ResponseXpath::CAPTURED).to_s != '1'
128
+ end
129
+
120
130
  def uri_decode(string)
121
- URI.decode(string).encode(Encoding::UTF_8, Encoding::CP932)
131
+ CGI.unescape(string).encode(Encoding::UTF_8, Encoding::CP932)
122
132
  end
123
133
 
124
134
  module ResponseXpath
@@ -146,6 +156,8 @@ module ActiveMerchant #:nodoc:
146
156
  ITEM_PRICE = '//Epsilon_result/result[@item_price]/@item_price'
147
157
  PAYMENT_CODE = '//Epsilon_result/result[@payment_code]/@payment_code'
148
158
  AMOUNT = '//Epsilon_result/result[@amount]/@amount'
159
+ REDIRECT = '//Epsilon_result/result[@redirect]/@redirect'
160
+ CAPTURED = '//Epsilon_result/result[@kari_flag]/@kari_flag'
149
161
  end
150
162
 
151
163
  module ResultCode
@@ -10,4 +10,5 @@ require_relative 'billing/gateways/epsilon'
10
10
  require_relative 'billing/gateways/epsilon_convenience_store'
11
11
  require_relative 'billing/gateways/epsilon_gmo_id'
12
12
  require_relative 'billing/gateways/epsilon_virtual_account'
13
+ require_relative 'billing/gateways/epsilon_link_payment'
13
14
  require_relative 'billing/gateways/response_parser'
@@ -1,5 +1,5 @@
1
1
  module ActiveMerchant
2
2
  module Epsilon
3
- VERSION = "0.9.1"
3
+ VERSION = "0.11.0"
4
4
  end
5
5
  end
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/sales_payment.cgi
6
+ body:
7
+ encoding: UTF-8
8
+ string: contract_code=[CONTRACT_CODE]&order_number=1234567890
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Connection:
13
+ - close
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Fri, 12 Jun 2020 11:00:12 GMT
27
+ Server:
28
+ - Apache
29
+ Connection:
30
+ - close
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Content-Type:
34
+ - text/xml; charset=CP932
35
+ body:
36
+ encoding: UTF-8
37
+ string: |-
38
+ <?xml version="1.0" encoding="x-sjis-cp932"?>
39
+ <Epsilon_result>
40
+ <result err_code="810" />
41
+ <result err_detail="%91%CE%8F%DB%8E%E6%88%F8%82%CD%82%A0%82%E8%82%DC%82%B9%82%F1" />
42
+ <result result="9" />
43
+ </Epsilon_result>
44
+ recorded_at: Fri, 12 Jun 2020 11:00:14 GMT
45
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/sales_payment.cgi
6
+ body:
7
+ encoding: UTF-8
8
+ string: contract_code=[CONTRACT_CODE]&order_number=O14289569
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Connection:
13
+ - close
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Fri, 12 Jun 2020 11:00:16 GMT
27
+ Server:
28
+ - Apache
29
+ Connection:
30
+ - close
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Content-Type:
34
+ - text/xml; charset=CP932
35
+ body:
36
+ encoding: UTF-8
37
+ string: |-
38
+ <?xml version="1.0" encoding="x-sjis-cp932"?>
39
+ <Epsilon_result>
40
+ <result err_code="" />
41
+ <result err_detail="" />
42
+ <result result="1" />
43
+ </Epsilon_result>
44
+ recorded_at: Fri, 12 Jun 2020 11:00:17 GMT
45
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/direct_card_payment.cgi
6
+ body:
7
+ encoding: UTF-8
8
+ string: contract_code=[CONTRACT_CODE]&user_id=U1591959614&user_name=YAMADA+Taro&user_mail_add=yamada-taro%40example.com&item_code=ITEM001&item_name=Greate+Product&order_number=O14289569&st_code=10000-0000-0000&mission_code=1&kari_flag=1&item_price=100&process_code=1&card_number=4242424242424242&expire_y=2021&expire_m=10&card_st_code=&pay_time=&tds_check_code=&user_agent=ActiveMerchant%3A%3AEpsilon-0.9.4&memo1=memo1&memo2=memo2
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Connection:
13
+ - close
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Fri, 12 Jun 2020 11:00:15 GMT
27
+ Server:
28
+ - Apache
29
+ Connection:
30
+ - close
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Content-Type:
34
+ - text/xml; charset=CP932
35
+ body:
36
+ encoding: UTF-8
37
+ string: |-
38
+ <?xml version="1.0" encoding="x-sjis-cp932"?>
39
+ <Epsilon_result>
40
+ <result acsurl="" />
41
+ <result err_code="" />
42
+ <result err_detail="" />
43
+ <result kari_flag="1" />
44
+ <result pareq="" />
45
+ <result result="1" />
46
+ <result trans_code="1362118" />
47
+ </Epsilon_result>
48
+ recorded_at: Fri, 12 Jun 2020 11:00:16 GMT
49
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,43 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/receive_order3.cgi
6
+ body:
7
+ encoding: UTF-8
8
+ string: contract_code=[CONTRACT_CODE]&user_id=U1594794779&user_name=%E5%B1%B1%E7%94%B0+%E5%A4%AA%E9%83%8E&user_mail_add=yamada-taro%40example.com&item_code=ITEM001&item_name=Greate+Product&order_number=O59578602&st_code=invalid_id&mission_code=1&item_price=10000&process_code=1&xml=1&delivery_code=99&consignee_postal=1000001&consignee_name=%E3%82%A4%E3%83%97%E3%82%B7%E3%83%AD%E3%83%B3%E3%82%BF%E3%83%AD%E3%82%A6&consignee_address=%E6%9D%B1%E4%BA%AC%E9%83%BD%E5%8D%83%E4%BB%A3%E7%94%B0%E5%8C%BA%E5%8D%83%E4%BB%A3%E7%94%B01%E7%95%AA1%E5%8F%B7&consignee_tel=0312345678&orderer_postal=1000001&orderer_name=YAMADA+Taro&orderer_address=%E6%9D%B1%E4%BA%AC%E9%83%BD%E5%8D%83%E4%BB%A3%E7%94%B0%E5%8C%BA%E5%8D%83%E4%BB%A3%E7%94%B01%E7%95%AA1%E5%8F%B7&orderer_tel=0312345678&memo1=memo1&memo2=memo2
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Connection:
13
+ - close
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Wed, 15 Jul 2020 06:32:59 GMT
27
+ Server:
28
+ - Apache
29
+ Connection:
30
+ - close
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Content-Type:
34
+ - text/xml
35
+ body:
36
+ encoding: UTF-8
37
+ string: "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n <Epsilon_result>\r\n
38
+ \ <result result=\"0\" />\r\n <result err_code=\"601\" />\r\n <result
39
+ err_detail=\"%8C%88%8D%CF%83R%81%5B%83h%82%CC%8Ew%92%E8%82%AA%88%D9%8F%ED%82%C5%82%B7\"
40
+ />\r\n <result memo1=\"memo1\" />\r\n <result memo2=\"memo2\" />\r\n
41
+ \ </Epsilon_result>\r\n"
42
+ recorded_at: Wed, 15 Jul 2020 06:33:00 GMT
43
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,44 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/receive_order3.cgi
6
+ body:
7
+ encoding: UTF-8
8
+ string: contract_code=[CONTRACT_CODE]&user_id=U1594794223&user_name=%E5%B1%B1%E7%94%B0+%E5%A4%AA%E9%83%8E&user_mail_add=yamada-taro%40example.com&item_code=ITEM001&item_name=Greate+Product&order_number=O43585140&st_code=00000-0000-01000-00000-00000-00000-00000&mission_code=1&item_price=10000&process_code=1&xml=1&delivery_code=99&consignee_postal=1000001&consignee_name=%E3%82%A4%E3%83%97%E3%82%B7%E3%83%AD%E3%83%B3%E3%82%BF%E3%83%AD%E3%82%A6&consignee_address=%E6%9D%B1%E4%BA%AC%E9%83%BD%E5%8D%83%E4%BB%A3%E7%94%B0%E5%8C%BA%E5%8D%83%E4%BB%A3%E7%94%B01%E7%95%AA1%E5%8F%B7&consignee_tel=0312345678&orderer_postal=1000001&orderer_name=YAMADA+Taro&orderer_address=%E6%9D%B1%E4%BA%AC%E9%83%BD%E5%8D%83%E4%BB%A3%E7%94%B0%E5%8C%BA%E5%8D%83%E4%BB%A3%E7%94%B01%E7%95%AA1%E5%8F%B7&orderer_tel=0312345678&memo1=memo1&memo2=memo2
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Connection:
13
+ - close
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Wed, 15 Jul 2020 06:23:43 GMT
27
+ Server:
28
+ - Apache
29
+ Connection:
30
+ - close
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Content-Type:
34
+ - text/xml
35
+ body:
36
+ encoding: UTF-8
37
+ string: |
38
+ <?xml version="1.0" encoding="UTF-8" ?>
39
+ <Epsilon_result>
40
+ <result result="1" />
41
+ <result redirect="https%3A%2F%2Fbeta.epsilon.jp%2Fcgi-bin%2Forder%2Fmethod_select3.cgi%3Ftrans_code%3D1Mj2rD9EYR099" />
42
+ </Epsilon_result>
43
+ recorded_at: Wed, 15 Jul 2020 06:23:44 GMT
44
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/cancel_payment.cgi
6
+ body:
7
+ encoding: UTF-8
8
+ string: contract_code=&order_number=invalid_order_number
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Connection:
13
+ - close
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Mon, 20 Jul 2020 02:48:28 GMT
27
+ Server:
28
+ - Apache
29
+ Connection:
30
+ - close
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Content-Type:
34
+ - text/xml; charset=CP932
35
+ body:
36
+ encoding: UTF-8
37
+ string: |-
38
+ <?xml version="1.0" encoding="x-sjis-cp932"?>
39
+ <Epsilon_result>
40
+ <result err_code="607" />
41
+ <result err_detail="%8C_%96%F1%83R%81%5B%83h%8C%60%8E%AE%83G%83%89%81%5B" />
42
+ <result result="9" />
43
+ </Epsilon_result>
44
+ recorded_at: Mon, 20 Jul 2020 02:48:29 GMT
45
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/cancel_payment.cgi
6
+ body:
7
+ encoding: UTF-8
8
+ string: contract_code=[CONTRACT_CODE]&order_number=595213151
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Connection:
13
+ - close
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Mon, 20 Jul 2020 02:56:42 GMT
27
+ Server:
28
+ - Apache
29
+ Connection:
30
+ - close
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Content-Type:
34
+ - text/xml; charset=CP932
35
+ body:
36
+ encoding: UTF-8
37
+ string: |-
38
+ <?xml version="1.0" encoding="x-sjis-cp932"?>
39
+ <Epsilon_result>
40
+ <result err_code="" />
41
+ <result err_detail="" />
42
+ <result result="1" />
43
+ </Epsilon_result>
44
+ recorded_at: Mon, 20 Jul 2020 02:56:43 GMT
45
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,44 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/receive_order3.cgi
6
+ body:
7
+ encoding: UTF-8
8
+ string: contract_code=[CONTRACT_CODE]&user_id=&user_name=%E5%B1%B1%E7%94%B0+%E5%A4%AA%E9%83%8E&user_mail_add=yamada-taro%40example.com&item_code=ITEM001&item_name=Greate+Product&order_number=O666431&st_code=00000-0000-00000-00010-00000-00000-00000&mission_code=1&item_price=10000&process_code=1&xml=1&delivery_code=99&consignee_postal=1000001&consignee_name=%E3%82%A4%E3%83%97%E3%82%B7%E3%83%AD%E3%83%B3%E3%82%BF%E3%83%AD%E3%82%A6&consignee_address=%E6%9D%B1%E4%BA%AC%E9%83%BD%E5%8D%83%E4%BB%A3%E7%94%B0%E5%8C%BA%E5%8D%83%E4%BB%A3%E7%94%B01%E7%95%AA1%E5%8F%B7&consignee_tel=0312345678&orderer_postal=1000001&orderer_name=YAMADA+Taro&orderer_address=%E6%9D%B1%E4%BA%AC%E9%83%BD%E5%8D%83%E4%BB%A3%E7%94%B0%E5%8C%BA%E5%8D%83%E4%BB%A3%E7%94%B01%E7%95%AA1%E5%8F%B7&orderer_tel=0312345678&memo1=memo1&memo2=memo2&user_tel=0312345678
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Connection:
13
+ - close
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Wed, 18 Mar 2020 05:58:06 GMT
27
+ Server:
28
+ - Apache
29
+ Connection:
30
+ - close
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Content-Type:
34
+ - text/xml
35
+ body:
36
+ encoding: UTF-8
37
+ string: "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n <Epsilon_result>\r\n
38
+ \ <result result=\"0\" />\r\n <result err_code=\"601\" />\r\n <result
39
+ err_detail=\"%83%86%81%5B%83U%81%5BID%82%CC%8C%60%8E%AE%82%AA%88%D9%8F%ED%82%C5%82%B7\"
40
+ />\r\n <result memo1=\"memo1\" />\r\n <result memo2=\"memo2\" />\r\n
41
+ \ </Epsilon_result>\r\n"
42
+ http_version: null
43
+ recorded_at: Wed, 18 Mar 2020 05:58:07 GMT
44
+ recorded_with: VCR 5.1.0
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/receive_order3.cgi
6
+ body:
7
+ encoding: UTF-8
8
+ string: contract_code=[CONTRACT_CODE]&user_id=U1584510803&user_name=%E5%B1%B1%E7%94%B0+%E5%A4%AA%E9%83%8E&user_mail_add=yamada-taro%40example.com&item_code=ITEM001&item_name=Greate+Product&order_number=O23603867&st_code=00000-0000-00000-00010-00000-00000-00000&mission_code=1&item_price=10000&process_code=1&xml=1&delivery_code=99&consignee_postal=1000001&consignee_name=%E3%82%A4%E3%83%97%E3%82%B7%E3%83%AD%E3%83%B3%E3%82%BF%E3%83%AD%E3%82%A6&consignee_address=%E6%9D%B1%E4%BA%AC%E9%83%BD%E5%8D%83%E4%BB%A3%E7%94%B0%E5%8C%BA%E5%8D%83%E4%BB%A3%E7%94%B01%E7%95%AA1%E5%8F%B7&consignee_tel=0312345678&orderer_postal=1000001&orderer_name=YAMADA+Taro&orderer_address=%E6%9D%B1%E4%BA%AC%E9%83%BD%E5%8D%83%E4%BB%A3%E7%94%B0%E5%8C%BA%E5%8D%83%E4%BB%A3%E7%94%B01%E7%95%AA1%E5%8F%B7&orderer_tel=0312345678&memo1=memo1&memo2=memo2&user_tel=0312345678
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Connection:
13
+ - close
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Wed, 18 Mar 2020 05:53:23 GMT
27
+ Server:
28
+ - Apache
29
+ Connection:
30
+ - close
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Content-Type:
34
+ - text/xml
35
+ body:
36
+ encoding: UTF-8
37
+ string: |
38
+ <?xml version="1.0" encoding="UTF-8" ?>
39
+ <Epsilon_result>
40
+ <result result="1" />
41
+ <result redirect="https%3A%2F%2Fbeta.epsilon.jp%2Fcgi-bin%2Forder%2Fmethod_select3.cgi%3Ftrans_code%3DITL3uKDMlWg41" />
42
+ </Epsilon_result>
43
+ http_version: null
44
+ recorded_at: Wed, 18 Mar 2020 05:53:25 GMT
45
+ recorded_with: VCR 5.1.0
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/direct_card_payment.cgi
6
+ body:
7
+ encoding: UTF-8
8
+ string: contract_code=[CONTRACT_CODE]&user_id=U1591960355&user_name=YAMADA+Taro&user_mail_add=yamada-taro%40example.com&item_code=ITEM001&item_name=Greate+Product&order_number=O35284193&st_code=10000-0000-0000&mission_code=1&item_price=1000&process_code=1&card_number=4242424242424242&expire_y=2021&expire_m=10&card_st_code=&pay_time=&tds_check_code=&user_agent=ActiveMerchant%3A%3AEpsilon-0.9.4&memo1=memo1&memo2=memo2&kari_flag=1
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Connection:
13
+ - close
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Fri, 12 Jun 2020 11:12:35 GMT
27
+ Server:
28
+ - Apache
29
+ Connection:
30
+ - close
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Content-Type:
34
+ - text/xml; charset=CP932
35
+ body:
36
+ encoding: UTF-8
37
+ string: |-
38
+ <?xml version="1.0" encoding="x-sjis-cp932"?>
39
+ <Epsilon_result>
40
+ <result acsurl="" />
41
+ <result err_code="" />
42
+ <result err_detail="" />
43
+ <result kari_flag="1" />
44
+ <result pareq="" />
45
+ <result result="1" />
46
+ <result trans_code="1362123" />
47
+ </Epsilon_result>
48
+ recorded_at: Fri, 12 Jun 2020 11:12:37 GMT
49
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/direct_card_payment.cgi
6
+ body:
7
+ encoding: UTF-8
8
+ string: contract_code=[CONTRACT_CODE]&user_id=U1591960357&user_name=YAMADA+Taro&user_mail_add=yamada-taro%40example.com&item_code=ITEM001&item_name=Greate+Product&order_number=O37368550&st_code=10000-0000-0000&mission_code=1&item_price=1000&process_code=1&card_number=4242424242424242&expire_y=2021&expire_m=10&card_st_code=&pay_time=&tds_check_code=&user_agent=ActiveMerchant%3A%3AEpsilon-0.9.4&memo1=memo1&memo2=memo2&kari_flag=2
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Connection:
13
+ - close
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Fri, 12 Jun 2020 11:12:37 GMT
27
+ Server:
28
+ - Apache
29
+ Connection:
30
+ - close
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Content-Type:
34
+ - text/xml; charset=CP932
35
+ body:
36
+ encoding: UTF-8
37
+ string: |-
38
+ <?xml version="1.0" encoding="x-sjis-cp932"?>
39
+ <Epsilon_result>
40
+ <result acsurl="" />
41
+ <result err_code="" />
42
+ <result err_detail="" />
43
+ <result kari_flag="0" />
44
+ <result pareq="" />
45
+ <result result="1" />
46
+ <result trans_code="1362124" />
47
+ </Epsilon_result>
48
+ recorded_at: Fri, 12 Jun 2020 11:12:39 GMT
49
+ recorded_with: VCR 6.0.0
@@ -24,6 +24,7 @@ class RemoteEpsilonConvenienceStoreGatewayTest < MiniTest::Test
24
24
  VCR.use_cassette(:convenience_store_purchase_fail) do
25
25
  response = gateway.purchase(10000, invalid_convenience_store, purchase_detail)
26
26
  assert_equal false, response.success?
27
+ assert_equal true, response.params["error_detail"].valid_encoding?
27
28
  end
28
29
  end
29
30
  end
@@ -0,0 +1,30 @@
1
+ require 'test_helper'
2
+
3
+ class RemoteEpsilonGmoAfterGatewayTest < MiniTest::Test
4
+ include SamplePaymentMethods
5
+
6
+ def gateway
7
+ @gateway ||= ActiveMerchant::Billing::EpsilonGmoAfterGateway.new
8
+ end
9
+
10
+ def test_gmo_after_purchase_successfull
11
+ VCR.use_cassette(:gmo_after_purchase_successful) do
12
+ response = gateway.purchase(10000, gmo_after_purchase_detail)
13
+
14
+ assert_equal true, response.success?
15
+ assert_equal true, !response.params['redirect'].empty?
16
+ end
17
+ end
18
+
19
+ def test_gmo_after_purchase_fail
20
+ invalid_purchase_detail = gmo_after_purchase_detail
21
+ invalid_purchase_detail[:user_id] = ''
22
+
23
+ VCR.use_cassette(:gmo_after_purchase_fail) do
24
+ response = gateway.purchase(10000, invalid_purchase_detail)
25
+
26
+ assert_equal false, response.success?
27
+ assert_equal true, response.params["error_detail"].valid_encoding?
28
+ end
29
+ end
30
+ end
@@ -20,6 +20,7 @@ class RemoteEpsilonGmoIdGatewayTest < MiniTest::Test
20
20
  detail = invalid_gmo_id_purchase_detail
21
21
  response = gateway.purchase(200, detail)
22
22
  assert_equal false, response.success?
23
+ assert_equal true, response.params["error_detail"].valid_encoding?
23
24
  end
24
25
  end
25
26
 
@@ -0,0 +1,46 @@
1
+ require 'test_helper'
2
+ class RemoteEpsilonLinkPaymentTest < MiniTest::Test
3
+ include SamplePaymentMethods
4
+
5
+ def gateway
6
+ @gateway ||= ActiveMerchant::Billing::EpsilonLinkPaymentGateway.new
7
+ end
8
+
9
+ def test_epsilon_link_type_purchase_successfull
10
+ VCR.use_cassette(:epsilon_link_type_purchase_successfull) do
11
+ response = gateway.purchase(10000, valid_epsilon_link_type_purchase_detail)
12
+
13
+ assert_equal true, response.success?
14
+ assert_equal true, !response.params['redirect'].empty?
15
+ end
16
+ end
17
+
18
+ def test_epsilon_link_type_purchase_fail
19
+ VCR.use_cassette(:epsilon_link_type_purchase_fail) do
20
+ response = gateway.purchase(10000, invalid_epsilon_link_type_purchase_detail)
21
+
22
+ assert_equal false, response.success?
23
+ assert_equal true, response.params["error_detail"].valid_encoding?
24
+ end
25
+ end
26
+
27
+ def test_epsilon_link_type_void_successfull
28
+ VCR.use_cassette(:epsilon_link_type_void_successfull) do
29
+ # あらかじめ課金済ステータスの受注がイプシロン側にないと取り消しができないため、課金済の受注をイプシロン側で作成しておいた。
30
+ # ここでは void の引数として作成済の受注のorder_numberを渡している。
31
+ # VCRのキャッシュを作成し直す場合は変更しないとエラーとなる。
32
+ response = gateway.void('595213151')
33
+
34
+ assert_equal true, response.success?
35
+ end
36
+ end
37
+
38
+ def test_epsilon_link_type_void_fail
39
+ VCR.use_cassette(:epsilon_link_type_void_fail) do
40
+ response = gateway.void('invalid_order_number')
41
+
42
+ assert_equal false, response.success?
43
+ assert_equal true, response.params["error_detail"].valid_encoding?
44
+ end
45
+ end
46
+ end
@@ -72,10 +72,29 @@ class RemoteEpsilonGatewayTest < MiniTest::Test
72
72
  end
73
73
  end
74
74
 
75
+ def test_purchase_with_capture_true_successful
76
+ VCR.use_cassette(:purchase_with_capture_true_successful) do
77
+ response = gateway.purchase(1000, valid_credit_card, purchase_detail.merge(capture: true))
78
+
79
+ assert_equal true, response.success?
80
+ assert_equal true, response.params['captured']
81
+ end
82
+ end
83
+
84
+ def test_purchase_with_capture_false_successful
85
+ VCR.use_cassette(:purchase_with_capture_false_successful) do
86
+ response = gateway.purchase(1000, valid_credit_card, purchase_detail.merge(capture: false))
87
+
88
+ assert_equal true, response.success?
89
+ assert_equal false, response.params['captured']
90
+ end
91
+ end
92
+
75
93
  def test_purchase_fail
76
94
  VCR.use_cassette(:purchase_fail) do
77
95
  response = gateway.purchase(10000, invalid_credit_card, purchase_detail)
78
96
  assert_equal false, response.success?
97
+ assert_equal true, response.params["error_detail"].valid_encoding?
79
98
  end
80
99
  end
81
100
 
@@ -138,6 +157,7 @@ class RemoteEpsilonGatewayTest < MiniTest::Test
138
157
  )
139
158
 
140
159
  assert_equal false, response.success?
160
+ assert_equal true, response.params["error_detail"].valid_encoding?
141
161
  end
142
162
  end
143
163
 
@@ -239,6 +259,7 @@ class RemoteEpsilonGatewayTest < MiniTest::Test
239
259
  invalid_purchase_detail[:user_id] = ''
240
260
  response = gateway.registered_purchase(10000, invalid_purchase_detail)
241
261
  assert_equal false, response.success?
262
+ assert_equal true, response.params["error_detail"].valid_encoding?
242
263
  end
243
264
  end
244
265
 
@@ -283,4 +304,27 @@ class RemoteEpsilonGatewayTest < MiniTest::Test
283
304
  assert_equal false, response.success?
284
305
  end
285
306
  end
307
+
308
+ def test_capture_success
309
+ detail = purchase_detail
310
+
311
+ VCR.use_cassette(:capture_success_authorize) do
312
+ purchase_response = gateway.purchase(100, valid_credit_card, detail.merge(capture: false))
313
+
314
+ assert_equal true, purchase_response.success?
315
+ assert_equal false, purchase_response.params['captured']
316
+ end
317
+
318
+ VCR.use_cassette(:capture_success) do
319
+ response = gateway.capture(detail[:order_number])
320
+ assert_equal true, response.success?
321
+ end
322
+ end
323
+
324
+ def test_capture_failure
325
+ VCR.use_cassette(:capture_failure) do
326
+ response = gateway.capture('1234567890')
327
+ assert_equal false, response.success?
328
+ end
329
+ end
286
330
  end
@@ -31,6 +31,7 @@ class RemoteEpsilonVirtualAccountGatewayTest < MiniTest::Test
31
31
  VCR.use_cassette(:virtual_account_purchase_fail) do
32
32
  response = gateway.purchase(10000, invalid_purchase_detail)
33
33
  assert_equal false, response.success?
34
+ assert_equal true, response.params["error_detail"].valid_encoding?
34
35
  end
35
36
  end
36
- end
37
+ end
@@ -9,7 +9,7 @@ require 'tapp'
9
9
  require 'vcr'
10
10
 
11
11
  require 'webmock/minitest'
12
- require 'mocha/mini_test'
12
+ require 'mocha/minitest'
13
13
 
14
14
  Dotenv.load
15
15
 
@@ -206,6 +206,76 @@ module SamplePaymentMethods
206
206
  }
207
207
  end
208
208
 
209
+ def gmo_after_purchase_detail
210
+ now = Time.now
211
+ {
212
+ user_id: "U#{Time.now.to_i}",
213
+ user_name: '山田 太郎',
214
+ user_email: 'yamada-taro@example.com',
215
+ user_tel: '0312345678',
216
+ item_code: 'ITEM001',
217
+ item_name: 'Greate Product',
218
+ order_number: "O#{now.sec}#{now.usec}",
219
+ st_code: '00000-0000-00000-00010-00000-00000-00000',
220
+ memo1: 'memo1',
221
+ memo2: 'memo2',
222
+ consignee_postal: '1000001',
223
+ consignee_name: 'イプシロンタロウ',
224
+ consignee_address: '東京都千代田区千代田1番1号',
225
+ consignee_tel: '0312345678',
226
+ orderer_postal: '1000001',
227
+ orderer_name: 'YAMADA Taro',
228
+ orderer_address: '東京都千代田区千代田1番1号',
229
+ orderer_tel: '0312345678',
230
+ }
231
+ end
232
+
233
+ def valid_epsilon_link_type_purchase_detail
234
+ now = Time.now
235
+ {
236
+ user_id: "U#{Time.now.to_i}",
237
+ user_name: '山田 太郎',
238
+ user_email: 'yamada-taro@example.com',
239
+ item_code: 'ITEM001',
240
+ item_name: 'Greate Product',
241
+ order_number: "O#{now.sec}#{now.usec}",
242
+ st_code: '00000-0000-01000-00000-00000-00000-00000',
243
+ memo1: 'memo1',
244
+ memo2: 'memo2',
245
+ consignee_postal: '1000001',
246
+ consignee_name: 'イプシロンタロウ',
247
+ consignee_address: '東京都千代田区千代田1番1号',
248
+ consignee_tel: '0312345678',
249
+ orderer_postal: '1000001',
250
+ orderer_name: 'YAMADA Taro',
251
+ orderer_address: '東京都千代田区千代田1番1号',
252
+ orderer_tel: '0312345678',
253
+ }
254
+ end
255
+
256
+ def invalid_epsilon_link_type_purchase_detail
257
+ now = Time.now
258
+ {
259
+ user_id: "U#{Time.now.to_i}",
260
+ user_name: '山田 太郎',
261
+ user_email: 'yamada-taro@example.com',
262
+ item_code: 'ITEM001',
263
+ item_name: 'Greate Product',
264
+ order_number: "O#{now.sec}#{now.usec}",
265
+ st_code: 'invalid_id',
266
+ memo1: 'memo1',
267
+ memo2: 'memo2',
268
+ consignee_postal: '1000001',
269
+ consignee_name: 'イプシロンタロウ',
270
+ consignee_address: '東京都千代田区千代田1番1号',
271
+ consignee_tel: '0312345678',
272
+ orderer_postal: '1000001',
273
+ orderer_name: 'YAMADA Taro',
274
+ orderer_address: '東京都千代田区千代田1番1号',
275
+ orderer_tel: '0312345678',
276
+ }
277
+ end
278
+
209
279
  def fixture_xml(filename, parse: true)
210
280
  xml = File.read("test/fixtures/#{filename}")
211
281
  parse ? Nokogiri.parse(xml.sub('x-sjis-cp932', 'CP932')) : xml
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_merchant-epsilon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenichi TAKAHASHI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-26 00:00:00.000000000 Z
11
+ date: 2020-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.66.0
19
+ version: '1.88'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.66.0
26
+ version: '1.88'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.7'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.7'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: dotenv
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '10.0'
89
+ version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '10.0'
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: tapp
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -173,6 +173,7 @@ files:
173
173
  - lib/active_merchant/billing/gateways/epsilon/epsilon_process_code.rb
174
174
  - lib/active_merchant/billing/gateways/epsilon_convenience_store.rb
175
175
  - lib/active_merchant/billing/gateways/epsilon_gmo_id.rb
176
+ - lib/active_merchant/billing/gateways/epsilon_link_payment.rb
176
177
  - lib/active_merchant/billing/gateways/epsilon_virtual_account.rb
177
178
  - lib/active_merchant/billing/gateways/response_parser.rb
178
179
  - lib/active_merchant/epsilon.rb
@@ -180,14 +181,23 @@ files:
180
181
  - test/fixtures/vcr_cassettes/autheticate_three_d_secure_card_successful.yml
181
182
  - test/fixtures/vcr_cassettes/cancel_recurring_fail.yml
182
183
  - test/fixtures/vcr_cassettes/cancel_recurring_successful.yml
184
+ - test/fixtures/vcr_cassettes/capture_failure.yml
185
+ - test/fixtures/vcr_cassettes/capture_success.yml
186
+ - test/fixtures/vcr_cassettes/capture_success_authorize.yml
183
187
  - test/fixtures/vcr_cassettes/change_recurring_amount_failure.yml
184
188
  - test/fixtures/vcr_cassettes/change_recurring_amount_successful.yml
185
189
  - test/fixtures/vcr_cassettes/convenience_store_purchase_fail.yml
186
190
  - test/fixtures/vcr_cassettes/convenience_store_purchase_successful.yml
191
+ - test/fixtures/vcr_cassettes/epsilon_link_type_purchase_fail.yml
192
+ - test/fixtures/vcr_cassettes/epsilon_link_type_purchase_successfull.yml
193
+ - test/fixtures/vcr_cassettes/epsilon_link_type_void_fail.yml
194
+ - test/fixtures/vcr_cassettes/epsilon_link_type_void_successfull.yml
187
195
  - test/fixtures/vcr_cassettes/find_order_failure.yml
188
196
  - test/fixtures/vcr_cassettes/find_order_success.yml
189
197
  - test/fixtures/vcr_cassettes/find_user_failure.yml
190
198
  - test/fixtures/vcr_cassettes/find_user_success.yml
199
+ - test/fixtures/vcr_cassettes/gmo_after_purchase_fail.yml
200
+ - test/fixtures/vcr_cassettes/gmo_after_purchase_successful.yml
191
201
  - test/fixtures/vcr_cassettes/gmo_id_purchase_failure.yml
192
202
  - test/fixtures/vcr_cassettes/gmo_id_purchase_successful.yml
193
203
  - test/fixtures/vcr_cassettes/gmo_id_void_faiure.yml
@@ -195,6 +205,8 @@ files:
195
205
  - test/fixtures/vcr_cassettes/installment_purchase_successful.yml
196
206
  - test/fixtures/vcr_cassettes/purchase_fail.yml
197
207
  - test/fixtures/vcr_cassettes/purchase_successful.yml
208
+ - test/fixtures/vcr_cassettes/purchase_with_capture_false_successful.yml
209
+ - test/fixtures/vcr_cassettes/purchase_with_capture_true_successful.yml
198
210
  - test/fixtures/vcr_cassettes/purchase_with_three_d_secure_card_successful.yml
199
211
  - test/fixtures/vcr_cassettes/purchase_with_verification_value.yml
200
212
  - test/fixtures/vcr_cassettes/recurring_fail.yml
@@ -215,7 +227,9 @@ files:
215
227
  - test/fixtures/vcr_cassettes/void_fail.yml
216
228
  - test/fixtures/vcr_cassettes/void_successful.yml
217
229
  - test/remote/gateways/remote_epsilon_convenience_store_test.rb
230
+ - test/remote/gateways/remote_epsilon_gmo_after_test.rb
218
231
  - test/remote/gateways/remote_epsilon_gmo_id_test.rb
232
+ - test/remote/gateways/remote_epsilon_link_payment_test.rb
219
233
  - test/remote/gateways/remote_epsilon_test.rb
220
234
  - test/remote/gateways/remote_epsilon_virtual_account_test.rb
221
235
  - test/test_helper.rb
@@ -240,8 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
240
254
  - !ruby/object:Gem::Version
241
255
  version: '0'
242
256
  requirements: []
243
- rubyforge_project:
244
- rubygems_version: 2.5.1
257
+ rubygems_version: 3.0.3
245
258
  signing_key:
246
259
  specification_version: 4
247
260
  summary: Epsilon integration for ActiveMerchant.
@@ -249,14 +262,23 @@ test_files:
249
262
  - test/fixtures/vcr_cassettes/autheticate_three_d_secure_card_successful.yml
250
263
  - test/fixtures/vcr_cassettes/cancel_recurring_fail.yml
251
264
  - test/fixtures/vcr_cassettes/cancel_recurring_successful.yml
265
+ - test/fixtures/vcr_cassettes/capture_failure.yml
266
+ - test/fixtures/vcr_cassettes/capture_success.yml
267
+ - test/fixtures/vcr_cassettes/capture_success_authorize.yml
252
268
  - test/fixtures/vcr_cassettes/change_recurring_amount_failure.yml
253
269
  - test/fixtures/vcr_cassettes/change_recurring_amount_successful.yml
254
270
  - test/fixtures/vcr_cassettes/convenience_store_purchase_fail.yml
255
271
  - test/fixtures/vcr_cassettes/convenience_store_purchase_successful.yml
272
+ - test/fixtures/vcr_cassettes/epsilon_link_type_purchase_fail.yml
273
+ - test/fixtures/vcr_cassettes/epsilon_link_type_purchase_successfull.yml
274
+ - test/fixtures/vcr_cassettes/epsilon_link_type_void_fail.yml
275
+ - test/fixtures/vcr_cassettes/epsilon_link_type_void_successfull.yml
256
276
  - test/fixtures/vcr_cassettes/find_order_failure.yml
257
277
  - test/fixtures/vcr_cassettes/find_order_success.yml
258
278
  - test/fixtures/vcr_cassettes/find_user_failure.yml
259
279
  - test/fixtures/vcr_cassettes/find_user_success.yml
280
+ - test/fixtures/vcr_cassettes/gmo_after_purchase_fail.yml
281
+ - test/fixtures/vcr_cassettes/gmo_after_purchase_successful.yml
260
282
  - test/fixtures/vcr_cassettes/gmo_id_purchase_failure.yml
261
283
  - test/fixtures/vcr_cassettes/gmo_id_purchase_successful.yml
262
284
  - test/fixtures/vcr_cassettes/gmo_id_void_faiure.yml
@@ -264,6 +286,8 @@ test_files:
264
286
  - test/fixtures/vcr_cassettes/installment_purchase_successful.yml
265
287
  - test/fixtures/vcr_cassettes/purchase_fail.yml
266
288
  - test/fixtures/vcr_cassettes/purchase_successful.yml
289
+ - test/fixtures/vcr_cassettes/purchase_with_capture_false_successful.yml
290
+ - test/fixtures/vcr_cassettes/purchase_with_capture_true_successful.yml
267
291
  - test/fixtures/vcr_cassettes/purchase_with_three_d_secure_card_successful.yml
268
292
  - test/fixtures/vcr_cassettes/purchase_with_verification_value.yml
269
293
  - test/fixtures/vcr_cassettes/recurring_fail.yml
@@ -284,7 +308,9 @@ test_files:
284
308
  - test/fixtures/vcr_cassettes/void_fail.yml
285
309
  - test/fixtures/vcr_cassettes/void_successful.yml
286
310
  - test/remote/gateways/remote_epsilon_convenience_store_test.rb
311
+ - test/remote/gateways/remote_epsilon_gmo_after_test.rb
287
312
  - test/remote/gateways/remote_epsilon_gmo_id_test.rb
313
+ - test/remote/gateways/remote_epsilon_link_payment_test.rb
288
314
  - test/remote/gateways/remote_epsilon_test.rb
289
315
  - test/remote/gateways/remote_epsilon_virtual_account_test.rb
290
316
  - test/test_helper.rb