active_merchant-epsilon 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/active_merchant/billing/gateways/epsilon_gmo_after.rb +6 -2
- data/lib/active_merchant/billing/gateways/response_parser.rb +1 -7
- data/lib/active_merchant/epsilon/version.rb +1 -1
- data/test/fixtures/vcr_cassettes/gmo_after_purchase_fail.yml +4 -4
- data/test/fixtures/vcr_cassettes/gmo_after_purchase_successful.yml +4 -4
- data/test/remote/gateways/remote_epsilon_convenience_store_test.rb +1 -0
- data/test/remote/gateways/remote_epsilon_gmo_after_test.rb +1 -0
- data/test/remote/gateways/remote_epsilon_gmo_id_test.rb +1 -0
- data/test/remote/gateways/remote_epsilon_test.rb +3 -0
- data/test/remote/gateways/remote_epsilon_virtual_account_test.rb +2 -1
- data/test/test_helper.rb +6 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b6d8a514b77fdac7f5ba836ad2587393253f2fedda6aac170ccc65817fa575d
|
4
|
+
data.tar.gz: 72244c3fafb9a11b2a2a5c1593474aefa54c3fc4c4c37856c5288c5d67cbeb61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22b4a2fa3d606dec5edba7243c9ae21a6f410a0ddb6f9fe7a0ec2e02e2ed6e1a2e1cb209f32e27e1677cfd1589b8f071033bcd30dff85cad09c1d23bbca293df
|
7
|
+
data.tar.gz: 9d812be0b13afde388c1c57d007af0e6786e890be09c5a290ea42db26b5482571af2fd1e92d737df979da2ca7501994e3de53e671a887628739df0d2ae675416
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
module ActiveMerchant #:nodoc:
|
2
2
|
module Billing #:nodoc:
|
3
3
|
class EpsilonGmoAfterGateway < EpsilonBaseGateway
|
4
|
+
|
5
|
+
RESPONSE_KEYS = DEFAULT_RESPONSE_KEYS + [
|
6
|
+
:redirect,
|
7
|
+
]
|
8
|
+
|
4
9
|
def purchase(amount, detail = {})
|
5
10
|
params = {
|
6
11
|
contract_code: self.contract_code,
|
@@ -24,14 +29,13 @@ module ActiveMerchant #:nodoc:
|
|
24
29
|
orderer_name: detail[:orderer_name],
|
25
30
|
orderer_address: detail[:orderer_address],
|
26
31
|
orderer_tel: detail[:orderer_tel],
|
27
|
-
version: 2, # 推奨文字コードがUTF8の方を指定
|
28
32
|
}
|
29
33
|
|
30
34
|
params[:memo1] = detail[:memo1] if detail.has_key?(:memo1)
|
31
35
|
params[:memo2] = detail[:memo2] if detail.has_key?(:memo2)
|
32
36
|
params[:user_tel] = detail[:user_tel] if detail.has_key?(:user_tel)
|
33
37
|
|
34
|
-
commit('receive_order3.cgi', params,
|
38
|
+
commit('receive_order3.cgi', params, RESPONSE_KEYS)
|
35
39
|
end
|
36
40
|
end
|
37
41
|
end
|
@@ -124,13 +124,7 @@ module ActiveMerchant #:nodoc:
|
|
124
124
|
end
|
125
125
|
|
126
126
|
def uri_decode(string)
|
127
|
-
|
128
|
-
|
129
|
-
unless decoded_string.encoding == Encoding::UTF_8
|
130
|
-
decoded_string = decoded_string.encode(Encoding::UTF_8, Encoding::CP932)
|
131
|
-
end
|
132
|
-
|
133
|
-
decoded_string
|
127
|
+
CGI.unescape(string).encode(Encoding::UTF_8, Encoding::CP932)
|
134
128
|
end
|
135
129
|
|
136
130
|
module ResponseXpath
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: https://beta.epsilon.jp/cgi-bin/order/receive_order3.cgi
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: contract_code=[CONTRACT_CODE]&user_id=&user_name
|
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
9
|
headers:
|
10
10
|
Content-Type:
|
11
11
|
- application/x-www-form-urlencoded
|
@@ -23,7 +23,7 @@ http_interactions:
|
|
23
23
|
message: OK
|
24
24
|
headers:
|
25
25
|
Date:
|
26
|
-
-
|
26
|
+
- Wed, 18 Mar 2020 05:58:06 GMT
|
27
27
|
Server:
|
28
28
|
- Apache
|
29
29
|
Connection:
|
@@ -36,9 +36,9 @@ http_interactions:
|
|
36
36
|
encoding: UTF-8
|
37
37
|
string: "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n <Epsilon_result>\r\n
|
38
38
|
\ <result result=\"0\" />\r\n <result err_code=\"601\" />\r\n <result
|
39
|
-
err_detail=\"%
|
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
40
|
/>\r\n <result memo1=\"memo1\" />\r\n <result memo2=\"memo2\" />\r\n
|
41
41
|
\ </Epsilon_result>\r\n"
|
42
42
|
http_version: null
|
43
|
-
recorded_at:
|
43
|
+
recorded_at: Wed, 18 Mar 2020 05:58:07 GMT
|
44
44
|
recorded_with: VCR 5.1.0
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: https://beta.epsilon.jp/cgi-bin/order/receive_order3.cgi
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: contract_code=[CONTRACT_CODE]&user_id=
|
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
9
|
headers:
|
10
10
|
Content-Type:
|
11
11
|
- application/x-www-form-urlencoded
|
@@ -23,7 +23,7 @@ http_interactions:
|
|
23
23
|
message: OK
|
24
24
|
headers:
|
25
25
|
Date:
|
26
|
-
-
|
26
|
+
- Wed, 18 Mar 2020 05:53:23 GMT
|
27
27
|
Server:
|
28
28
|
- Apache
|
29
29
|
Connection:
|
@@ -38,8 +38,8 @@ http_interactions:
|
|
38
38
|
<?xml version="1.0" encoding="UTF-8" ?>
|
39
39
|
<Epsilon_result>
|
40
40
|
<result result="1" />
|
41
|
-
<result redirect="https%3A%2F%2Fbeta.epsilon.jp%2Fcgi-bin%2Forder%2Fmethod_select3.cgi%3Ftrans_code%
|
41
|
+
<result redirect="https%3A%2F%2Fbeta.epsilon.jp%2Fcgi-bin%2Forder%2Fmethod_select3.cgi%3Ftrans_code%3DITL3uKDMlWg41" />
|
42
42
|
</Epsilon_result>
|
43
43
|
http_version: null
|
44
|
-
recorded_at:
|
44
|
+
recorded_at: Wed, 18 Mar 2020 05:53:25 GMT
|
45
45
|
recorded_with: VCR 5.1.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
|
@@ -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
|
|
@@ -76,6 +76,7 @@ class RemoteEpsilonGatewayTest < MiniTest::Test
|
|
76
76
|
VCR.use_cassette(:purchase_fail) do
|
77
77
|
response = gateway.purchase(10000, invalid_credit_card, purchase_detail)
|
78
78
|
assert_equal false, response.success?
|
79
|
+
assert_equal true, response.params["error_detail"].valid_encoding?
|
79
80
|
end
|
80
81
|
end
|
81
82
|
|
@@ -138,6 +139,7 @@ class RemoteEpsilonGatewayTest < MiniTest::Test
|
|
138
139
|
)
|
139
140
|
|
140
141
|
assert_equal false, response.success?
|
142
|
+
assert_equal true, response.params["error_detail"].valid_encoding?
|
141
143
|
end
|
142
144
|
end
|
143
145
|
|
@@ -239,6 +241,7 @@ class RemoteEpsilonGatewayTest < MiniTest::Test
|
|
239
241
|
invalid_purchase_detail[:user_id] = ''
|
240
242
|
response = gateway.registered_purchase(10000, invalid_purchase_detail)
|
241
243
|
assert_equal false, response.success?
|
244
|
+
assert_equal true, response.params["error_detail"].valid_encoding?
|
242
245
|
end
|
243
246
|
end
|
244
247
|
|
@@ -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
|
data/test/test_helper.rb
CHANGED
@@ -210,20 +210,21 @@ module SamplePaymentMethods
|
|
210
210
|
now = Time.now
|
211
211
|
{
|
212
212
|
user_id: "U#{Time.now.to_i}",
|
213
|
-
user_name: '
|
213
|
+
user_name: '山田 太郎',
|
214
214
|
user_email: 'yamada-taro@example.com',
|
215
|
+
user_tel: '0312345678',
|
215
216
|
item_code: 'ITEM001',
|
216
217
|
item_name: 'Greate Product',
|
217
218
|
order_number: "O#{now.sec}#{now.usec}",
|
218
219
|
memo1: 'memo1',
|
219
220
|
memo2: 'memo2',
|
220
|
-
consignee_postal: '
|
221
|
+
consignee_postal: '1000001',
|
221
222
|
consignee_name: 'イプシロンタロウ',
|
222
|
-
consignee_address: '
|
223
|
+
consignee_address: '東京都千代田区千代田1番1号',
|
223
224
|
consignee_tel: '0312345678',
|
224
|
-
orderer_postal: '
|
225
|
+
orderer_postal: '1000001',
|
225
226
|
orderer_name: 'YAMADA Taro',
|
226
|
-
orderer_address: '
|
227
|
+
orderer_address: '東京都千代田区千代田1番1号',
|
227
228
|
orderer_tel: '0312345678',
|
228
229
|
}
|
229
230
|
end
|
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.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenichi TAKAHASHI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|