active_merchant-epsilon 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_merchant/billing/gateways/epsilon.rb +7 -0
- data/lib/active_merchant/epsilon/version.rb +1 -1
- data/test/fixtures/vcr_cassettes/token_verify_failure.yml +45 -0
- data/test/fixtures/vcr_cassettes/token_verify_successful.yml +85 -0
- data/test/remote/gateways/remote_epsilon_test.rb +15 -0
- data/test/test_helper.rb +24 -0
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de613713996b163807e1009830cbf15483bcffb5
|
4
|
+
data.tar.gz: ff296596a2714652296dcd1987041bb91c0d57d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dbb68b9951e5b8d356cfb01f4d60e7ec1b1e4ce09d39e25633b2a1e959cef2c510cc37d7fae32c5197528e17790efb312497639bb421fd26f1c4bb0ca5a71d6
|
7
|
+
data.tar.gz: 93e4804adfc464e0302d76e25cc9a6d957d00f8947f27f8e89f5b51396be2ed7fb989e8b16ac66d2ac313a289439a53389ac071b6d3f879085582450de341fce
|
@@ -191,6 +191,13 @@ module ActiveMerchant #:nodoc:
|
|
191
191
|
params[:memo1] = detail[:memo1] if detail.has_key?(:memo1)
|
192
192
|
params[:memo2] = detail[:memo2] if detail.has_key?(:memo2)
|
193
193
|
|
194
|
+
if detail.has_key?(:token)
|
195
|
+
params[:token] = detail[:token]
|
196
|
+
params.delete(:card_number)
|
197
|
+
params.delete(:expire_y)
|
198
|
+
params.delete(:expire_m)
|
199
|
+
end
|
200
|
+
|
194
201
|
if payment_method.class.requires_verification_value?
|
195
202
|
params.merge!(
|
196
203
|
security_code: payment_method.verification_value,
|
@@ -0,0 +1,45 @@
|
|
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=U1508894451&user_name=YAMADA+Taro&user_mail_add=yamada-taro%40example.com&item_code=verifycreditcard&item_name=verify+credit+card&order_number=O51347845&st_code=10000-0000-0000&mission_code=1&item_price=1&process_code=1&card_number=&expire_y=&expire_m=&card_st_code=&pay_time=&tds_check_code=&user_agent=ActiveMerchant%3A%3AEpsilon-0.7.0&token=a5f6d3b833cebc775559bf6546d60983cff7b70cd74fd354164bcc0795a70783
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/x-www-form-urlencoded
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
User-Agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Wed, 25 Oct 2017 01:20:49 GMT
|
25
|
+
Server:
|
26
|
+
- Apache
|
27
|
+
Transfer-Encoding:
|
28
|
+
- chunked
|
29
|
+
Content-Type:
|
30
|
+
- text/xml; charset=CP932
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: |-
|
34
|
+
<?xml version="1.0" encoding="x-sjis-cp932"?>
|
35
|
+
<Epsilon_result>
|
36
|
+
<result acsurl="" />
|
37
|
+
<result err_code="936" />
|
38
|
+
<result err_detail="%82%B7%82%C5%82%C9%8Eg%97p%8D%CF%82%DD%82%CC%83g%81%5B%83N%83%93%82%C5%82%B7%81B%8D%C4%93x%83g%81%5B%83N%83%93%82%CC%94%AD%8Ds%82%F0%82%A8%8A%E8%82%A2%82%B5%82%DC%82%B7%81B" />
|
39
|
+
<result pareq="" />
|
40
|
+
<result result="9" />
|
41
|
+
<result trans_code="" />
|
42
|
+
</Epsilon_result>
|
43
|
+
http_version:
|
44
|
+
recorded_at: Wed, 25 Oct 2017 01:20:51 GMT
|
45
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,85 @@
|
|
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=U1508900741&user_name=YAMADA+Taro&user_mail_add=yamada-taro%40example.com&item_code=verifycreditcard&item_name=verify+credit+card&order_number=O41853036&st_code=10000-0000-0000&mission_code=1&item_price=1&process_code=1&card_st_code=&pay_time=&tds_check_code=&user_agent=ActiveMerchant%3A%3AEpsilon-0.7.0&token=4ee16d6784077b5c3c67605db2a06d8b8ef7e8325deb5ceb9794451da1bb8c5f
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/x-www-form-urlencoded
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
User-Agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Wed, 25 Oct 2017 03:05:42 GMT
|
25
|
+
Server:
|
26
|
+
- Apache
|
27
|
+
Transfer-Encoding:
|
28
|
+
- chunked
|
29
|
+
Content-Type:
|
30
|
+
- text/xml; charset=CP932
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: |-
|
34
|
+
<?xml version="1.0" encoding="x-sjis-cp932"?>
|
35
|
+
<Epsilon_result>
|
36
|
+
<result acsurl="" />
|
37
|
+
<result err_code="" />
|
38
|
+
<result err_detail="" />
|
39
|
+
<result kari_flag="0" />
|
40
|
+
<result pareq="" />
|
41
|
+
<result result="1" />
|
42
|
+
<result trans_code="683674" />
|
43
|
+
</Epsilon_result>
|
44
|
+
http_version:
|
45
|
+
recorded_at: Wed, 25 Oct 2017 03:05:44 GMT
|
46
|
+
- request:
|
47
|
+
method: post
|
48
|
+
uri: https://beta.epsilon.jp/cgi-bin/order/cancel_payment.cgi
|
49
|
+
body:
|
50
|
+
encoding: UTF-8
|
51
|
+
string: contract_code=[CONTRACT_CODE]&order_number=O41853036
|
52
|
+
headers:
|
53
|
+
Content-Type:
|
54
|
+
- application/x-www-form-urlencoded
|
55
|
+
Accept-Encoding:
|
56
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
57
|
+
Accept:
|
58
|
+
- "*/*"
|
59
|
+
User-Agent:
|
60
|
+
- Ruby
|
61
|
+
response:
|
62
|
+
status:
|
63
|
+
code: 200
|
64
|
+
message: OK
|
65
|
+
headers:
|
66
|
+
Date:
|
67
|
+
- Wed, 25 Oct 2017 03:05:44 GMT
|
68
|
+
Server:
|
69
|
+
- Apache
|
70
|
+
Transfer-Encoding:
|
71
|
+
- chunked
|
72
|
+
Content-Type:
|
73
|
+
- text/xml; charset=CP932
|
74
|
+
body:
|
75
|
+
encoding: UTF-8
|
76
|
+
string: |-
|
77
|
+
<?xml version="1.0" encoding="x-sjis-cp932"?>
|
78
|
+
<Epsilon_result>
|
79
|
+
<result err_code="" />
|
80
|
+
<result err_detail="" />
|
81
|
+
<result result="1" />
|
82
|
+
</Epsilon_result>
|
83
|
+
http_version:
|
84
|
+
recorded_at: Wed, 25 Oct 2017 03:05:45 GMT
|
85
|
+
recorded_with: VCR 3.0.3
|
@@ -197,6 +197,21 @@ class RemoteEpsilonGatewayTest < MiniTest::Test
|
|
197
197
|
end
|
198
198
|
end
|
199
199
|
|
200
|
+
def test_token_verify_successful
|
201
|
+
VCR.use_cassette(:token_verify_successful) do
|
202
|
+
response = gateway.verify(tokenized_credit_card, purchase_detail_with_token)
|
203
|
+
assert_equal true, response.success?
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
def test_token_verify_failure
|
208
|
+
# used token is invalid
|
209
|
+
VCR.use_cassette(:token_verify_failure) do
|
210
|
+
response = gateway.verify(tokenized_credit_card, purchase_detail_with_token)
|
211
|
+
assert_equal false, response.success?
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
200
215
|
def test_find_user_success
|
201
216
|
VCR.use_cassette(:find_user_success) do
|
202
217
|
response = gateway.find_user(user_id: "U1416470209")
|
data/test/test_helper.rb
CHANGED
@@ -37,6 +37,17 @@ module SamplePaymentMethods
|
|
37
37
|
)
|
38
38
|
end
|
39
39
|
|
40
|
+
def tokenized_credit_card
|
41
|
+
ActiveMerchant::Billing::CreditCard.require_verification_value = false
|
42
|
+
ActiveMerchant::Billing::CreditCard.new(
|
43
|
+
first_name: 'TARO',
|
44
|
+
last_name: 'YAMADA',
|
45
|
+
number: '',
|
46
|
+
month: '',
|
47
|
+
year: '',
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
40
51
|
def valid_credit_card_with_verification_value
|
41
52
|
ActiveMerchant::Billing::CreditCard.require_verification_value = true
|
42
53
|
ActiveMerchant::Billing::CreditCard.new(
|
@@ -85,6 +96,19 @@ module SamplePaymentMethods
|
|
85
96
|
}
|
86
97
|
end
|
87
98
|
|
99
|
+
def purchase_detail_with_token
|
100
|
+
now = Time.now
|
101
|
+
{
|
102
|
+
user_id: "U#{Time.now.to_i}",
|
103
|
+
user_name: 'YAMADA Taro',
|
104
|
+
user_email: 'yamada-taro@example.com',
|
105
|
+
item_code: 'ITEM001',
|
106
|
+
item_name: 'Greate Product',
|
107
|
+
order_number: "O#{now.sec}#{now.usec}",
|
108
|
+
token: '4ee16d6784077b5c3c67605db2a06d8b8ef7e8325deb5ceb9794451da1bb8c5f',
|
109
|
+
}
|
110
|
+
end
|
111
|
+
|
88
112
|
def installment_purchase_detail
|
89
113
|
now = Time.now
|
90
114
|
{
|
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.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenichi TAKAHASHI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|
@@ -197,6 +197,8 @@ files:
|
|
197
197
|
- test/fixtures/vcr_cassettes/revolving_purchase_successful.yml
|
198
198
|
- test/fixtures/vcr_cassettes/terminate_recurring_fail.yml
|
199
199
|
- test/fixtures/vcr_cassettes/terminate_recurring_successful.yml
|
200
|
+
- test/fixtures/vcr_cassettes/token_verify_failure.yml
|
201
|
+
- test/fixtures/vcr_cassettes/token_verify_successful.yml
|
200
202
|
- test/fixtures/vcr_cassettes/verify_fail.yml
|
201
203
|
- test/fixtures/vcr_cassettes/verify_successful.yml
|
202
204
|
- test/fixtures/vcr_cassettes/void_fail.yml
|
@@ -226,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
228
|
version: '0'
|
227
229
|
requirements: []
|
228
230
|
rubyforge_project:
|
229
|
-
rubygems_version: 2.
|
231
|
+
rubygems_version: 2.6.13
|
230
232
|
signing_key:
|
231
233
|
specification_version: 4
|
232
234
|
summary: Epsilon integration for ActiveMerchant.
|
@@ -254,6 +256,8 @@ test_files:
|
|
254
256
|
- test/fixtures/vcr_cassettes/revolving_purchase_successful.yml
|
255
257
|
- test/fixtures/vcr_cassettes/terminate_recurring_fail.yml
|
256
258
|
- test/fixtures/vcr_cassettes/terminate_recurring_successful.yml
|
259
|
+
- test/fixtures/vcr_cassettes/token_verify_failure.yml
|
260
|
+
- test/fixtures/vcr_cassettes/token_verify_successful.yml
|
257
261
|
- test/fixtures/vcr_cassettes/verify_fail.yml
|
258
262
|
- test/fixtures/vcr_cassettes/verify_successful.yml
|
259
263
|
- test/fixtures/vcr_cassettes/void_fail.yml
|