active_merchant-epsilon 0.13.0 → 0.15.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.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +7 -4
- data/CHANGELOG.md +8 -0
- data/README.md +53 -2
- data/lib/active_merchant/billing/gateways/epsilon/epsilon_base.rb +1 -0
- data/lib/active_merchant/billing/gateways/epsilon/epsilon_risk_base_auth_params.rb +25 -0
- data/lib/active_merchant/billing/gateways/epsilon.rb +12 -0
- data/lib/active_merchant/billing/gateways/epsilon_link_payment.rb +10 -0
- data/lib/active_merchant/billing/gateways/response_parser.rb +12 -6
- data/lib/active_merchant/epsilon/version.rb +1 -1
- data/lib/active_merchant/epsilon.rb +1 -0
- data/test/fixtures/vcr_cassettes/authenticate_with_three_d_secure_2_successful.yml +51 -0
- data/test/fixtures/vcr_cassettes/epsilon_link_type_with_3d_secure.yml +48 -0
- data/test/fixtures/vcr_cassettes/purchase_with_three_d_secure_2_successful.yml +51 -0
- data/test/remote/gateways/remote_epsilon_convenience_store_test.rb +1 -1
- data/test/remote/gateways/remote_epsilon_gmo_id_test.rb +1 -1
- data/test/remote/gateways/remote_epsilon_link_payment_test.rb +11 -1
- data/test/remote/gateways/remote_epsilon_test.rb +53 -1
- data/test/remote/gateways/remote_epsilon_virtual_account_test.rb +1 -1
- data/test/test_helper.rb +44 -1
- data/test/unit/billing/convenience_store_test.rb +1 -1
- data/test/unit/gateways/epsilon_test.rb +1 -1
- metadata +10 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91e76e51445d095695e77bdd56b88062b52afcfe35c48b4c6eb4e9d890f6bc0b
|
4
|
+
data.tar.gz: 51a731fc40d31bc182ce462ff041d5aeb9ed833095f8caffcd6b3b962e958e52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 368556d657fc83e9912def82af6a5040c19d53ed9249444e42ca4a61c1a30c2186a0d5af52f80a121e2b1f9ea052fa13878bca35474ca4a7e5bc4755c9ba8ea0
|
7
|
+
data.tar.gz: bb51f853bd5be0c7560ff902a63d1b168bbadbd9cb7ecc92b7451c006b7e4302651c81c62b89099306ad50cb0749e2301f92e04d6896953462febd22f8cecb0e
|
data/.github/workflows/test.yml
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
name: test
|
2
|
-
on:
|
3
|
-
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- master
|
6
|
+
pull_request:
|
4
7
|
jobs:
|
5
8
|
test-all:
|
6
9
|
runs-on: ubuntu-latest
|
@@ -8,12 +11,12 @@ jobs:
|
|
8
11
|
strategy:
|
9
12
|
fail-fast: false
|
10
13
|
matrix:
|
11
|
-
ruby-version: [
|
14
|
+
ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4.0-preview1']
|
12
15
|
|
13
16
|
steps:
|
14
17
|
- uses: actions/checkout@v2
|
15
18
|
|
16
|
-
- uses: ruby/setup-ruby@v1
|
19
|
+
- uses: ruby/setup-ruby@v1
|
17
20
|
with:
|
18
21
|
ruby-version: ${{ matrix.ruby-version }}
|
19
22
|
bundler-cache: true
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
### 0.15.0
|
4
|
+
|
5
|
+
- [Support 3D Secure parameters for link type payments](https://github.com/pepabo/active_merchant-epsilon/pull/131)
|
6
|
+
|
7
|
+
### 0.14.0
|
8
|
+
|
9
|
+
- [Support 3D Secure 2.0 for credit card payments](https://github.com/pepabo/active_merchant-epsilon/pull/121)
|
10
|
+
|
3
11
|
### 0.13.0
|
4
12
|
|
5
13
|
- [Add `last-update` to OrderResponse](https://github.com/pepabo/active_merchant-epsilon/pull/118)
|
data/README.md
CHANGED
@@ -127,8 +127,8 @@ end
|
|
127
127
|
# AND SECOND REQUEST
|
128
128
|
|
129
129
|
response = gateway.authenticate(
|
130
|
-
order_number:
|
131
|
-
|
130
|
+
order_number: 'ORDER NUMBER',
|
131
|
+
three_d_secure_pa_res: 'PAYMENT AUTHENTICATION RESPONSE',
|
132
132
|
)
|
133
133
|
|
134
134
|
if response.success?
|
@@ -159,6 +159,57 @@ purchase_detail = {
|
|
159
159
|
# (snip)
|
160
160
|
```
|
161
161
|
|
162
|
+
### CreditCard Payment with 3D secure 2.0(with token)
|
163
|
+
|
164
|
+
```ruby
|
165
|
+
# 3D secure 2.0 does not have a test environment for epsilon
|
166
|
+
ActiveMerchant::Billing::Base.mode = :production
|
167
|
+
|
168
|
+
amount = 1000
|
169
|
+
purchase_detail = {
|
170
|
+
user_id: 'YOUR_APP_USER_IDENTIFIER',
|
171
|
+
user_name: '山田 太郎',
|
172
|
+
user_email: 'yamada-taro@example.com',
|
173
|
+
item_code: 'ITEM001',
|
174
|
+
item_name: 'Greate Product',
|
175
|
+
order_number: 'UNIQUE ORDER NUMBER',
|
176
|
+
three_d_secure_check_code: 1,
|
177
|
+
token: 'CREDIT CARD TOKEN'
|
178
|
+
tds_flag: 21 # 21 or 22
|
179
|
+
# optional:
|
180
|
+
# add params for risk-based certification(billAddrCity etc...)
|
181
|
+
}
|
182
|
+
|
183
|
+
response = gateway.purchase(amount, ActiveMerchant::Billing::CreditCard.new, purchase_detail)
|
184
|
+
|
185
|
+
if response.success?
|
186
|
+
if response.params['three_d_secure']
|
187
|
+
puts response.params['tds2_url']
|
188
|
+
puts response.params['pa_req']
|
189
|
+
else
|
190
|
+
# NOT 3D SECURE
|
191
|
+
puts "Successfully charged #{amount} yen as credit card payment(not 3D secure)"
|
192
|
+
end
|
193
|
+
else
|
194
|
+
raise StandardError, response.message
|
195
|
+
end
|
196
|
+
|
197
|
+
# (The card holder identifies himself on credit card's page and comes back here)
|
198
|
+
|
199
|
+
# AND SECOND REQUEST
|
200
|
+
|
201
|
+
response = gateway.authenticate(
|
202
|
+
order_number: 'ORDER NUMBER',
|
203
|
+
three_d_secure_pa_res: 'PAYMENT AUTHENTICATION RESPONSE',
|
204
|
+
)
|
205
|
+
|
206
|
+
if response.success?
|
207
|
+
puts 'Successfully charged as credit card payment(3D secure 2.0)'
|
208
|
+
else
|
209
|
+
raise StandardError, response.message
|
210
|
+
end
|
211
|
+
```
|
212
|
+
|
162
213
|
### CreditCard Revolving Payment
|
163
214
|
|
164
215
|
```ruby
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
module EpsilonRiskBaseAuthParams
|
4
|
+
KEYS = %i[
|
5
|
+
tds_flag billAddrCity billAddrCountry billAddrLine1 billAddrLine2 billAddrLine3
|
6
|
+
billAddrPostCode billAddrState shipAddrCity shipAddrCountry shipAddrLine1 shipAddrLine2
|
7
|
+
shipAddrLine3 shipAddrPostCode shipAddrState chAccAgeInd chAccChange
|
8
|
+
chAccChangeIndchAccDate chAccPwdChange chAccPwChangeInd nbPurchaseAccount paymentAccAge
|
9
|
+
paymentAccInd provisionAttemptsDay shipAddressUsage shipAddressUsageInd shipNameIndicator
|
10
|
+
suspiciousAccActivity txnActivityDay txnActivityYear threeDSReqAuthData threeDSReqAuthMethod
|
11
|
+
threeDSReqAuthTimestamp addrMatch cardholderName homePhone mobilePhone
|
12
|
+
workPhone challengeInd deliveryEmailAddress deliveryTimeframe giftCardAmount
|
13
|
+
giftCardCount preOrderDate preOrderPurchaseInd reorderItemsInd shipIndicator
|
14
|
+
].freeze
|
15
|
+
|
16
|
+
THREE_D_SECURE_2_INDICATORS = [21, 22].freeze
|
17
|
+
|
18
|
+
def three_d_secure_2?(tds_flag)
|
19
|
+
THREE_D_SECURE_2_INDICATORS.include?(tds_flag)
|
20
|
+
end
|
21
|
+
|
22
|
+
module_function :three_d_secure_2?
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -29,6 +29,10 @@ module ActiveMerchant #:nodoc:
|
|
29
29
|
|
30
30
|
params = billing_params(amount, credit_card, detail)
|
31
31
|
|
32
|
+
if three_d_secure_2?(detail)
|
33
|
+
params.merge!(detail.slice(*EpsilonRiskBaseAuthParams::KEYS).compact)
|
34
|
+
end
|
35
|
+
|
32
36
|
commit(PATHS[:purchase], params)
|
33
37
|
end
|
34
38
|
|
@@ -54,6 +58,10 @@ module ActiveMerchant #:nodoc:
|
|
54
58
|
params[:memo2] = detail[:memo2] if detail.has_key?(:memo2)
|
55
59
|
params[:kari_flag] = detail[:capture] ? 2 : 1 if detail.has_key?(:capture)
|
56
60
|
|
61
|
+
if three_d_secure_2?(detail)
|
62
|
+
params.merge!(detail.slice(*EpsilonRiskBaseAuthParams::KEYS).compact)
|
63
|
+
end
|
64
|
+
|
57
65
|
commit(PATHS[:registered_purchase], params)
|
58
66
|
end
|
59
67
|
|
@@ -239,6 +247,10 @@ module ActiveMerchant #:nodoc:
|
|
239
247
|
|
240
248
|
params
|
241
249
|
end
|
250
|
+
|
251
|
+
def three_d_secure_2?(detail)
|
252
|
+
EpsilonRiskBaseAuthParams.three_d_secure_2?(detail[:tds_flag])
|
253
|
+
end
|
242
254
|
end
|
243
255
|
end
|
244
256
|
end
|
@@ -39,6 +39,10 @@ module ActiveMerchant #:nodoc:
|
|
39
39
|
params[:memo2] = detail[:memo2] if detail.has_key?(:memo2)
|
40
40
|
params[:user_tel] = detail[:user_tel] if detail.has_key?(:user_tel)
|
41
41
|
|
42
|
+
if three_d_secure_2?(detail)
|
43
|
+
params.merge!(detail.slice(*EpsilonRiskBaseAuthParams::KEYS).compact)
|
44
|
+
end
|
45
|
+
|
42
46
|
commit('receive_order3.cgi', params, RESPONSE_KEYS)
|
43
47
|
end
|
44
48
|
|
@@ -50,6 +54,12 @@ module ActiveMerchant #:nodoc:
|
|
50
54
|
|
51
55
|
commit('cancel_payment.cgi', params)
|
52
56
|
end
|
57
|
+
|
58
|
+
private
|
59
|
+
|
60
|
+
def three_d_secure_2?(detail)
|
61
|
+
EpsilonRiskBaseAuthParams.three_d_secure_2?(detail[:tds_flag])
|
62
|
+
end
|
53
63
|
end
|
54
64
|
end
|
55
65
|
end
|
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
|
|
10
10
|
@result = @xml.xpath(ResponseXpath::RESULT).to_s
|
11
11
|
|
12
12
|
response = {
|
13
|
-
success: [ResultCode::SUCCESS, ResultCode::
|
13
|
+
success: [ResultCode::SUCCESS, ResultCode::THREE_D_SECURE_1, ResultCode::THREE_D_SECURE_2].include?(@result) || !state.empty?,
|
14
14
|
message: "#{error_code}: #{error_detail}"
|
15
15
|
}
|
16
16
|
|
@@ -48,7 +48,7 @@ module ActiveMerchant #:nodoc:
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def three_d_secure
|
51
|
-
|
51
|
+
[ResultCode::THREE_D_SECURE_1, ResultCode::THREE_D_SECURE_2].include?(@result)
|
52
52
|
end
|
53
53
|
|
54
54
|
def acs_url
|
@@ -59,6 +59,10 @@ module ActiveMerchant #:nodoc:
|
|
59
59
|
uri_decode(@xml.xpath(ResponseXpath::PA_REQ).to_s)
|
60
60
|
end
|
61
61
|
|
62
|
+
def tds2_url
|
63
|
+
uri_decode(@xml.xpath(ResponseXpath::TDS2_URL).to_s)
|
64
|
+
end
|
65
|
+
|
62
66
|
def receipt_number
|
63
67
|
@xml.xpath(ResponseXpath::RECEIPT_NUMBER).to_s
|
64
68
|
end
|
@@ -145,6 +149,7 @@ module ActiveMerchant #:nodoc:
|
|
145
149
|
CARD_EXPIRE = '//Epsilon_result/result[@card_expire]/@card_expire'
|
146
150
|
ACS_URL = '//Epsilon_result/result[@acsurl]/@acsurl' # ACS (Access Control Server)
|
147
151
|
PA_REQ = '//Epsilon_result/result[@pareq]/@pareq' # PAReq (payer authentication request)
|
152
|
+
TDS2_URL = '//Epsilon_result/result[@tds2_url]/@tds2_url'
|
148
153
|
RECEIPT_NUMBER = '//Epsilon_result/result[@receipt_no][1]/@receipt_no'
|
149
154
|
RECEIPT_DATE = '//Epsilon_result/result[@receipt_date][1]/@receipt_date'
|
150
155
|
CONVENIENCE_STORE_LIMIT_DATE = '//Epsilon_result/result[@conveni_limit][1]/@conveni_limit'
|
@@ -166,10 +171,11 @@ module ActiveMerchant #:nodoc:
|
|
166
171
|
end
|
167
172
|
|
168
173
|
module ResultCode
|
169
|
-
FAILURE
|
170
|
-
SUCCESS
|
171
|
-
|
172
|
-
|
174
|
+
FAILURE = '0'
|
175
|
+
SUCCESS = '1'
|
176
|
+
THREE_D_SECURE_1 = '5'
|
177
|
+
THREE_D_SECURE_2 = '6'
|
178
|
+
SYSTEM_ERROR = '9'
|
173
179
|
end
|
174
180
|
end
|
175
181
|
end
|
@@ -5,6 +5,7 @@ require_relative 'epsilon/version'
|
|
5
5
|
require_relative 'billing/convenience_store'
|
6
6
|
require_relative 'billing/gateways/epsilon/epsilon_mission_code'
|
7
7
|
require_relative 'billing/gateways/epsilon/epsilon_process_code'
|
8
|
+
require_relative 'billing/gateways/epsilon/epsilon_risk_base_auth_params'
|
8
9
|
require_relative 'billing/gateways/epsilon/epsilon_base'
|
9
10
|
require_relative 'billing/gateways/epsilon'
|
10
11
|
require_relative 'billing/gateways/epsilon_convenience_store'
|
@@ -0,0 +1,51 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://secure.epsilon.jp/cgi-bin/order/direct_card_payment.cgi
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: contract_code=[CONTRACT_CODE]&order_number=O30189731&tds_check_code=2&tds_pares=dummy+pa_res
|
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
|
+
- Thu, 15 Sep 2022 08:09:38 GMT
|
27
|
+
Server:
|
28
|
+
- Apache
|
29
|
+
Vary:
|
30
|
+
- Accept-Encoding
|
31
|
+
Content-Length:
|
32
|
+
- '161'
|
33
|
+
Connection:
|
34
|
+
- close
|
35
|
+
Content-Type:
|
36
|
+
- text/xml; charset=CP932
|
37
|
+
body:
|
38
|
+
encoding: ASCII-8BIT
|
39
|
+
string: |-
|
40
|
+
<?xml version="1.0" encoding="x-sjis-cp932"?>
|
41
|
+
<Epsilon_result>
|
42
|
+
<result acsurl="" />
|
43
|
+
<result err_code="" />
|
44
|
+
<result err_detail="" />
|
45
|
+
<result kari_flag="0" />
|
46
|
+
<result pareq="" />
|
47
|
+
<result result="1" />
|
48
|
+
<result trans_code="257072796" />
|
49
|
+
</Epsilon_result>
|
50
|
+
recorded_at: Thu, 15 Sep 2022 08:09:38 GMT
|
51
|
+
recorded_with: VCR 6.1.0
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://secure.epsilon.jp/cgi-bin/order/receive_order3.cgi
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: contract_code=[CONTRACT_CODE]&user_id=U1747274309&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=O29285401&st_code=10000-0000-00000-00000-00000-00000-00000&mission_code=1&item_price=10000&process_code=1&xml=1&memo1=memo1&memo2=memo2&tds_flag=21
|
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
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Thu, 15 May 2025 01:58:29 GMT
|
29
|
+
Content-Type:
|
30
|
+
- text/xml
|
31
|
+
Content-Length:
|
32
|
+
- '228'
|
33
|
+
Connection:
|
34
|
+
- close
|
35
|
+
Vary:
|
36
|
+
- Accept-Encoding
|
37
|
+
Strict-Transport-Security:
|
38
|
+
- max-age=31536000; includeSubDomains; preload
|
39
|
+
body:
|
40
|
+
encoding: ASCII-8BIT
|
41
|
+
string: |
|
42
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
43
|
+
<Epsilon_result>
|
44
|
+
<result result="1" />
|
45
|
+
<result redirect="https%3A%2F%2Fsecure.epsilon.jp%2Fcgi-bin%2Forder%2Fcard3.cgi%3Ftrans_code%3DeyHc6JoHNEiEce2mlXuiCg25" />
|
46
|
+
</Epsilon_result>
|
47
|
+
recorded_at: Thu, 15 May 2025 01:58:29 GMT
|
48
|
+
recorded_with: VCR 6.3.1
|
@@ -0,0 +1,51 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://secure.epsilon.jp/cgi-bin/order/direct_card_payment.cgi
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: contract_code=[CONTRACT_CODE]&user_id=124014051&user_name=YAMADA+TARO&user_mail_add=yamada-taro%40example.com&item_code=ITEM001&item_name=Greate+Product&order_number=O1663728963&st_code=10000-0000-0000&mission_code=1&item_price=1000&process_code=2&card_st_code=&pay_time=&xml=1&tds_flag=21
|
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, 21 Sep 2022 02:56:03 GMT
|
27
|
+
Server:
|
28
|
+
- Apache
|
29
|
+
Vary:
|
30
|
+
- Accept-Encoding
|
31
|
+
Content-Length:
|
32
|
+
- '234'
|
33
|
+
Connection:
|
34
|
+
- close
|
35
|
+
Content-Type:
|
36
|
+
- text/xml; charset=CP932
|
37
|
+
body:
|
38
|
+
encoding: ASCII-8BIT
|
39
|
+
string: |-
|
40
|
+
<?xml version="1.0" encoding="x-sjis-cp932"?>
|
41
|
+
<Epsilon_result>
|
42
|
+
<result acsurl="" />
|
43
|
+
<result err_code="" />
|
44
|
+
<result err_detail="" />
|
45
|
+
<result pareq="sOuxTX%252BZHCDBJKRdKkN2Iw53" />
|
46
|
+
<result result="6" />
|
47
|
+
<result tds2_url="https%3A%2F%2Fsecure.epsilon.jp%2Fcgi-bin%2Forder%2Ftds2.cgi" />
|
48
|
+
<result trans_code="257810878" />
|
49
|
+
</Epsilon_result>
|
50
|
+
recorded_at: Wed, 21 Sep 2022 02:56:04 GMT
|
51
|
+
recorded_with: VCR 6.1.0
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'test_helper'
|
2
|
-
class RemoteEpsilonLinkPaymentTest <
|
2
|
+
class RemoteEpsilonLinkPaymentTest < Minitest::Test
|
3
3
|
include SamplePaymentMethods
|
4
4
|
|
5
5
|
def gateway
|
@@ -33,6 +33,16 @@ class RemoteEpsilonLinkPaymentTest < MiniTest::Test
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
def test_epsilon_link_type_with_3d_secure
|
37
|
+
ActiveMerchant::Billing::Base.stub(:mode, :production) do
|
38
|
+
VCR.use_cassette(:epsilon_link_type_with_3d_secure) do
|
39
|
+
response = gateway.purchase(10000, valid_epsilon_link_type_purchase_detail_for_3d_secure, false)
|
40
|
+
|
41
|
+
pp response
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
36
46
|
def test_epsilon_link_type_void_successfull
|
37
47
|
VCR.use_cassette(:epsilon_link_type_void_successfull) do
|
38
48
|
# あらかじめ課金済ステータスの受注がイプシロン側にないと取り消しができないため、課金済の受注をイプシロン側で作成しておいた。
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class RemoteEpsilonGatewayTest <
|
3
|
+
class RemoteEpsilonGatewayTest < Minitest::Test
|
4
4
|
include SamplePaymentMethods
|
5
5
|
|
6
6
|
def gateway
|
@@ -75,6 +75,34 @@ class RemoteEpsilonGatewayTest < MiniTest::Test
|
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
+
def test_purchase_with_three_d_secure_2_successful
|
79
|
+
# 3DS2.0はテスト環境がないので mode を :production にする
|
80
|
+
ActiveMerchant::Billing::Base.stub(:mode, :production) do
|
81
|
+
VCR.use_cassette(:purchase_with_three_d_secure_2_successful) do
|
82
|
+
response = gateway.purchase(
|
83
|
+
1000,
|
84
|
+
ActiveMerchant::Billing::CreditCard.new,
|
85
|
+
purchase_detail_for_three_d_secure_2
|
86
|
+
)
|
87
|
+
|
88
|
+
assert_equal true, response.success?
|
89
|
+
assert_equal true, response.params['three_d_secure']
|
90
|
+
assert_equal true, response.params['tds2_url'].present?
|
91
|
+
assert_equal true, response.params['pa_req'].present?
|
92
|
+
assert_empty response.params['acs_url']
|
93
|
+
end
|
94
|
+
|
95
|
+
VCR.use_cassette(:authenticate_with_three_d_secure_2_successful) do
|
96
|
+
response = gateway.authenticate(
|
97
|
+
order_number: purchase_detail_for_three_d_secure_2[:order_number],
|
98
|
+
three_d_secure_pa_res: 'dummy pa_res'
|
99
|
+
)
|
100
|
+
|
101
|
+
assert_equal true, response.success?
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
78
106
|
def test_purchase_with_capture_true_successful
|
79
107
|
VCR.use_cassette(:purchase_with_capture_true_successful) do
|
80
108
|
response = gateway.purchase(1000, valid_credit_card, purchase_detail.merge(capture: true))
|
@@ -256,6 +284,30 @@ class RemoteEpsilonGatewayTest < MiniTest::Test
|
|
256
284
|
end
|
257
285
|
end
|
258
286
|
|
287
|
+
def test_registered_purchase_with_three_d_secure_2_successful
|
288
|
+
# 3DS2.0はテスト環境がないので mode を :production にする
|
289
|
+
ActiveMerchant::Billing::Base.stub(:mode, :production) do
|
290
|
+
VCR.use_cassette(:purchase_with_three_d_secure_2_successful) do
|
291
|
+
response = gateway.registered_purchase(1000, purchase_detail_for_registered_and_three_d_secure_2)
|
292
|
+
|
293
|
+
assert_equal true, response.success?
|
294
|
+
assert_equal true, response.params['three_d_secure']
|
295
|
+
assert_equal true, response.params['tds2_url'].present?
|
296
|
+
assert_equal true, response.params['pa_req'].present?
|
297
|
+
assert_empty response.params['acs_url']
|
298
|
+
end
|
299
|
+
|
300
|
+
VCR.use_cassette(:authenticate_with_three_d_secure_2_successful) do
|
301
|
+
response = gateway.authenticate(
|
302
|
+
order_number: purchase_detail_for_three_d_secure_2[:order_number],
|
303
|
+
three_d_secure_pa_res: 'dummy pa_res'
|
304
|
+
)
|
305
|
+
|
306
|
+
assert_equal true, response.success?
|
307
|
+
end
|
308
|
+
end
|
309
|
+
end
|
310
|
+
|
259
311
|
def test_registered_purchase_fail
|
260
312
|
VCR.use_cassette(:registered_purchase_fail) do
|
261
313
|
invalid_purchase_detail = purchase_detail_for_registered
|
data/test/test_helper.rb
CHANGED
@@ -69,7 +69,7 @@ module SamplePaymentMethods
|
|
69
69
|
last_name: 'YAMADA',
|
70
70
|
number: '4123451111111117',
|
71
71
|
month: '12',
|
72
|
-
year:
|
72
|
+
year: Time.now.year + 1,
|
73
73
|
)
|
74
74
|
end
|
75
75
|
|
@@ -156,6 +156,33 @@ module SamplePaymentMethods
|
|
156
156
|
}
|
157
157
|
end
|
158
158
|
|
159
|
+
def purchase_detail_for_three_d_secure_2
|
160
|
+
now = Time.now
|
161
|
+
{
|
162
|
+
user_id: "U#{now.to_i}",
|
163
|
+
user_name: 'YAMADA Taro',
|
164
|
+
user_email: 'yamada-taro@example.com',
|
165
|
+
item_code: 'ITEM001',
|
166
|
+
item_name: 'Greate Product',
|
167
|
+
order_number: "O#{now.sec}#{now.usec}",
|
168
|
+
token: '03d4a2ce2f747c9223a4ead24888d0293ad26c06273e296f9faa0675f99a1ff7',
|
169
|
+
three_d_secure_check_code: 1,
|
170
|
+
tds_flag: 21,
|
171
|
+
}
|
172
|
+
end
|
173
|
+
|
174
|
+
def purchase_detail_for_registered_and_three_d_secure_2
|
175
|
+
{
|
176
|
+
user_id: '124014051',
|
177
|
+
user_email: 'yamada-taro@example.com',
|
178
|
+
user_name: 'YAMADA TARO',
|
179
|
+
item_code: 'ITEM001',
|
180
|
+
item_name: 'Greate Product',
|
181
|
+
order_number: "O#{Time.now.to_i}",
|
182
|
+
tds_flag: 21,
|
183
|
+
}
|
184
|
+
end
|
185
|
+
|
159
186
|
def valid_three_d_secure_pa_res
|
160
187
|
now = Time.now
|
161
188
|
{
|
@@ -268,6 +295,22 @@ module SamplePaymentMethods
|
|
268
295
|
}
|
269
296
|
end
|
270
297
|
|
298
|
+
def valid_epsilon_link_type_purchase_detail_for_3d_secure
|
299
|
+
now = Time.now
|
300
|
+
{
|
301
|
+
user_id: "U#{Time.now.to_i}",
|
302
|
+
user_name: '山田 太郎',
|
303
|
+
user_email: 'yamada-taro@example.com',
|
304
|
+
item_code: 'ITEM001',
|
305
|
+
item_name: 'Greate Product',
|
306
|
+
order_number: "O#{now.sec}#{now.usec}",
|
307
|
+
st_code: '10000-0000-00000-00000-00000-00000-00000',
|
308
|
+
memo1: 'memo1',
|
309
|
+
memo2: 'memo2',
|
310
|
+
tds_flag: 21
|
311
|
+
}
|
312
|
+
end
|
313
|
+
|
271
314
|
def invalid_epsilon_link_type_purchase_detail
|
272
315
|
now = Time.now
|
273
316
|
{
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class EpsilonConvenienceStoreTest <
|
3
|
+
class EpsilonConvenienceStoreTest < Minitest::Test
|
4
4
|
def test_blank_parameter_generate_error
|
5
5
|
convenience_store = ActiveMerchant::Billing::ConvenienceStore.new(code: "",
|
6
6
|
full_name_kana: "",
|
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.
|
4
|
+
version: 0.15.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:
|
11
|
+
date: 2025-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|
@@ -171,6 +171,7 @@ files:
|
|
171
171
|
- lib/active_merchant/billing/gateways/epsilon/epsilon_base.rb
|
172
172
|
- lib/active_merchant/billing/gateways/epsilon/epsilon_mission_code.rb
|
173
173
|
- lib/active_merchant/billing/gateways/epsilon/epsilon_process_code.rb
|
174
|
+
- lib/active_merchant/billing/gateways/epsilon/epsilon_risk_base_auth_params.rb
|
174
175
|
- lib/active_merchant/billing/gateways/epsilon_convenience_store.rb
|
175
176
|
- lib/active_merchant/billing/gateways/epsilon_gmo_id.rb
|
176
177
|
- lib/active_merchant/billing/gateways/epsilon_link_payment.rb
|
@@ -178,6 +179,7 @@ files:
|
|
178
179
|
- lib/active_merchant/billing/gateways/response_parser.rb
|
179
180
|
- lib/active_merchant/epsilon.rb
|
180
181
|
- lib/active_merchant/epsilon/version.rb
|
182
|
+
- test/fixtures/vcr_cassettes/authenticate_with_three_d_secure_2_successful.yml
|
181
183
|
- test/fixtures/vcr_cassettes/autheticate_three_d_secure_card_successful.yml
|
182
184
|
- test/fixtures/vcr_cassettes/cancel_recurring_fail.yml
|
183
185
|
- test/fixtures/vcr_cassettes/cancel_recurring_successful.yml
|
@@ -193,6 +195,7 @@ files:
|
|
193
195
|
- test/fixtures/vcr_cassettes/epsilon_link_type_purchase_successful.yml
|
194
196
|
- test/fixtures/vcr_cassettes/epsilon_link_type_void_fail.yml
|
195
197
|
- test/fixtures/vcr_cassettes/epsilon_link_type_void_successfull.yml
|
198
|
+
- test/fixtures/vcr_cassettes/epsilon_link_type_with_3d_secure.yml
|
196
199
|
- test/fixtures/vcr_cassettes/find_order_failure.yml
|
197
200
|
- test/fixtures/vcr_cassettes/find_order_success.yml
|
198
201
|
- test/fixtures/vcr_cassettes/find_user_failure.yml
|
@@ -208,6 +211,7 @@ files:
|
|
208
211
|
- test/fixtures/vcr_cassettes/purchase_successful.yml
|
209
212
|
- test/fixtures/vcr_cassettes/purchase_with_capture_false_successful.yml
|
210
213
|
- test/fixtures/vcr_cassettes/purchase_with_capture_true_successful.yml
|
214
|
+
- test/fixtures/vcr_cassettes/purchase_with_three_d_secure_2_successful.yml
|
211
215
|
- test/fixtures/vcr_cassettes/purchase_with_three_d_secure_card_successful.yml
|
212
216
|
- test/fixtures/vcr_cassettes/purchase_with_verification_value.yml
|
213
217
|
- test/fixtures/vcr_cassettes/recurring_fail.yml
|
@@ -254,11 +258,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
254
258
|
- !ruby/object:Gem::Version
|
255
259
|
version: '0'
|
256
260
|
requirements: []
|
257
|
-
rubygems_version: 3.
|
261
|
+
rubygems_version: 3.5.3
|
258
262
|
signing_key:
|
259
263
|
specification_version: 4
|
260
264
|
summary: Epsilon integration for ActiveMerchant.
|
261
265
|
test_files:
|
266
|
+
- test/fixtures/vcr_cassettes/authenticate_with_three_d_secure_2_successful.yml
|
262
267
|
- test/fixtures/vcr_cassettes/autheticate_three_d_secure_card_successful.yml
|
263
268
|
- test/fixtures/vcr_cassettes/cancel_recurring_fail.yml
|
264
269
|
- test/fixtures/vcr_cassettes/cancel_recurring_successful.yml
|
@@ -274,6 +279,7 @@ test_files:
|
|
274
279
|
- test/fixtures/vcr_cassettes/epsilon_link_type_purchase_successful.yml
|
275
280
|
- test/fixtures/vcr_cassettes/epsilon_link_type_void_fail.yml
|
276
281
|
- test/fixtures/vcr_cassettes/epsilon_link_type_void_successfull.yml
|
282
|
+
- test/fixtures/vcr_cassettes/epsilon_link_type_with_3d_secure.yml
|
277
283
|
- test/fixtures/vcr_cassettes/find_order_failure.yml
|
278
284
|
- test/fixtures/vcr_cassettes/find_order_success.yml
|
279
285
|
- test/fixtures/vcr_cassettes/find_user_failure.yml
|
@@ -289,6 +295,7 @@ test_files:
|
|
289
295
|
- test/fixtures/vcr_cassettes/purchase_successful.yml
|
290
296
|
- test/fixtures/vcr_cassettes/purchase_with_capture_false_successful.yml
|
291
297
|
- test/fixtures/vcr_cassettes/purchase_with_capture_true_successful.yml
|
298
|
+
- test/fixtures/vcr_cassettes/purchase_with_three_d_secure_2_successful.yml
|
292
299
|
- test/fixtures/vcr_cassettes/purchase_with_three_d_secure_card_successful.yml
|
293
300
|
- test/fixtures/vcr_cassettes/purchase_with_verification_value.yml
|
294
301
|
- test/fixtures/vcr_cassettes/recurring_fail.yml
|