activemerchant 1.2.1 → 1.3.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.
- data.tar.gz.sig +0 -0
- data/CHANGELOG +310 -294
- data/CONTRIBUTERS +13 -0
- data/README +55 -31
- data/Rakefile +21 -13
- data/lib/active_merchant.rb +7 -0
- data/lib/active_merchant/billing/avs_result.rb +95 -0
- data/lib/active_merchant/billing/base.rb +8 -3
- data/lib/active_merchant/billing/check.rb +61 -0
- data/lib/active_merchant/billing/credit_card.rb +104 -80
- data/lib/active_merchant/billing/credit_card_formatting.rb +11 -8
- data/lib/active_merchant/billing/credit_card_methods.rb +76 -32
- data/lib/active_merchant/billing/cvv_result.rb +38 -0
- data/lib/active_merchant/billing/expiry_date.rb +28 -0
- data/lib/active_merchant/billing/gateway.rb +47 -111
- data/lib/active_merchant/billing/gateways/authorize_net.rb +508 -121
- data/lib/active_merchant/billing/gateways/bogus.rb +26 -32
- data/lib/active_merchant/billing/gateways/brain_tree.rb +82 -70
- data/lib/active_merchant/billing/gateways/card_stream.rb +43 -15
- data/lib/active_merchant/billing/gateways/cyber_source.rb +9 -29
- data/lib/active_merchant/billing/gateways/data_cash.rb +18 -38
- data/lib/active_merchant/billing/gateways/efsnet.rb +23 -50
- data/lib/active_merchant/billing/gateways/eway.rb +8 -19
- data/lib/active_merchant/billing/gateways/exact.rb +17 -25
- data/lib/active_merchant/billing/gateways/linkpoint.rb +18 -25
- data/lib/active_merchant/billing/gateways/moneris.rb +9 -39
- data/lib/active_merchant/billing/gateways/net_registry.rb +113 -182
- data/lib/active_merchant/billing/gateways/netbilling.rb +168 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +52 -73
- data/lib/active_merchant/billing/gateways/pay_secure.rb +120 -0
- data/lib/active_merchant/billing/gateways/payflow.rb +13 -14
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +55 -37
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +4 -0
- data/lib/active_merchant/billing/gateways/payflow_express.rb +2 -4
- data/lib/active_merchant/billing/gateways/payment_express.rb +11 -30
- data/lib/active_merchant/billing/gateways/paypal.rb +3 -14
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +36 -16
- data/lib/active_merchant/billing/gateways/paypal_express.rb +1 -2
- data/lib/active_merchant/billing/gateways/plugnpay.rb +7 -15
- data/lib/active_merchant/billing/gateways/protx.rb +24 -25
- data/lib/active_merchant/billing/gateways/psigate.rb +34 -71
- data/lib/active_merchant/billing/gateways/psl_card.rb +24 -19
- data/lib/active_merchant/billing/gateways/quickpay.rb +10 -24
- data/lib/active_merchant/billing/gateways/realex.rb +7 -19
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +113 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +437 -0
- data/lib/active_merchant/billing/gateways/trans_first.rb +5 -14
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +100 -39
- data/lib/active_merchant/billing/gateways/usa_epay.rb +60 -55
- data/lib/active_merchant/billing/gateways/verifi.rb +32 -39
- data/lib/active_merchant/billing/gateways/viaklix.rb +31 -37
- data/lib/active_merchant/billing/integrations.rb +2 -0
- data/lib/active_merchant/billing/integrations/bogus.rb +5 -0
- data/lib/active_merchant/billing/integrations/bogus/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/chronopay.rb +5 -0
- data/lib/active_merchant/billing/integrations/chronopay/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/gestpay.rb +5 -0
- data/lib/active_merchant/billing/integrations/gestpay/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/hi_trust.rb +26 -0
- data/lib/active_merchant/billing/integrations/hi_trust/helper.rb +58 -0
- data/lib/active_merchant/billing/integrations/hi_trust/notification.rb +57 -0
- data/lib/active_merchant/billing/integrations/hi_trust/return.rb +67 -0
- data/lib/active_merchant/billing/integrations/nochex.rb +5 -0
- data/lib/active_merchant/billing/integrations/nochex/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/paypal.rb +5 -0
- data/lib/active_merchant/billing/integrations/paypal/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/return.rb +35 -0
- data/lib/active_merchant/billing/integrations/two_checkout.rb +5 -0
- data/lib/active_merchant/billing/integrations/two_checkout/return.rb +17 -0
- data/lib/active_merchant/billing/response.rb +12 -8
- data/lib/active_merchant/lib/posts_data.rb +39 -7
- data/lib/active_merchant/lib/requires_parameters.rb +2 -3
- data/lib/active_merchant/lib/utils.rb +18 -0
- data/lib/active_merchant/lib/validateable.rb +3 -3
- data/lib/support/gateway_support.rb +22 -9
- data/script/destroy +14 -0
- data/script/generate +7 -7
- data/test/fixtures.yml +25 -3
- data/test/remote/gateways/remote_authorize_net_test.rb +145 -0
- data/test/remote/gateways/remote_brain_tree_test.rb +118 -0
- data/test/{remote_tests → remote/gateways}/remote_card_stream_test.rb +56 -68
- data/test/{remote_tests → remote/gateways}/remote_cyber_source_test.rb +21 -32
- data/test/{remote_tests → remote/gateways}/remote_data_cash_test.rb +2 -2
- data/test/{remote_tests → remote/gateways}/remote_efsnet_test.rb +22 -34
- data/test/{remote_tests → remote/gateways}/remote_eway_test.rb +18 -15
- data/test/{remote_tests → remote/gateways}/remote_exact_test.rb +20 -19
- data/test/{remote_tests → remote/gateways}/remote_linkpoint_test.rb +31 -63
- data/test/remote/gateways/remote_moneris_test.rb +82 -0
- data/test/{remote_tests → remote/gateways}/remote_net_registry_test.rb +19 -54
- data/test/remote/gateways/remote_netbilling_test.rb +70 -0
- data/test/{remote_tests → remote/gateways}/remote_pay_junction_test.rb +41 -60
- data/test/remote/gateways/remote_pay_secure_test.rb +39 -0
- data/test/{remote_tests → remote/gateways}/remote_payflow_express_test.rb +2 -2
- data/test/{remote_tests → remote/gateways}/remote_payflow_test.rb +34 -38
- data/test/{remote_tests → remote/gateways}/remote_payflow_uk_test.rb +13 -12
- data/test/{remote_tests → remote/gateways}/remote_payment_express_test.rb +26 -36
- data/test/{remote_tests → remote/gateways}/remote_paypal_express_test.rb +3 -3
- data/test/{remote_tests → remote/gateways}/remote_paypal_test.rb +25 -21
- data/test/{remote_tests → remote/gateways}/remote_plugnpay_test.rb +18 -16
- data/test/{remote_tests → remote/gateways}/remote_protx_test.rb +33 -33
- data/test/remote/gateways/remote_psigate_test.rb +50 -0
- data/test/{remote_tests → remote/gateways}/remote_psl_card_test.rb +27 -26
- data/test/{remote_tests → remote/gateways}/remote_quickpay_test.rb +48 -48
- data/test/{remote_tests → remote/gateways}/remote_realex_test.rb +30 -33
- data/test/remote/gateways/remote_secure_pay_tech_test.rb +37 -0
- data/test/remote/gateways/remote_secure_pay_test.rb +28 -0
- data/test/remote/gateways/remote_skipjack_test.rb +105 -0
- data/test/{remote_tests → remote/gateways}/remote_trans_first_test.rb +7 -10
- data/test/remote/gateways/remote_trust_commerce_test.rb +152 -0
- data/test/{remote_tests → remote/gateways}/remote_usa_epay_test.rb +11 -22
- data/test/{remote_tests → remote/gateways}/remote_verifi_test.rb +27 -27
- data/test/{remote_tests → remote/gateways}/remote_viaklix_test.rb +8 -18
- data/test/{remote_tests → remote/integrations}/remote_gestpay_integration_test.rb +1 -1
- data/test/{remote_tests → remote/integrations}/remote_paypal_integration_test.rb +1 -1
- data/test/test_helper.rb +102 -61
- data/test/unit/avs_result_test.rb +59 -0
- data/test/unit/base_test.rb +33 -39
- data/test/unit/check_test.rb +76 -0
- data/test/unit/credit_card_formatting_test.rb +10 -15
- data/test/unit/credit_card_methods_test.rb +132 -17
- data/test/unit/credit_card_test.rb +157 -228
- data/test/unit/cvv_result_test.rb +33 -0
- data/test/unit/expiry_date_test.rb +21 -0
- data/test/unit/gateways/authorize_net_test.rb +180 -40
- data/test/unit/gateways/bogus_test.rb +2 -3
- data/test/unit/gateways/brain_tree_test.rb +63 -29
- data/test/unit/gateways/card_stream_test.rb +59 -6
- data/test/unit/gateways/cyber_source_test.rb +59 -40
- data/test/unit/gateways/data_cash_test.rb +82 -1
- data/test/unit/gateways/efsnet_test.rb +97 -44
- data/test/unit/gateways/eway_test.rb +55 -42
- data/test/unit/gateways/exact_test.rb +93 -55
- data/test/unit/gateways/gateway_test.rb +7 -0
- data/test/unit/gateways/linkpoint_test.rb +60 -58
- data/test/unit/gateways/moneris_test.rb +67 -76
- data/test/unit/gateways/net_registry_test.rb +351 -419
- data/test/unit/gateways/netbilling_test.rb +54 -0
- data/test/unit/gateways/pay_junction_test.rb +108 -46
- data/test/unit/gateways/pay_secure_test.rb +71 -0
- data/test/unit/gateways/payflow_express_test.rb +0 -8
- data/test/unit/gateways/payflow_test.rb +136 -65
- data/test/unit/gateways/payflow_uk_test.rb +0 -38
- data/test/unit/gateways/payment_express_test.rb +31 -51
- data/test/unit/gateways/paypal_express_test.rb +8 -2
- data/test/unit/gateways/paypal_test.rb +213 -54
- data/test/unit/gateways/plugnpay_test.rb +39 -32
- data/test/unit/gateways/protx_test.rb +45 -33
- data/test/unit/gateways/psigate_test.rb +146 -87
- data/test/unit/gateways/psl_card_test.rb +37 -24
- data/test/unit/gateways/quickpay_test.rb +33 -46
- data/test/unit/gateways/realex_test.rb +32 -31
- data/test/unit/gateways/secure_pay_tech_test.rb +44 -0
- data/test/unit/gateways/secure_pay_test.rb +35 -26
- data/test/unit/gateways/skip_jack_test.rb +125 -0
- data/test/unit/gateways/trans_first_test.rb +24 -37
- data/test/unit/gateways/trust_commerce_test.rb +47 -26
- data/test/unit/gateways/usa_epay_test.rb +52 -41
- data/test/unit/gateways/verifi_test.rb +41 -35
- data/test/unit/gateways/viaklix_test.rb +38 -32
- data/test/unit/generators/test_gateway_generator.rb +46 -0
- data/test/unit/generators/test_generator_helper.rb +20 -0
- data/test/unit/generators/test_integration_generator.rb +53 -0
- data/test/unit/integrations/action_view_helper_test.rb +7 -14
- data/test/unit/integrations/bogus_module_test.rb +4 -0
- data/test/unit/integrations/chronopay_module_test.rb +4 -0
- data/test/unit/integrations/gestpay_module_test.rb +4 -0
- data/test/unit/integrations/helpers/hi_trust_helper_test.rb +16 -0
- data/test/unit/integrations/hi_trust_module_test.rb +13 -0
- data/test/unit/integrations/nochex_module_test.rb +4 -0
- data/test/unit/integrations/notifications/hi_trust_notification_test.rb +38 -0
- data/test/unit/integrations/paypal_module_test.rb +4 -0
- data/test/unit/integrations/returns/chronopay_return_test.rb +11 -0
- data/test/unit/integrations/returns/gestpay_return_test.rb +10 -0
- data/test/unit/integrations/returns/hi_trust_return_test.rb +24 -0
- data/test/unit/integrations/returns/nochex_return_test.rb +10 -0
- data/test/unit/integrations/returns/paypal_return_test.rb +10 -0
- data/test/unit/integrations/returns/return_test.rb +11 -0
- data/test/unit/integrations/returns/two_checkout_return_test.rb +24 -0
- data/test/unit/integrations/two_checkout_module_test.rb +4 -0
- data/test/unit/posts_data_test.rb +86 -0
- data/test/unit/response_test.rb +15 -1
- data/test/unit/utils_test.rb +7 -0
- data/test/unit/validateable_test.rb +10 -6
- metadata +180 -142
- metadata.gz.sig +0 -0
- data/lib/active_merchant/billing/gateways/paypal/api_cert_chain.crt +0 -35
- data/script/generator/base.rb +0 -45
- data/script/generator/generator.rb +0 -24
- data/script/generator/generators/gateway/gateway_generator.rb +0 -14
- data/script/generator/generators/gateway/templates/gateway.rb +0 -73
- data/script/generator/generators/gateway/templates/gateway_test.rb +0 -41
- data/script/generator/generators/gateway/templates/remote_gateway_test.rb +0 -56
- data/script/generator/generators/integration/integration_generator.rb +0 -25
- data/script/generator/generators/integration/templates/helper.rb +0 -34
- data/script/generator/generators/integration/templates/helper_test.rb +0 -54
- data/script/generator/generators/integration/templates/integration.rb +0 -18
- data/script/generator/generators/integration/templates/module_test.rb +0 -9
- data/script/generator/generators/integration/templates/notification.rb +0 -100
- data/script/generator/generators/integration/templates/notification_test.rb +0 -41
- data/script/generator/manifest.rb +0 -20
- data/test/remote_tests/remote_authorize_net_test.rb +0 -113
- data/test/remote_tests/remote_brain_tree_test.rb +0 -78
- data/test/remote_tests/remote_moneris_test.rb +0 -110
- data/test/remote_tests/remote_psigate_test.rb +0 -87
- data/test/remote_tests/remote_secure_pay_test.rb +0 -36
- data/test/remote_tests/remote_trust_commerce_test.rb +0 -136
|
@@ -1,46 +1,34 @@
|
|
|
1
1
|
require File.dirname(__FILE__) + '/../../test_helper'
|
|
2
2
|
|
|
3
|
-
class
|
|
3
|
+
class MonerisTest < Test::Unit::TestCase
|
|
4
4
|
def setup
|
|
5
|
+
Base.mode = :test
|
|
6
|
+
|
|
5
7
|
@gateway = MonerisGateway.new(
|
|
6
8
|
:login => 'store1',
|
|
7
9
|
:password => 'yesguy'
|
|
8
10
|
)
|
|
9
11
|
|
|
10
|
-
@
|
|
12
|
+
@amount = 100
|
|
13
|
+
@credit_card = credit_card('4242424242424242')
|
|
14
|
+
@options = { :order_id => '1', :billing_address => address }
|
|
11
15
|
end
|
|
12
16
|
|
|
13
|
-
def
|
|
14
|
-
|
|
15
|
-
end
|
|
17
|
+
def test_successful_purchase
|
|
18
|
+
@gateway.expects(:ssl_post).returns(successful_purchase_response)
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
assert response = @gateway.purchase(100, @creditcard, :order_id => 1)
|
|
21
|
-
assert_equal Response, response.class
|
|
22
|
-
assert_equal '#0001', response.params['receiptid']
|
|
23
|
-
assert_equal true, response.success?
|
|
20
|
+
assert response = @gateway.authorize(100, @credit_card, @options)
|
|
21
|
+
assert_success response
|
|
22
|
+
assert_equal '58-0_3;1026.1', response.authorization
|
|
24
23
|
end
|
|
25
24
|
|
|
26
|
-
def
|
|
27
|
-
@
|
|
28
|
-
|
|
29
|
-
assert response = @gateway.purchase(100, @creditcard, :order_id => 1)
|
|
30
|
-
assert_equal Response, response.class
|
|
31
|
-
assert_equal '#0001', response.params['receiptid']
|
|
32
|
-
assert_equal false, response.success?
|
|
33
|
-
|
|
34
|
-
end
|
|
25
|
+
def test_failed_purchase
|
|
26
|
+
@gateway.expects(:ssl_post).returns(failed_purchase_response)
|
|
35
27
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
assert_raise(Error) do
|
|
40
|
-
assert response = @gateway.purchase(100, @creditcard, :order_id => 1)
|
|
41
|
-
end
|
|
28
|
+
assert response = @gateway.authorize(100, @credit_card, @options)
|
|
29
|
+
assert_failure response
|
|
42
30
|
end
|
|
43
|
-
|
|
31
|
+
|
|
44
32
|
def test_amount_style
|
|
45
33
|
assert_equal '10.34', @gateway.send(:amount, 1034)
|
|
46
34
|
|
|
@@ -64,28 +52,6 @@ class MonerisResponseTest < Test::Unit::TestCase
|
|
|
64
52
|
assert_equal xml_capture_fixture.size, data.size
|
|
65
53
|
end
|
|
66
54
|
|
|
67
|
-
private
|
|
68
|
-
|
|
69
|
-
def xml_purchase_fixture
|
|
70
|
-
%q{<request><store_id>store1</store_id><api_token>yesguy</api_token><purchase><amount>1.01</amount><pan>4242424242424242</pan><expdate>0303</expdate><crypt_type>7</crypt_type><order_id>order1</order_id></purchase></request>}
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
def xml_capture_fixture
|
|
74
|
-
%q{<request><store_id>store1</store_id><api_token>yesguy</api_token><preauth><amount>1.01</amount><pan>4242424242424242</pan><expdate>0303</expdate><crypt_type>7</crypt_type><order_id>order1</order_id></preauth></request>}
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
class MonerisRequestTest < Test::Unit::TestCase
|
|
81
|
-
def setup
|
|
82
|
-
@gateway = MonerisGateway.new(
|
|
83
|
-
:login => 'store1',
|
|
84
|
-
:password => 'yesguy'
|
|
85
|
-
)
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
|
|
89
55
|
def test_purchase_is_valid_xml
|
|
90
56
|
|
|
91
57
|
params = {
|
|
@@ -115,26 +81,6 @@ class MonerisRequestTest < Test::Unit::TestCase
|
|
|
115
81
|
assert REXML::Document.new(data)
|
|
116
82
|
assert_equal xml_capture_fixture.size, data.size
|
|
117
83
|
end
|
|
118
|
-
|
|
119
|
-
def test_access_url_for_test_environment
|
|
120
|
-
Base.mode = :test
|
|
121
|
-
gateway = MonerisGateway.new(
|
|
122
|
-
:login => 'store1',
|
|
123
|
-
:password => 'yesguy'
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
assert_equal 'https://esqa.moneris.com/gateway2/servlet/MpgRequest', gateway.url
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
def test_access_url_for_production_environment
|
|
130
|
-
Base.mode = :production
|
|
131
|
-
gateway = MonerisGateway.new(
|
|
132
|
-
:login => 'store1',
|
|
133
|
-
:password => 'yesguy'
|
|
134
|
-
)
|
|
135
|
-
|
|
136
|
-
assert_equal 'https://www3.moneris.com/gateway2/servlet/MpgRequest', gateway.url
|
|
137
|
-
end
|
|
138
84
|
|
|
139
85
|
def test_supported_countries
|
|
140
86
|
assert_equal ['CA'], MonerisGateway.supported_countries
|
|
@@ -150,18 +96,63 @@ class MonerisRequestTest < Test::Unit::TestCase
|
|
|
150
96
|
end
|
|
151
97
|
end
|
|
152
98
|
|
|
153
|
-
|
|
154
|
-
|
|
99
|
+
private
|
|
100
|
+
def successful_purchase_response
|
|
101
|
+
<<-RESPONSE
|
|
102
|
+
<?xml version="1.0"?>
|
|
103
|
+
<response>
|
|
104
|
+
<receipt>
|
|
105
|
+
<ReceiptId>1026.1</ReceiptId>
|
|
106
|
+
<ReferenceNum>661221050010170010</ReferenceNum>
|
|
107
|
+
<ResponseCode>027</ResponseCode>
|
|
108
|
+
<ISO>01</ISO>
|
|
109
|
+
<AuthCode>013511</AuthCode>
|
|
110
|
+
<TransTime>18:41:13</TransTime>
|
|
111
|
+
<TransDate>2008-01-05</TransDate>
|
|
112
|
+
<TransType>00</TransType>
|
|
113
|
+
<Complete>true</Complete>
|
|
114
|
+
<Message>APPROVED * =</Message>
|
|
115
|
+
<TransAmount>1.00</TransAmount>
|
|
116
|
+
<CardType>V</CardType>
|
|
117
|
+
<TransID>58-0_3</TransID>
|
|
118
|
+
<TimedOut>false</TimedOut>
|
|
119
|
+
</receipt>
|
|
120
|
+
</response>
|
|
121
|
+
|
|
122
|
+
RESPONSE
|
|
155
123
|
end
|
|
156
|
-
|
|
157
|
-
|
|
124
|
+
|
|
125
|
+
def failed_purchase_response
|
|
126
|
+
<<-RESPONSE
|
|
127
|
+
<?xml version="1.0"?>
|
|
128
|
+
<response>
|
|
129
|
+
<receipt>
|
|
130
|
+
<ReceiptId>1026.1</ReceiptId>
|
|
131
|
+
<ReferenceNum>661221050010170010</ReferenceNum>
|
|
132
|
+
<ResponseCode>481</ResponseCode>
|
|
133
|
+
<ISO>01</ISO>
|
|
134
|
+
<AuthCode>013511</AuthCode>
|
|
135
|
+
<TransTime>18:41:13</TransTime>
|
|
136
|
+
<TransDate>2008-01-05</TransDate>
|
|
137
|
+
<TransType>00</TransType>
|
|
138
|
+
<Complete>true</Complete>
|
|
139
|
+
<Message>DECLINED * =</Message>
|
|
140
|
+
<TransAmount>1.00</TransAmount>
|
|
141
|
+
<CardType>V</CardType>
|
|
142
|
+
<TransID>97-2-0</TransID>
|
|
143
|
+
<TimedOut>false</TimedOut>
|
|
144
|
+
</receipt>
|
|
145
|
+
</response>
|
|
146
|
+
|
|
147
|
+
RESPONSE
|
|
148
|
+
end
|
|
158
149
|
|
|
159
150
|
def xml_purchase_fixture
|
|
160
|
-
|
|
151
|
+
'<request><store_id>store1</store_id><api_token>yesguy</api_token><purchase><amount>1.01</amount><pan>4242424242424242</pan><expdate>0303</expdate><crypt_type>7</crypt_type><order_id>order1</order_id></purchase></request>'
|
|
161
152
|
end
|
|
162
153
|
|
|
163
154
|
def xml_capture_fixture
|
|
164
|
-
|
|
155
|
+
'<request><store_id>store1</store_id><api_token>yesguy</api_token><preauth><amount>1.01</amount><pan>4242424242424242</pan><expdate>0303</expdate><crypt_type>7</crypt_type><order_id>order1</order_id></preauth></request>'
|
|
165
156
|
end
|
|
166
157
|
|
|
167
158
|
end
|
|
@@ -1,478 +1,410 @@
|
|
|
1
|
-
require 'test/unit'
|
|
2
1
|
require File.dirname(__FILE__) + '/../../test_helper'
|
|
3
|
-
require 'stringio'
|
|
4
2
|
|
|
5
3
|
class NetRegistryTest < Test::Unit::TestCase
|
|
6
|
-
include ActiveMerchant::Billing
|
|
7
|
-
|
|
8
4
|
def setup
|
|
9
|
-
@log_io = StringIO.new
|
|
10
5
|
@gateway = NetRegistryGateway.new(
|
|
11
6
|
:login => 'X',
|
|
12
|
-
:password => 'Y'
|
|
13
|
-
:logger => Logger.new(@log_io)
|
|
7
|
+
:password => 'Y'
|
|
14
8
|
)
|
|
15
9
|
|
|
16
|
-
@
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
:
|
|
20
|
-
:
|
|
21
|
-
|
|
22
|
-
:type => :visa,
|
|
23
|
-
})
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def test_purchase_success
|
|
27
|
-
@creditcard.number = 1
|
|
28
|
-
|
|
29
|
-
assert response = @gateway.purchase(100, @creditcard)
|
|
30
|
-
assert_equal Response, response.class
|
|
31
|
-
assert_equal '#0001', response.params['receiptid']
|
|
32
|
-
assert_equal true, response.success?
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def test_purchase_error
|
|
36
|
-
@creditcard.number = 2
|
|
37
|
-
|
|
38
|
-
assert response = @gateway.purchase(100, @creditcard, :order_id => 1)
|
|
39
|
-
assert_equal Response, response.class
|
|
40
|
-
assert_equal '#0001', response.params['receiptid']
|
|
41
|
-
assert_equal false, response.success?
|
|
42
|
-
|
|
10
|
+
@amount = 100
|
|
11
|
+
@credit_card = credit_card
|
|
12
|
+
@options = {
|
|
13
|
+
:order_id => '1',
|
|
14
|
+
:billing_address => address
|
|
15
|
+
}
|
|
43
16
|
end
|
|
44
17
|
|
|
45
|
-
def
|
|
46
|
-
@
|
|
18
|
+
def test_filtered_fields
|
|
19
|
+
@gateway.stubs(:ssl_post).returns(successful_purchase_response)
|
|
20
|
+
response = @gateway.purchase(@amount, @credit_card, @options)
|
|
47
21
|
|
|
48
|
-
|
|
49
|
-
|
|
22
|
+
NetRegistryGateway::FILTERED_PARAMS.each do |param|
|
|
23
|
+
assert_false response.params.has_key?(param)
|
|
50
24
|
end
|
|
51
25
|
end
|
|
52
|
-
|
|
26
|
+
|
|
53
27
|
def test_successful_purchase
|
|
54
|
-
|
|
55
|
-
|
|
28
|
+
@gateway.stubs(:ssl_post).returns(successful_purchase_response)
|
|
29
|
+
|
|
30
|
+
response = @gateway.purchase(@amount, @credit_card, @options)
|
|
56
31
|
assert_success response
|
|
57
|
-
assert_match
|
|
32
|
+
assert_match '0707161858000000', response.authorization
|
|
58
33
|
end
|
|
59
34
|
|
|
60
35
|
def test_successful_credit
|
|
61
|
-
|
|
62
|
-
response = @gateway.credit(
|
|
36
|
+
@gateway.stubs(:ssl_post).returns(successful_credit_response)
|
|
37
|
+
response = @gateway.credit(@amount, '0707161858000000', @options)
|
|
63
38
|
assert_success response
|
|
64
39
|
end
|
|
65
40
|
|
|
66
41
|
def test_successful_authorization
|
|
67
|
-
|
|
68
|
-
response = @gateway.authorize(
|
|
42
|
+
@gateway.stubs(:ssl_post).returns(successful_authorization_response)
|
|
43
|
+
response = @gateway.authorize(@amount, @credit_card, @options)
|
|
69
44
|
assert_success response
|
|
70
45
|
assert_match /\A\d{6}\z/, response.authorization
|
|
46
|
+
assert_equal '000000', response.authorization
|
|
71
47
|
end
|
|
72
48
|
|
|
73
49
|
def test_successful_authorization_and_capture
|
|
74
|
-
|
|
75
|
-
|
|
50
|
+
@gateway.stubs(:ssl_post).returns(successful_authorization_response, successful_capture_response)
|
|
51
|
+
|
|
52
|
+
response = @gateway.authorize(@amount, @credit_card, @options)
|
|
76
53
|
assert_success response
|
|
77
54
|
assert_match /\A\d{6}\z/, response.authorization
|
|
78
55
|
|
|
79
|
-
|
|
80
|
-
response = @gateway.capture(100, response.authorization, :credit_card => @creditcard)
|
|
56
|
+
response = @gateway.capture(@amount, response.authorization, :credit_card => @credit_card)
|
|
81
57
|
assert_success response
|
|
82
58
|
end
|
|
83
59
|
|
|
84
60
|
def test_purchase_with_invalid_credit_card
|
|
85
|
-
|
|
86
|
-
|
|
61
|
+
@gateway.stubs(:ssl_post).returns(purchase_with_invalid_credit_card_response)
|
|
62
|
+
|
|
63
|
+
response = @gateway.purchase(@amount, @credit_card, @options)
|
|
87
64
|
assert_failure response
|
|
88
65
|
assert_equal 'INVALID CARD', response.message
|
|
89
66
|
end
|
|
90
67
|
|
|
91
68
|
def test_purchase_with_expired_credit_card
|
|
92
|
-
|
|
93
|
-
|
|
69
|
+
@gateway.stubs(:ssl_post).returns(purchase_with_expired_credit_card_response)
|
|
70
|
+
|
|
71
|
+
response = @gateway.purchase(@amount, @credit_card, @options)
|
|
94
72
|
assert_failure response
|
|
95
73
|
assert_equal 'CARD EXPIRED', response.message
|
|
96
74
|
end
|
|
97
75
|
|
|
98
76
|
def test_purchase_with_invalid_month
|
|
99
|
-
|
|
100
|
-
|
|
77
|
+
@gateway.stubs(:ssl_post).returns(purchase_with_invalid_month_response)
|
|
78
|
+
|
|
79
|
+
response = @gateway.purchase(@amount, @credit_card, @options)
|
|
101
80
|
assert_failure response
|
|
102
81
|
assert_equal 'Invalid month', response.message
|
|
103
82
|
end
|
|
104
83
|
|
|
105
|
-
def test_transaction_with_logging
|
|
106
|
-
stub_gateway_response 'successful_purchase'
|
|
107
|
-
response = @gateway.purchase(100, @creditcard)
|
|
108
|
-
assert_success response
|
|
109
|
-
|
|
110
|
-
# check send line
|
|
111
|
-
sent_line = log_text.grep(/sending/).first
|
|
112
|
-
assert sent_line
|
|
113
|
-
sent_line.chomp!
|
|
114
|
-
|
|
115
|
-
# command should appear
|
|
116
|
-
assert_match /COMMAND=purchase/, sent_line
|
|
117
|
-
# card number should be masked
|
|
118
|
-
number = sent_line[/CCNUM=(.{16})/][6..-1]
|
|
119
|
-
assert_match /\*{12}/, sent_line
|
|
120
|
-
# card expiry should be masked
|
|
121
|
-
expiry = sent_line[/CCEXP=([^&]*)/][6..-1]
|
|
122
|
-
assert_match /\*+\/\*+/, expiry
|
|
123
|
-
|
|
124
|
-
# check received text
|
|
125
|
-
received_text = log_text.grep(/^ /).join
|
|
126
|
-
assert !received_text.empty?
|
|
127
|
-
# card number should be masked
|
|
128
|
-
received_text.scan(/card_(?:number|no)=(.*)$/) do
|
|
129
|
-
value = $1
|
|
130
|
-
assert_match /\*{12}/, value
|
|
131
|
-
end
|
|
132
|
-
# card_expiry should be masked
|
|
133
|
-
received_text.scan(/card_expiry=(.*)$/) do
|
|
134
|
-
value = $1
|
|
135
|
-
assert_match /\*+\/\*+/, value
|
|
136
|
-
end
|
|
137
|
-
end
|
|
138
|
-
|
|
139
|
-
def test_transaction_without_logging
|
|
140
|
-
stub_gateway_response 'successful_purchase'
|
|
141
|
-
@gateway.logger = nil
|
|
142
|
-
response = @gateway.purchase(100, @creditcard)
|
|
143
|
-
assert_success response
|
|
144
|
-
assert log_text.empty?
|
|
145
|
-
end
|
|
146
|
-
|
|
147
84
|
def test_bad_login
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
85
|
+
gateway = NetRegistryGateway.new(:login => 'bad-login', :password => 'bad-login')
|
|
86
|
+
gateway.stubs(:ssl_post).returns(bad_login_response)
|
|
87
|
+
|
|
88
|
+
response = gateway.purchase(@amount, @credit_card, @options)
|
|
151
89
|
assert_failure response
|
|
152
90
|
assert_equal 'failed', response.params['status']
|
|
153
91
|
end
|
|
154
92
|
|
|
155
|
-
private
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
93
|
+
private
|
|
94
|
+
def successful_purchase_response
|
|
95
|
+
<<-RESPONSE
|
|
96
|
+
approved
|
|
97
|
+
00015X000000
|
|
98
|
+
Transaction No: 00000000
|
|
99
|
+
------------------------
|
|
100
|
+
MERCHANTNAME
|
|
101
|
+
LOCATION AU
|
|
102
|
+
|
|
103
|
+
MERCH ID 10000000
|
|
104
|
+
TERM ID Y0TR00
|
|
105
|
+
COUNTRY CODE AU
|
|
106
|
+
16/07/07 18:59
|
|
107
|
+
RRN 00015X000000
|
|
108
|
+
VISA
|
|
109
|
+
411111-111
|
|
110
|
+
CREDIT A/C 12/10
|
|
111
|
+
|
|
112
|
+
AUTHORISATION NO: 000000
|
|
113
|
+
APPROVED 08
|
|
114
|
+
|
|
115
|
+
PURCHASE $1.00
|
|
116
|
+
TOTAL AUD $1.00
|
|
117
|
+
|
|
118
|
+
PLEASE RETAIN AS RECORD
|
|
119
|
+
OF PURCHASE
|
|
120
|
+
|
|
121
|
+
(SUBJECT TO CARDHOLDER'S
|
|
122
|
+
ACCEPTANCE)
|
|
123
|
+
------------------------
|
|
124
|
+
.
|
|
125
|
+
settlement_date=16/07/07
|
|
126
|
+
card_desc=VISA
|
|
127
|
+
status=approved
|
|
128
|
+
txn_ref=0707161858000000
|
|
129
|
+
refund_mode=0
|
|
130
|
+
transaction_no=000000
|
|
131
|
+
rrn=00015X000000
|
|
132
|
+
response_text=SIGNATURE REQUIRED
|
|
133
|
+
pld=0
|
|
134
|
+
total_amount=100
|
|
135
|
+
card_no=4111111111111111
|
|
136
|
+
version=V1.0
|
|
137
|
+
merchant_index=123
|
|
138
|
+
card_expiry=12/10
|
|
139
|
+
training_mode=0
|
|
140
|
+
operator_no=10000
|
|
141
|
+
response_code=08
|
|
142
|
+
card_type=6
|
|
143
|
+
approved=1
|
|
144
|
+
cashout_amount=0
|
|
145
|
+
receipt_array=ARRAY(0x83725cc)
|
|
146
|
+
account_type=CREDIT A/C
|
|
147
|
+
result=1
|
|
148
|
+
RESPONSE
|
|
162
149
|
end
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
150
|
+
|
|
151
|
+
def successful_credit_response
|
|
152
|
+
<<-RESPONSE
|
|
153
|
+
approved
|
|
154
|
+
00015X000000
|
|
155
|
+
Transaction No: 00000000
|
|
156
|
+
------------------------
|
|
157
|
+
MERCHANTNAME
|
|
158
|
+
LOCATION AU
|
|
159
|
+
|
|
160
|
+
MERCH ID 10000000
|
|
161
|
+
TERM ID Y0TR00
|
|
162
|
+
COUNTRY CODE AU
|
|
163
|
+
16/07/07 19:03
|
|
164
|
+
RRN 00015X000000
|
|
165
|
+
VISA
|
|
166
|
+
411111-111
|
|
167
|
+
CREDIT A/C 12/10
|
|
168
|
+
|
|
169
|
+
AUTHORISATION NO:
|
|
170
|
+
APPROVED 08
|
|
171
|
+
|
|
172
|
+
** REFUND ** $1.00
|
|
173
|
+
TOTAL AUD $1.00
|
|
174
|
+
|
|
175
|
+
PLEASE RETAIN AS RECORD
|
|
176
|
+
OF REFUND
|
|
177
|
+
|
|
178
|
+
(SUBJECT TO CARDHOLDER'S
|
|
179
|
+
ACCEPTANCE)
|
|
180
|
+
------------------------
|
|
181
|
+
.
|
|
182
|
+
settlement_date=16/07/07
|
|
183
|
+
card_desc=VISA
|
|
184
|
+
status=approved
|
|
185
|
+
txn_ref=0707161902000000
|
|
186
|
+
refund_mode=1
|
|
187
|
+
transaction_no=000000
|
|
188
|
+
rrn=00015X000000
|
|
189
|
+
response_text=SIGNATURE REQUIRED
|
|
190
|
+
pld=0
|
|
191
|
+
total_amount=100
|
|
192
|
+
card_no=4111111111111111
|
|
193
|
+
version=V1.0
|
|
194
|
+
merchant_index=123
|
|
195
|
+
card_expiry=12/10
|
|
196
|
+
training_mode=0
|
|
197
|
+
operator_no=10000
|
|
198
|
+
response_code=08
|
|
199
|
+
card_type=6
|
|
200
|
+
approved=1
|
|
201
|
+
cashout_amount=0
|
|
202
|
+
receipt_array=ARRAY(0x837241c)
|
|
203
|
+
account_type=CREDIT A/C
|
|
204
|
+
result=1
|
|
205
|
+
RESPONSE
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
def successful_authorization_response
|
|
209
|
+
<<-RESPONSE
|
|
210
|
+
approved
|
|
211
|
+
00015X000000
|
|
212
|
+
Transaction No: 00000000
|
|
213
|
+
------------------------
|
|
214
|
+
MERCHANTNAME
|
|
215
|
+
LOCATION AU
|
|
216
|
+
|
|
217
|
+
MERCH ID 10000000
|
|
218
|
+
TERM ID Y0TR00
|
|
219
|
+
COUNTRY CODE AU
|
|
220
|
+
17/07/07 15:22
|
|
221
|
+
RRN 00015X000000
|
|
222
|
+
VISA
|
|
223
|
+
411111-111
|
|
224
|
+
CREDIT A/C 12/10
|
|
225
|
+
|
|
226
|
+
AUTHORISATION NO: 000000
|
|
227
|
+
APPROVED 08
|
|
228
|
+
|
|
229
|
+
PURCHASE $1.00
|
|
230
|
+
TOTAL AUD $1.00
|
|
231
|
+
|
|
232
|
+
PLEASE RETAIN AS RECORD
|
|
233
|
+
OF PURCHASE
|
|
234
|
+
|
|
235
|
+
(SUBJECT TO CARDHOLDER'S
|
|
236
|
+
ACCEPTANCE)
|
|
237
|
+
------------------------
|
|
238
|
+
.
|
|
239
|
+
settlement_date=17/07/07
|
|
240
|
+
card_desc=VISA
|
|
241
|
+
status=approved
|
|
242
|
+
txn_ref=0707171521000000
|
|
243
|
+
refund_mode=0
|
|
244
|
+
transaction_no=000000
|
|
245
|
+
rrn=00015X000000
|
|
246
|
+
response_text=SIGNATURE REQUIRED
|
|
247
|
+
pld=0
|
|
248
|
+
total_amount=100
|
|
249
|
+
card_no=4111111111111111
|
|
250
|
+
version=V1.0
|
|
251
|
+
merchant_index=123
|
|
252
|
+
card_expiry=12/10
|
|
253
|
+
training_mode=0
|
|
254
|
+
operator_no=10000
|
|
255
|
+
response_code=08
|
|
256
|
+
card_type=6
|
|
257
|
+
approved=1
|
|
258
|
+
cashout_amount=0
|
|
259
|
+
receipt_array=ARRAY(0x836a25c)
|
|
260
|
+
account_type=CREDIT A/C
|
|
261
|
+
result=1
|
|
262
|
+
RESPONSE
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
def successful_capture_response
|
|
266
|
+
<<-RESPONSE
|
|
267
|
+
approved
|
|
268
|
+
00015X000000
|
|
269
|
+
Transaction No: 00000000
|
|
270
|
+
------------------------
|
|
271
|
+
MERCHANTNAME
|
|
272
|
+
LOCATION AU
|
|
273
|
+
|
|
274
|
+
MERCH ID 10000000
|
|
275
|
+
TERM ID Y0TR00
|
|
276
|
+
COUNTRY CODE AU
|
|
277
|
+
17/07/07 15:23
|
|
278
|
+
RRN 00015X000000
|
|
279
|
+
VISA
|
|
280
|
+
411111-111
|
|
281
|
+
CREDIT A/C 12/10
|
|
282
|
+
|
|
283
|
+
AUTHORISATION NO: 000000
|
|
284
|
+
APPROVED 08
|
|
285
|
+
|
|
286
|
+
PURCHASE $1.00
|
|
287
|
+
TOTAL AUD $1.00
|
|
288
|
+
|
|
289
|
+
PLEASE RETAIN AS RECORD
|
|
290
|
+
OF PURCHASE
|
|
291
|
+
|
|
292
|
+
(SUBJECT TO CARDHOLDER'S
|
|
293
|
+
ACCEPTANCE)
|
|
294
|
+
------------------------
|
|
295
|
+
.
|
|
296
|
+
settlement_date=17/07/07
|
|
297
|
+
card_desc=VISA
|
|
298
|
+
status=approved
|
|
299
|
+
txn_ref=0707171522000000
|
|
300
|
+
refund_mode=0
|
|
301
|
+
transaction_no=000000
|
|
302
|
+
rrn=00015X000000
|
|
303
|
+
response_text=SIGNATURE REQUIRED
|
|
304
|
+
pld=0
|
|
305
|
+
total_amount=100
|
|
306
|
+
card_no=4111111111111111
|
|
307
|
+
version=V1.0
|
|
308
|
+
merchant_index=123
|
|
309
|
+
card_expiry=12/10
|
|
310
|
+
training_mode=0
|
|
311
|
+
operator_no=10000
|
|
312
|
+
response_code=08
|
|
313
|
+
card_type=6
|
|
314
|
+
approved=1
|
|
315
|
+
cashout_amount=0
|
|
316
|
+
receipt_array=ARRAY(0x8378200)
|
|
317
|
+
account_type=CREDIT A/C
|
|
318
|
+
result=1
|
|
319
|
+
RESPONSE
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
def purchase_with_invalid_credit_card_response
|
|
323
|
+
<<-RESPONSE
|
|
324
|
+
declined
|
|
325
|
+
00015X000000
|
|
326
|
+
Transaction No: 00000000
|
|
327
|
+
------------------------
|
|
328
|
+
MERCHANTNAME
|
|
329
|
+
LOCATION AU
|
|
330
|
+
|
|
331
|
+
MERCH ID 10000000
|
|
332
|
+
TERM ID Y0TR40
|
|
333
|
+
COUNTRY CODE AU
|
|
334
|
+
16/07/07 19:20
|
|
335
|
+
RRN 00015X000000
|
|
336
|
+
VISA
|
|
337
|
+
411111-111
|
|
338
|
+
CREDIT A/C 12/10
|
|
339
|
+
|
|
340
|
+
AUTHORISATION NO:
|
|
341
|
+
DECLINED 31
|
|
342
|
+
|
|
343
|
+
PURCHASE $1.00
|
|
344
|
+
TOTAL AUD $1.00
|
|
345
|
+
|
|
346
|
+
(SUBJECT TO CARDHOLDER'S
|
|
347
|
+
ACCEPTANCE)
|
|
348
|
+
------------------------
|
|
349
|
+
.
|
|
350
|
+
settlement_date=16/07/07
|
|
351
|
+
card_desc=VISA
|
|
352
|
+
status=declined
|
|
353
|
+
txn_ref=0707161919000000
|
|
354
|
+
refund_mode=0
|
|
355
|
+
transaction_no=000000
|
|
356
|
+
rrn=00015X000000
|
|
357
|
+
response_text=INVALID CARD
|
|
358
|
+
pld=0
|
|
359
|
+
total_amount=100
|
|
360
|
+
card_no=4111111111111111
|
|
361
|
+
version=V1.0
|
|
362
|
+
merchant_index=123
|
|
363
|
+
card_expiry=12/10
|
|
364
|
+
training_mode=0
|
|
365
|
+
operator_no=10000
|
|
366
|
+
response_code=31
|
|
367
|
+
card_type=6
|
|
368
|
+
approved=0
|
|
369
|
+
cashout_amount=0
|
|
370
|
+
receipt_array=ARRAY(0x83752d0)
|
|
371
|
+
account_type=CREDIT A/C
|
|
372
|
+
result=0
|
|
373
|
+
RESPONSE
|
|
180
374
|
end
|
|
375
|
+
|
|
376
|
+
def purchase_with_expired_credit_card_response
|
|
377
|
+
<<-RESPONSE
|
|
378
|
+
failed
|
|
379
|
+
|
|
181
380
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
381
|
+
.
|
|
382
|
+
response_text=CARD EXPIRED
|
|
383
|
+
approved=0
|
|
384
|
+
status=failed
|
|
385
|
+
txn_ref=0707161910000000
|
|
386
|
+
version=V1.0
|
|
387
|
+
pld=0
|
|
388
|
+
response_code=Q816
|
|
389
|
+
result=-1
|
|
390
|
+
RESPONSE
|
|
189
391
|
end
|
|
392
|
+
|
|
393
|
+
def purchase_with_invalid_month_response
|
|
394
|
+
<<-RESPONSE
|
|
395
|
+
failed
|
|
396
|
+
Invalid month
|
|
397
|
+
RESPONSE
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
def bad_login_response
|
|
401
|
+
<<-RESPONSE
|
|
402
|
+
failed
|
|
190
403
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
MERCHANTNAME
|
|
198
|
-
LOCATION AU
|
|
199
|
-
|
|
200
|
-
MERCH ID 10000000
|
|
201
|
-
TERM ID Y0TR00
|
|
202
|
-
COUNTRY CODE AU
|
|
203
|
-
16/07/07 18:59
|
|
204
|
-
RRN 00015X000000
|
|
205
|
-
VISA
|
|
206
|
-
411111-111
|
|
207
|
-
CREDIT A/C 12/10
|
|
208
|
-
|
|
209
|
-
AUTHORISATION NO: 000000
|
|
210
|
-
APPROVED 08
|
|
211
|
-
|
|
212
|
-
PURCHASE $1.00
|
|
213
|
-
TOTAL AUD $1.00
|
|
214
|
-
|
|
215
|
-
PLEASE RETAIN AS RECORD
|
|
216
|
-
OF PURCHASE
|
|
217
|
-
|
|
218
|
-
(SUBJECT TO CARDHOLDER'S
|
|
219
|
-
ACCEPTANCE)
|
|
220
|
-
------------------------
|
|
221
|
-
.
|
|
222
|
-
settlement_date=16/07/07
|
|
223
|
-
card_desc=VISA
|
|
224
|
-
status=approved
|
|
225
|
-
txn_ref=0707161858000000
|
|
226
|
-
refund_mode=0
|
|
227
|
-
transaction_no=000000
|
|
228
|
-
rrn=00015X000000
|
|
229
|
-
response_text=SIGNATURE REQUIRED
|
|
230
|
-
pld=0
|
|
231
|
-
total_amount=100
|
|
232
|
-
card_no=4111111111111111
|
|
233
|
-
version=V1.0
|
|
234
|
-
merchant_index=123
|
|
235
|
-
card_expiry=12/10
|
|
236
|
-
training_mode=0
|
|
237
|
-
operator_no=10000
|
|
238
|
-
response_code=08
|
|
239
|
-
card_type=6
|
|
240
|
-
approved=1
|
|
241
|
-
cashout_amount=0
|
|
242
|
-
receipt_array=ARRAY(0x83725cc)
|
|
243
|
-
account_type=CREDIT A/C
|
|
244
|
-
result=1
|
|
245
|
-
== successful_authorization
|
|
246
|
-
approved
|
|
247
|
-
00015X000000
|
|
248
|
-
Transaction No: 00000000
|
|
249
|
-
------------------------
|
|
250
|
-
MERCHANTNAME
|
|
251
|
-
LOCATION AU
|
|
252
|
-
|
|
253
|
-
MERCH ID 10000000
|
|
254
|
-
TERM ID Y0TR00
|
|
255
|
-
COUNTRY CODE AU
|
|
256
|
-
17/07/07 15:22
|
|
257
|
-
RRN 00015X000000
|
|
258
|
-
VISA
|
|
259
|
-
411111-111
|
|
260
|
-
CREDIT A/C 12/10
|
|
261
|
-
|
|
262
|
-
AUTHORISATION NO: 000000
|
|
263
|
-
APPROVED 08
|
|
264
|
-
|
|
265
|
-
PURCHASE $1.00
|
|
266
|
-
TOTAL AUD $1.00
|
|
267
|
-
|
|
268
|
-
PLEASE RETAIN AS RECORD
|
|
269
|
-
OF PURCHASE
|
|
270
|
-
|
|
271
|
-
(SUBJECT TO CARDHOLDER'S
|
|
272
|
-
ACCEPTANCE)
|
|
273
|
-
------------------------
|
|
274
|
-
.
|
|
275
|
-
settlement_date=17/07/07
|
|
276
|
-
card_desc=VISA
|
|
277
|
-
status=approved
|
|
278
|
-
txn_ref=0707171521000000
|
|
279
|
-
refund_mode=0
|
|
280
|
-
transaction_no=000000
|
|
281
|
-
rrn=00015X000000
|
|
282
|
-
response_text=SIGNATURE REQUIRED
|
|
283
|
-
pld=0
|
|
284
|
-
total_amount=100
|
|
285
|
-
card_no=4111111111111111
|
|
286
|
-
version=V1.0
|
|
287
|
-
merchant_index=123
|
|
288
|
-
card_expiry=12/10
|
|
289
|
-
training_mode=0
|
|
290
|
-
operator_no=10000
|
|
291
|
-
response_code=08
|
|
292
|
-
card_type=6
|
|
293
|
-
approved=1
|
|
294
|
-
cashout_amount=0
|
|
295
|
-
receipt_array=ARRAY(0x836a25c)
|
|
296
|
-
account_type=CREDIT A/C
|
|
297
|
-
result=1
|
|
298
|
-
== successful_capture
|
|
299
|
-
approved
|
|
300
|
-
00015X000000
|
|
301
|
-
Transaction No: 00000000
|
|
302
|
-
------------------------
|
|
303
|
-
MERCHANTNAME
|
|
304
|
-
LOCATION AU
|
|
305
|
-
|
|
306
|
-
MERCH ID 10000000
|
|
307
|
-
TERM ID Y0TR00
|
|
308
|
-
COUNTRY CODE AU
|
|
309
|
-
17/07/07 15:23
|
|
310
|
-
RRN 00015X000000
|
|
311
|
-
VISA
|
|
312
|
-
411111-111
|
|
313
|
-
CREDIT A/C 12/10
|
|
314
|
-
|
|
315
|
-
AUTHORISATION NO: 000000
|
|
316
|
-
APPROVED 08
|
|
317
|
-
|
|
318
|
-
PURCHASE $1.00
|
|
319
|
-
TOTAL AUD $1.00
|
|
320
|
-
|
|
321
|
-
PLEASE RETAIN AS RECORD
|
|
322
|
-
OF PURCHASE
|
|
323
|
-
|
|
324
|
-
(SUBJECT TO CARDHOLDER'S
|
|
325
|
-
ACCEPTANCE)
|
|
326
|
-
------------------------
|
|
327
|
-
.
|
|
328
|
-
settlement_date=17/07/07
|
|
329
|
-
card_desc=VISA
|
|
330
|
-
status=approved
|
|
331
|
-
txn_ref=0707171522000000
|
|
332
|
-
refund_mode=0
|
|
333
|
-
transaction_no=000000
|
|
334
|
-
rrn=00015X000000
|
|
335
|
-
response_text=SIGNATURE REQUIRED
|
|
336
|
-
pld=0
|
|
337
|
-
total_amount=100
|
|
338
|
-
card_no=4111111111111111
|
|
339
|
-
version=V1.0
|
|
340
|
-
merchant_index=123
|
|
341
|
-
card_expiry=12/10
|
|
342
|
-
training_mode=0
|
|
343
|
-
operator_no=10000
|
|
344
|
-
response_code=08
|
|
345
|
-
card_type=6
|
|
346
|
-
approved=1
|
|
347
|
-
cashout_amount=0
|
|
348
|
-
receipt_array=ARRAY(0x8378200)
|
|
349
|
-
account_type=CREDIT A/C
|
|
350
|
-
result=1
|
|
351
|
-
== successful_credit
|
|
352
|
-
approved
|
|
353
|
-
00015X000000
|
|
354
|
-
Transaction No: 00000000
|
|
355
|
-
------------------------
|
|
356
|
-
MERCHANTNAME
|
|
357
|
-
LOCATION AU
|
|
358
|
-
|
|
359
|
-
MERCH ID 10000000
|
|
360
|
-
TERM ID Y0TR00
|
|
361
|
-
COUNTRY CODE AU
|
|
362
|
-
16/07/07 19:03
|
|
363
|
-
RRN 00015X000000
|
|
364
|
-
VISA
|
|
365
|
-
411111-111
|
|
366
|
-
CREDIT A/C 12/10
|
|
367
|
-
|
|
368
|
-
AUTHORISATION NO:
|
|
369
|
-
APPROVED 08
|
|
370
|
-
|
|
371
|
-
** REFUND ** $1.00
|
|
372
|
-
TOTAL AUD $1.00
|
|
373
|
-
|
|
374
|
-
PLEASE RETAIN AS RECORD
|
|
375
|
-
OF REFUND
|
|
376
|
-
|
|
377
|
-
(SUBJECT TO CARDHOLDER'S
|
|
378
|
-
ACCEPTANCE)
|
|
379
|
-
------------------------
|
|
380
|
-
.
|
|
381
|
-
settlement_date=16/07/07
|
|
382
|
-
card_desc=VISA
|
|
383
|
-
status=approved
|
|
384
|
-
txn_ref=0707161902000000
|
|
385
|
-
refund_mode=1
|
|
386
|
-
transaction_no=000000
|
|
387
|
-
rrn=00015X000000
|
|
388
|
-
response_text=SIGNATURE REQUIRED
|
|
389
|
-
pld=0
|
|
390
|
-
total_amount=100
|
|
391
|
-
card_no=4111111111111111
|
|
392
|
-
version=V1.0
|
|
393
|
-
merchant_index=123
|
|
394
|
-
card_expiry=12/10
|
|
395
|
-
training_mode=0
|
|
396
|
-
operator_no=10000
|
|
397
|
-
response_code=08
|
|
398
|
-
card_type=6
|
|
399
|
-
approved=1
|
|
400
|
-
cashout_amount=0
|
|
401
|
-
receipt_array=ARRAY(0x837241c)
|
|
402
|
-
account_type=CREDIT A/C
|
|
403
|
-
result=1
|
|
404
|
-
== purchase_with_invalid_credit_card
|
|
405
|
-
declined
|
|
406
|
-
00015X000000
|
|
407
|
-
Transaction No: 00000000
|
|
408
|
-
------------------------
|
|
409
|
-
MERCHANTNAME
|
|
410
|
-
LOCATION AU
|
|
411
|
-
|
|
412
|
-
MERCH ID 10000000
|
|
413
|
-
TERM ID Y0TR40
|
|
414
|
-
COUNTRY CODE AU
|
|
415
|
-
16/07/07 19:20
|
|
416
|
-
RRN 00015X000000
|
|
417
|
-
VISA
|
|
418
|
-
411111-111
|
|
419
|
-
CREDIT A/C 12/10
|
|
420
|
-
|
|
421
|
-
AUTHORISATION NO:
|
|
422
|
-
DECLINED 31
|
|
423
|
-
|
|
424
|
-
PURCHASE $1.00
|
|
425
|
-
TOTAL AUD $1.00
|
|
426
|
-
|
|
427
|
-
(SUBJECT TO CARDHOLDER'S
|
|
428
|
-
ACCEPTANCE)
|
|
429
|
-
------------------------
|
|
430
|
-
.
|
|
431
|
-
settlement_date=16/07/07
|
|
432
|
-
card_desc=VISA
|
|
433
|
-
status=declined
|
|
434
|
-
txn_ref=0707161919000000
|
|
435
|
-
refund_mode=0
|
|
436
|
-
transaction_no=000000
|
|
437
|
-
rrn=00015X000000
|
|
438
|
-
response_text=INVALID CARD
|
|
439
|
-
pld=0
|
|
440
|
-
total_amount=100
|
|
441
|
-
card_no=4111111111111111
|
|
442
|
-
version=V1.0
|
|
443
|
-
merchant_index=123
|
|
444
|
-
card_expiry=12/10
|
|
445
|
-
training_mode=0
|
|
446
|
-
operator_no=10000
|
|
447
|
-
response_code=31
|
|
448
|
-
card_type=6
|
|
449
|
-
approved=0
|
|
450
|
-
cashout_amount=0
|
|
451
|
-
receipt_array=ARRAY(0x83752d0)
|
|
452
|
-
account_type=CREDIT A/C
|
|
453
|
-
result=0
|
|
454
|
-
== purchase_with_expired_credit_card
|
|
455
|
-
failed
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
.
|
|
459
|
-
response_text=CARD EXPIRED
|
|
460
|
-
approved=0
|
|
461
|
-
status=failed
|
|
462
|
-
txn_ref=0707161910000000
|
|
463
|
-
version=V1.0
|
|
464
|
-
pld=0
|
|
465
|
-
response_code=Q816
|
|
466
|
-
result=-1
|
|
467
|
-
== purchase_with_invalid_month
|
|
468
|
-
failed
|
|
469
|
-
Invalid month
|
|
470
|
-
== bad_login
|
|
471
|
-
failed
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
.
|
|
475
|
-
status=failed
|
|
476
|
-
result=-1
|
|
477
|
-
EOS
|
|
404
|
+
|
|
405
|
+
.
|
|
406
|
+
status=failed
|
|
407
|
+
result=-1
|
|
408
|
+
RESPONSE
|
|
409
|
+
end
|
|
478
410
|
end
|