active_merchant-epsilon 0.5.7 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75138bb18726ef3140954a16bb725c7171b7a05c
|
4
|
+
data.tar.gz: 386ca212536ebd8d1838977127ab2a9948dafbfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d55045bfdd9012f0ecff2f1bab04137f54af0e95d6e851e54f9c7ccba2b23e815401f2357185831bcee30a02f2f7aa6aac7abc349ccef504bf9e4d6667546a8
|
7
|
+
data.tar.gz: d6b5677122f08f140dd1f981760caa6f7ec7a9f4179471550f170ea8d4e5f748c685a83366d473a2e776378dde13d38e38182296e36a155046fd040c26446b45
|
@@ -29,7 +29,7 @@ module ActiveMerchant #:nodoc:
|
|
29
29
|
|
30
30
|
self.abstract_class = true
|
31
31
|
|
32
|
-
cattr_accessor :contract_code, :proxy_address, :proxy_port
|
32
|
+
cattr_accessor :contract_code, :proxy_address, :proxy_port, :encoding
|
33
33
|
|
34
34
|
self.test_url = 'https://beta.epsilon.jp/cgi-bin/order/'
|
35
35
|
self.live_url = 'https://secure.epsilon.jp/cgi-bin/order/'
|
@@ -68,7 +68,12 @@ module ActiveMerchant #:nodoc:
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def post_data(parameters = {})
|
71
|
-
parameters.map { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join('&')
|
71
|
+
parameters.map { |k, v| "#{k}=#{CGI.escape(encode_value(v.to_s))}" }.join('&')
|
72
|
+
end
|
73
|
+
|
74
|
+
def encode_value(value)
|
75
|
+
return value unless encoding
|
76
|
+
value.encode(encoding, invalid: :replace, undef: :replace)
|
72
77
|
end
|
73
78
|
|
74
79
|
def message_from(response)
|
data/test/test_helper.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
class EpsilonGatewayTest < MiniTest::Test
|
4
|
+
include SamplePaymentMethods
|
5
|
+
|
4
6
|
def test_set_proxy_address_and_port
|
5
7
|
ActiveMerchant::Billing::EpsilonGateway.proxy_address = 'http://myproxy.dev'
|
6
8
|
ActiveMerchant::Billing::EpsilonGateway.proxy_port = 1234
|
@@ -8,4 +10,25 @@ class EpsilonGatewayTest < MiniTest::Test
|
|
8
10
|
assert_equal(gateway.proxy_address, 'http://myproxy.dev')
|
9
11
|
assert_equal(gateway.proxy_port, 1234)
|
10
12
|
end
|
13
|
+
|
14
|
+
def test_purchase_post_data_encoding_eucjp
|
15
|
+
ActiveMerchant::Billing::EpsilonBaseGateway.encoding = Encoding::EUC_JP
|
16
|
+
gateway = ActiveMerchant::Billing::EpsilonGateway.new
|
17
|
+
fixture = YAML.load_file('test/fixtures/vcr_cassettes/purchase_successful.yml')
|
18
|
+
response_body = fixture['http_interactions'][0]['response']['body']['string']
|
19
|
+
detail = {
|
20
|
+
user_name: '山田太郎',
|
21
|
+
item_name: 'すごい商品',
|
22
|
+
order_number: '12345678',
|
23
|
+
}
|
24
|
+
gateway.expects(:ssl_post).with(
|
25
|
+
instance_of(String),
|
26
|
+
all_of(
|
27
|
+
includes('user_name=%BB%B3%C5%C4%C2%C0%CF%BA'),
|
28
|
+
includes('item_name=%A4%B9%A4%B4%A4%A4%BE%A6%C9%CA'),
|
29
|
+
includes('order_number=12345678'),
|
30
|
+
)
|
31
|
+
).returns(response_body)
|
32
|
+
gateway.purchase(100, valid_credit_card, detail)
|
33
|
+
end
|
11
34
|
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.5.
|
4
|
+
version: 0.5.8
|
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: 2017-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|
@@ -136,6 +136,20 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: mocha
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
139
153
|
description: Epsilon integration for ActiveMerchant.
|
140
154
|
email:
|
141
155
|
- kenichi.taka@gmail.com
|
@@ -212,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
226
|
version: '0'
|
213
227
|
requirements: []
|
214
228
|
rubyforge_project:
|
215
|
-
rubygems_version: 2.
|
229
|
+
rubygems_version: 2.6.6
|
216
230
|
signing_key:
|
217
231
|
specification_version: 4
|
218
232
|
summary: Epsilon integration for ActiveMerchant.
|