tomriley-active_merchant 1.4.2.3 → 1.4.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +14 -0
- data/CONTRIBUTERS +12 -0
- data/active_merchant.gemspec +3 -2
- data/init.rb +0 -1
- data/lib/active_merchant/billing/credit_card_methods.rb +1 -1
- data/lib/active_merchant/billing/expiry_date.rb +10 -4
- data/lib/active_merchant/billing/gateway.rb +4 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +12 -1
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +2 -1
- data/lib/active_merchant/billing/gateways/bogus.rb +19 -0
- data/lib/active_merchant/billing/gateways/eway.rb +6 -1
- data/lib/active_merchant/billing/gateways/first_pay.rb +172 -0
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +283 -0
- data/lib/active_merchant/billing/gateways/ogone.rb +259 -0
- data/lib/active_merchant/billing/gateways/paypal.rb +22 -9
- data/lib/active_merchant/billing/gateways/{protx.rb → sage_pay.rb} +45 -12
- data/lib/active_merchant/billing/integrations/nochex/notification.rb +1 -1
- data/lib/active_merchant/billing/response.rb +9 -1
- data/test/fixtures.yml +16 -1
- data/test/remote/gateways/remote_first_pay_test.rb +87 -0
- data/test/remote/gateways/remote_merchant_ware_test.rb +113 -0
- data/test/remote/gateways/remote_ogone_test.rb +108 -0
- data/test/remote/gateways/remote_paypal_test.rb +12 -1
- data/test/remote/gateways/remote_protx_three_d_secure_test.rb +259 -0
- data/test/remote/gateways/{remote_protx_test.rb → remote_sage_pay_test.rb} +8 -8
- data/test/unit/credit_card_methods_test.rb +9 -0
- data/test/unit/expiry_date_test.rb +12 -1
- data/test/unit/gateways/bogus_test.rb +31 -0
- data/test/unit/gateways/first_pay_test.rb +125 -0
- data/test/unit/gateways/gateway_test.rb +6 -0
- data/test/unit/gateways/merchant_ware_test.rb +188 -0
- data/test/unit/gateways/ogone_test.rb +256 -0
- data/test/unit/gateways/paypal_test.rb +49 -0
- data/test/unit/gateways/sage_pay_test.rb +183 -0
- data/test/unit/integrations/notifications/nochex_notification_test.rb +1 -1
- data/test/unit/response_test.rb +16 -0
- metadata +16 -5
- data/test/unit/gateways/protx_test.rb +0 -139
@@ -46,6 +46,6 @@ class NochexNotificationTest < Test::Unit::TestCase
|
|
46
46
|
|
47
47
|
private
|
48
48
|
def http_raw_data
|
49
|
-
"transaction_date=27/09/2006 22:30:53&transaction_id=91191&order_id=11&from_email=test2@nochex.com&to_email=test1@nochex.com&amount=31.
|
49
|
+
"transaction_date=27/09/2006 22:30:53&transaction_id=91191&order_id=11&from_email=test2@nochex.com&to_email=test1@nochex.com&amount=31.6600&security_key=L254524366479818252491366&status=test&custom="
|
50
50
|
end
|
51
51
|
end
|
data/test/unit/response_test.rb
CHANGED
@@ -5,6 +5,22 @@ class ResponseTest < Test::Unit::TestCase
|
|
5
5
|
assert Response.new(true, 'message', :param => 'value').success?
|
6
6
|
assert !Response.new(false, 'message', :param => 'value').success?
|
7
7
|
end
|
8
|
+
|
9
|
+
def test_three_d_secure_required
|
10
|
+
assert Response.new(false, 'message', {}, :three_d_secure => true).three_d_secure?
|
11
|
+
assert !Response.new(false, 'message', {}, :three_d_secure => false).three_d_secure?
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_three_d_secure_params
|
15
|
+
pa_req ='eJxVUttygjAQfe9XMH4AuUCoOGscW9'
|
16
|
+
md = '2012354765399251503'
|
17
|
+
acs_url = 'https://ukvpstest.protx.com/mpitools/accesscontroler?action=pareq'
|
18
|
+
response = Response.new(false, 'message', {}, :three_d_secure => true, :pa_req => pa_req, :md => md, :acs_url => acs_url)
|
19
|
+
|
20
|
+
assert_equal pa_req, response.pa_req
|
21
|
+
assert_equal md, response.md
|
22
|
+
assert_equal acs_url, response.acs_url
|
23
|
+
end
|
8
24
|
|
9
25
|
def test_get_params
|
10
26
|
response = Response.new(true, 'message', :param => 'value')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tomriley-active_merchant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.2.
|
4
|
+
version: 1.4.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Luetke
|
@@ -49,14 +49,17 @@ files:
|
|
49
49
|
- lib/active_merchant/billing/gateways/efsnet.rb
|
50
50
|
- lib/active_merchant/billing/gateways/eway.rb
|
51
51
|
- lib/active_merchant/billing/gateways/exact.rb
|
52
|
+
- lib/active_merchant/billing/gateways/first_pay.rb
|
52
53
|
- lib/active_merchant/billing/gateways/instapay.rb
|
53
54
|
- lib/active_merchant/billing/gateways/linkpoint.rb
|
54
55
|
- lib/active_merchant/billing/gateways/merchant_e_solutions.rb
|
56
|
+
- lib/active_merchant/billing/gateways/merchant_ware.rb
|
55
57
|
- lib/active_merchant/billing/gateways/modern_payments.rb
|
56
58
|
- lib/active_merchant/billing/gateways/modern_payments_cim.rb
|
57
59
|
- lib/active_merchant/billing/gateways/moneris.rb
|
58
60
|
- lib/active_merchant/billing/gateways/net_registry.rb
|
59
61
|
- lib/active_merchant/billing/gateways/netbilling.rb
|
62
|
+
- lib/active_merchant/billing/gateways/ogone.rb
|
60
63
|
- lib/active_merchant/billing/gateways/pay_junction.rb
|
61
64
|
- lib/active_merchant/billing/gateways/pay_secure.rb
|
62
65
|
- lib/active_merchant/billing/gateways/payflow
|
@@ -76,7 +79,6 @@ files:
|
|
76
79
|
- lib/active_merchant/billing/gateways/paypal_express.rb
|
77
80
|
- lib/active_merchant/billing/gateways/paypal_express_common.rb
|
78
81
|
- lib/active_merchant/billing/gateways/plugnpay.rb
|
79
|
-
- lib/active_merchant/billing/gateways/protx.rb
|
80
82
|
- lib/active_merchant/billing/gateways/psigate.rb
|
81
83
|
- lib/active_merchant/billing/gateways/psl_card.rb
|
82
84
|
- lib/active_merchant/billing/gateways/quickpay.rb
|
@@ -86,6 +88,7 @@ files:
|
|
86
88
|
- lib/active_merchant/billing/gateways/sage/sage_core.rb
|
87
89
|
- lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb
|
88
90
|
- lib/active_merchant/billing/gateways/sage.rb
|
91
|
+
- lib/active_merchant/billing/gateways/sage_pay.rb
|
89
92
|
- lib/active_merchant/billing/gateways/secure_pay.rb
|
90
93
|
- lib/active_merchant/billing/gateways/secure_pay_au.rb
|
91
94
|
- lib/active_merchant/billing/gateways/secure_pay_tech.rb
|
@@ -174,14 +177,17 @@ files:
|
|
174
177
|
- test/remote/gateways/remote_efsnet_test.rb
|
175
178
|
- test/remote/gateways/remote_eway_test.rb
|
176
179
|
- test/remote/gateways/remote_exact_test.rb
|
180
|
+
- test/remote/gateways/remote_first_pay_test.rb
|
177
181
|
- test/remote/gateways/remote_instapay_test.rb
|
178
182
|
- test/remote/gateways/remote_linkpoint_test.rb
|
179
183
|
- test/remote/gateways/remote_merchant_e_solutions_test.rb
|
184
|
+
- test/remote/gateways/remote_merchant_ware_test.rb
|
180
185
|
- test/remote/gateways/remote_modern_payments_cim_test.rb
|
181
186
|
- test/remote/gateways/remote_modern_payments_test.rb
|
182
187
|
- test/remote/gateways/remote_moneris_test.rb
|
183
188
|
- test/remote/gateways/remote_net_registry_test.rb
|
184
189
|
- test/remote/gateways/remote_netbilling_test.rb
|
190
|
+
- test/remote/gateways/remote_ogone_test.rb
|
185
191
|
- test/remote/gateways/remote_pay_junction_test.rb
|
186
192
|
- test/remote/gateways/remote_pay_secure_test.rb
|
187
193
|
- test/remote/gateways/remote_payflow_express_test.rb
|
@@ -191,12 +197,13 @@ files:
|
|
191
197
|
- test/remote/gateways/remote_paypal_express_test.rb
|
192
198
|
- test/remote/gateways/remote_paypal_test.rb
|
193
199
|
- test/remote/gateways/remote_plugnpay_test.rb
|
194
|
-
- test/remote/gateways/
|
200
|
+
- test/remote/gateways/remote_protx_three_d_secure_test.rb
|
195
201
|
- test/remote/gateways/remote_psigate_test.rb
|
196
202
|
- test/remote/gateways/remote_psl_card_test.rb
|
197
203
|
- test/remote/gateways/remote_quickpay_test.rb
|
198
204
|
- test/remote/gateways/remote_realex_test.rb
|
199
205
|
- test/remote/gateways/remote_sage_bankcard_test.rb
|
206
|
+
- test/remote/gateways/remote_sage_pay_test.rb
|
200
207
|
- test/remote/gateways/remote_sage_test.rb
|
201
208
|
- test/remote/gateways/remote_sage_virtual_check_test.rb
|
202
209
|
- test/remote/gateways/remote_secure_pay_au_test.rb
|
@@ -239,14 +246,17 @@ files:
|
|
239
246
|
- test/unit/gateways/efsnet_test.rb
|
240
247
|
- test/unit/gateways/eway_test.rb
|
241
248
|
- test/unit/gateways/exact_test.rb
|
249
|
+
- test/unit/gateways/first_pay_test.rb
|
242
250
|
- test/unit/gateways/gateway_test.rb
|
243
251
|
- test/unit/gateways/instapay_test.rb
|
244
252
|
- test/unit/gateways/linkpoint_test.rb
|
245
253
|
- test/unit/gateways/merchant_e_solutions_test.rb
|
254
|
+
- test/unit/gateways/merchant_ware_test.rb
|
246
255
|
- test/unit/gateways/modern_payments_cim_test.rb
|
247
256
|
- test/unit/gateways/moneris_test.rb
|
248
257
|
- test/unit/gateways/net_registry_test.rb
|
249
258
|
- test/unit/gateways/netbilling_test.rb
|
259
|
+
- test/unit/gateways/ogone_test.rb
|
250
260
|
- test/unit/gateways/pay_junction_test.rb
|
251
261
|
- test/unit/gateways/pay_secure_test.rb
|
252
262
|
- test/unit/gateways/payflow_express_test.rb
|
@@ -257,12 +267,12 @@ files:
|
|
257
267
|
- test/unit/gateways/paypal_express_test.rb
|
258
268
|
- test/unit/gateways/paypal_test.rb
|
259
269
|
- test/unit/gateways/plugnpay_test.rb
|
260
|
-
- test/unit/gateways/protx_test.rb
|
261
270
|
- test/unit/gateways/psigate_test.rb
|
262
271
|
- test/unit/gateways/psl_card_test.rb
|
263
272
|
- test/unit/gateways/quickpay_test.rb
|
264
273
|
- test/unit/gateways/realex_test.rb
|
265
274
|
- test/unit/gateways/sage_bankcard_test.rb
|
275
|
+
- test/unit/gateways/sage_pay_test.rb
|
266
276
|
- test/unit/gateways/sage_virtual_check_test.rb
|
267
277
|
- test/unit/gateways/secure_pay_au_test.rb
|
268
278
|
- test/unit/gateways/secure_pay_tech_test.rb
|
@@ -336,6 +346,7 @@ files:
|
|
336
346
|
- test
|
337
347
|
has_rdoc: true
|
338
348
|
homepage: http://www.activemerchant.org/
|
349
|
+
licenses:
|
339
350
|
post_install_message:
|
340
351
|
rdoc_options: []
|
341
352
|
|
@@ -356,7 +367,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
356
367
|
requirements: []
|
357
368
|
|
358
369
|
rubyforge_project:
|
359
|
-
rubygems_version: 1.
|
370
|
+
rubygems_version: 1.3.5
|
360
371
|
signing_key:
|
361
372
|
specification_version: 2
|
362
373
|
summary: Active Merchant is a simple payment abstraction library used in and sponsored by Shopify.
|
@@ -1,139 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class ProtxTest < Test::Unit::TestCase
|
4
|
-
def setup
|
5
|
-
@gateway = ProtxGateway.new(
|
6
|
-
:login => 'X'
|
7
|
-
)
|
8
|
-
|
9
|
-
@credit_card = credit_card('4242424242424242', :type => 'visa')
|
10
|
-
@options = {
|
11
|
-
:billing_address => {
|
12
|
-
:name => 'Tekin Suleyman',
|
13
|
-
:address1 => 'Flat 10 Lapwing Court',
|
14
|
-
:address2 => 'West Didsbury',
|
15
|
-
:city => "Manchester",
|
16
|
-
:county => 'Greater Manchester',
|
17
|
-
:country => 'GB',
|
18
|
-
:zip => 'M20 2PS'
|
19
|
-
},
|
20
|
-
:order_id => '1',
|
21
|
-
:description => 'Store purchase',
|
22
|
-
:ip => '86.150.65.37',
|
23
|
-
:email => 'tekin@tekin.co.uk',
|
24
|
-
:phone => '0161 123 4567'
|
25
|
-
}
|
26
|
-
@amount = 100
|
27
|
-
end
|
28
|
-
|
29
|
-
def test_successful_purchase
|
30
|
-
@gateway.expects(:ssl_post).returns(successful_purchase_response)
|
31
|
-
|
32
|
-
assert response = @gateway.purchase(@amount, @credit_card, @options)
|
33
|
-
assert_instance_of Response, response
|
34
|
-
assert_equal "1;B8AE1CF6-9DEF-C876-1BB4-9B382E6CE520;4193753;OHMETD7DFK;purchase", response.authorization
|
35
|
-
assert_success response
|
36
|
-
end
|
37
|
-
|
38
|
-
def test_unsuccessful_purchase
|
39
|
-
@gateway.expects(:ssl_post).returns(unsuccessful_purchase_response)
|
40
|
-
|
41
|
-
assert response = @gateway.purchase(@amount, @credit_card, @options)
|
42
|
-
assert_instance_of Response, response
|
43
|
-
assert_failure response
|
44
|
-
end
|
45
|
-
|
46
|
-
def test_purchase_url
|
47
|
-
assert_equal 'https://ukvpstest.protx.com/vspgateway/service/vspdirect-register.vsp', @gateway.send(:url_for, :purchase)
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_capture_url
|
51
|
-
assert_equal 'https://ukvpstest.protx.com/vspgateway/service/release.vsp', @gateway.send(:url_for, :capture)
|
52
|
-
end
|
53
|
-
|
54
|
-
def test_electron_cards
|
55
|
-
# Visa range
|
56
|
-
assert_no_match ProtxGateway::ELECTRON, '4245180000000000'
|
57
|
-
|
58
|
-
# First electron range
|
59
|
-
assert_match ProtxGateway::ELECTRON, '4245190000000000'
|
60
|
-
|
61
|
-
# Second range
|
62
|
-
assert_match ProtxGateway::ELECTRON, '4249620000000000'
|
63
|
-
assert_match ProtxGateway::ELECTRON, '4249630000000000'
|
64
|
-
|
65
|
-
# Third
|
66
|
-
assert_match ProtxGateway::ELECTRON, '4508750000000000'
|
67
|
-
|
68
|
-
# Fourth
|
69
|
-
assert_match ProtxGateway::ELECTRON, '4844060000000000'
|
70
|
-
assert_match ProtxGateway::ELECTRON, '4844080000000000'
|
71
|
-
|
72
|
-
# Fifth
|
73
|
-
assert_match ProtxGateway::ELECTRON, '4844110000000000'
|
74
|
-
assert_match ProtxGateway::ELECTRON, '4844550000000000'
|
75
|
-
|
76
|
-
# Sixth
|
77
|
-
assert_match ProtxGateway::ELECTRON, '4917300000000000'
|
78
|
-
assert_match ProtxGateway::ELECTRON, '4917590000000000'
|
79
|
-
|
80
|
-
# Seventh
|
81
|
-
assert_match ProtxGateway::ELECTRON, '4918800000000000'
|
82
|
-
|
83
|
-
# Visa
|
84
|
-
assert_no_match ProtxGateway::ELECTRON, '4918810000000000'
|
85
|
-
|
86
|
-
# 19 PAN length
|
87
|
-
assert_match ProtxGateway::ELECTRON, '4249620000000000000'
|
88
|
-
|
89
|
-
# 20 PAN length
|
90
|
-
assert_no_match ProtxGateway::ELECTRON, '42496200000000000'
|
91
|
-
end
|
92
|
-
|
93
|
-
def test_avs_result
|
94
|
-
@gateway.expects(:ssl_post).returns(successful_purchase_response)
|
95
|
-
|
96
|
-
response = @gateway.purchase(@amount, @credit_card, @options)
|
97
|
-
assert_equal 'Y', response.avs_result['postal_match']
|
98
|
-
assert_equal 'N', response.avs_result['street_match']
|
99
|
-
end
|
100
|
-
|
101
|
-
def test_cvv_result
|
102
|
-
@gateway.expects(:ssl_post).returns(successful_purchase_response)
|
103
|
-
|
104
|
-
response = @gateway.purchase(@amount, @credit_card, @options)
|
105
|
-
assert_equal 'N', response.cvv_result['code']
|
106
|
-
end
|
107
|
-
|
108
|
-
private
|
109
|
-
|
110
|
-
def successful_purchase_response
|
111
|
-
<<-RESP
|
112
|
-
VPSProtocol=2.23
|
113
|
-
Status=OK
|
114
|
-
StatusDetail=0000 : The Authorisation was Successful.
|
115
|
-
VPSTxId=B8AE1CF6-9DEF-C876-1BB4-9B382E6CE520
|
116
|
-
SecurityKey=OHMETD7DFK
|
117
|
-
TxAuthNo=4193753
|
118
|
-
AVSCV2=NO DATA MATCHES
|
119
|
-
AddressResult=NOTMATCHED
|
120
|
-
PostCodeResult=MATCHED
|
121
|
-
CV2Result=NOTMATCHED
|
122
|
-
3DSecureStatus=NOTCHECKED
|
123
|
-
RESP
|
124
|
-
end
|
125
|
-
|
126
|
-
def unsuccessful_purchase_response
|
127
|
-
<<-RESP
|
128
|
-
VPSProtocol=2.23
|
129
|
-
Status=NOTAUTHED
|
130
|
-
StatusDetail=VSP Direct transaction from VSP Simulator.
|
131
|
-
VPSTxId=7BBA9078-8489-48CD-BF0D-10B0E6B0EF30
|
132
|
-
SecurityKey=DKDYLDYLXV
|
133
|
-
AVSCV2=ALL MATCH
|
134
|
-
AddressResult=MATCHED
|
135
|
-
PostCodeResult=MATCHED
|
136
|
-
CV2Result=MATCHED
|
137
|
-
RESP
|
138
|
-
end
|
139
|
-
end
|