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,87 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
|
2
|
-
|
|
3
|
-
class PsigateRemoteTest < Test::Unit::TestCase
|
|
4
|
-
# set up order numbers as contants because even a test credit must match an
|
|
5
|
-
# existing purchase in psigate's test system
|
|
6
|
-
ORDER_NUM1 = Time.now.to_i.to_s
|
|
7
|
-
ORDER_NUM2 = (Time.now.to_i + 1).to_s
|
|
8
|
-
ORDER_NUM3 = (Time.now.to_i + 2).to_s
|
|
9
|
-
|
|
10
|
-
def setup
|
|
11
|
-
Base.gateway_mode = :test
|
|
12
|
-
@gateway = PsigateGateway.new(fixtures(:psigate))
|
|
13
|
-
|
|
14
|
-
@creditcard = credit_card('4242424242424242')
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def test_remote_authorize
|
|
18
|
-
assert response = @gateway.authorize(2400, @creditcard,
|
|
19
|
-
:order_id => ORDER_NUM1,
|
|
20
|
-
:billing_address => {
|
|
21
|
-
:address1 => '123 fairweather Lane',
|
|
22
|
-
:address2 => 'Apt B',
|
|
23
|
-
:city => 'New York',
|
|
24
|
-
:state => 'NY',
|
|
25
|
-
:country => 'U.S.A.',
|
|
26
|
-
:zip => '10010'},
|
|
27
|
-
:email => 'jack@yahoo.com'
|
|
28
|
-
)
|
|
29
|
-
assert_equal Response, response.class
|
|
30
|
-
assert_equal true, response.success?
|
|
31
|
-
assert_equal "APPROVED", response.params["approved"]
|
|
32
|
-
assert_equal ORDER_NUM1, response.authorization
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def test_remote_capture
|
|
36
|
-
assert response = @gateway.capture(2400, ORDER_NUM1 )
|
|
37
|
-
assert_equal Response, response.class
|
|
38
|
-
assert_equal true, response.success?
|
|
39
|
-
assert_equal "APPROVED", response.params["approved"]
|
|
40
|
-
assert_equal "APPROVED", response.params["approved"]
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
# named test_remote_apurchase (with an a) so that it executes prior to the
|
|
45
|
-
# test_remote_credit method. Otherwise the credit won't reference an existing
|
|
46
|
-
# purchase and the test will fail
|
|
47
|
-
def test_remote_apurchase
|
|
48
|
-
assert response = @gateway.purchase(2400, @creditcard, {:order_id => ORDER_NUM2,
|
|
49
|
-
:billing_address => {
|
|
50
|
-
:address1 => '123 fairweather Lane',
|
|
51
|
-
:address2 => 'Apt B',
|
|
52
|
-
:city => 'New York',
|
|
53
|
-
:state => 'NY',
|
|
54
|
-
:country => 'U.S.A.',
|
|
55
|
-
:zip => '10010'},
|
|
56
|
-
:email => 'jack@yahoo.com'
|
|
57
|
-
})
|
|
58
|
-
assert_equal Response, response.class
|
|
59
|
-
assert_equal true, response.success?
|
|
60
|
-
assert_equal "APPROVED", response.params["approved"]
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
def test_remote_credit
|
|
64
|
-
assert response = @gateway.credit(2400, ORDER_NUM2)
|
|
65
|
-
assert_equal Response, response.class
|
|
66
|
-
assert_equal true, response.success?
|
|
67
|
-
assert_equal "APPROVED", response.params["approved"]
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def test_remote_decline
|
|
71
|
-
assert response = @gateway.purchase(2400, @creditcard, {:order_id => ORDER_NUM3,
|
|
72
|
-
:billing_address => {
|
|
73
|
-
:address1 => '123 fairweather Lane',
|
|
74
|
-
:address2 => 'Apt B',
|
|
75
|
-
:city => 'New York',
|
|
76
|
-
:state => 'NY',
|
|
77
|
-
:country => 'U.S.A.',
|
|
78
|
-
:zip => '10010'},
|
|
79
|
-
:email => 'jack@yahoo.com',
|
|
80
|
-
:test_result => 'D'
|
|
81
|
-
})
|
|
82
|
-
assert_equal Response, response.class
|
|
83
|
-
assert_equal false, response.success?
|
|
84
|
-
assert_equal "DECLINED", response.params["approved"]
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
end
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
|
2
|
-
|
|
3
|
-
class RemoteSecurePayTest < Test::Unit::TestCase
|
|
4
|
-
include ActiveMerchant::Billing
|
|
5
|
-
|
|
6
|
-
AMOUNT = 100
|
|
7
|
-
|
|
8
|
-
def setup
|
|
9
|
-
@gateway = SecurePayGateway.new(fixtures(:secure_pay))
|
|
10
|
-
|
|
11
|
-
@creditcard = credit_card('4111111111111111',
|
|
12
|
-
:month => 7,
|
|
13
|
-
:year => 2007
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
@options = { :order_id => generate_order_id,
|
|
17
|
-
:description => 'Store purchase',
|
|
18
|
-
:billing_address => {
|
|
19
|
-
:address1 => '1234 My Street',
|
|
20
|
-
:address2 => 'Apartment 204',
|
|
21
|
-
:city => 'Beverly Hills',
|
|
22
|
-
:state => 'CA',
|
|
23
|
-
:country => 'US',
|
|
24
|
-
:zip => '90210'
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def test_successful_purchase
|
|
30
|
-
assert response = @gateway.purchase(AMOUNT, @creditcard, @options)
|
|
31
|
-
assert response.success?
|
|
32
|
-
assert response.test?
|
|
33
|
-
assert_equal 'This transaction has been approved', response.message
|
|
34
|
-
assert response.authorization
|
|
35
|
-
end
|
|
36
|
-
end
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
|
2
|
-
|
|
3
|
-
class TrustCommerceTest < Test::Unit::TestCase
|
|
4
|
-
def setup
|
|
5
|
-
@gateway = TrustCommerceGateway.new(fixtures(:trust_commerce))
|
|
6
|
-
|
|
7
|
-
@creditcard = credit_card('4111111111111111')
|
|
8
|
-
|
|
9
|
-
@valid_verification_value = '123'
|
|
10
|
-
@invalid_verification_value = '1234'
|
|
11
|
-
|
|
12
|
-
@valid_address = {:address1 => '123 Test St.', :address2 => nil, :city => 'Somewhere', :state => 'CA', :zip => '90001'}
|
|
13
|
-
@invalid_address = {:address1 => '187 Apple Tree Lane.', :address2 => nil, :city => 'Woodside', :state => 'CA', :zip => '94062'}
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def test_bad_login
|
|
17
|
-
@gateway.options[:login] = 'X'
|
|
18
|
-
assert response = @gateway.purchase(100, @creditcard)
|
|
19
|
-
|
|
20
|
-
assert_equal Response, response.class
|
|
21
|
-
assert_equal ["error",
|
|
22
|
-
"offenders",
|
|
23
|
-
"status"], response.params.keys.sort
|
|
24
|
-
|
|
25
|
-
assert_match /A field was improperly formatted, such as non-digit characters in a number field/, response.message
|
|
26
|
-
|
|
27
|
-
assert_equal false, response.success?
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def test_successful_purchase
|
|
31
|
-
assert response = @gateway.purchase(100, @creditcard)
|
|
32
|
-
|
|
33
|
-
assert_equal Response, response.class
|
|
34
|
-
assert_match /The transaction was successful/, response.message
|
|
35
|
-
|
|
36
|
-
assert_equal true, response.success?
|
|
37
|
-
assert !response.authorization.blank?
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def test_unsuccessful_purchase_with_invalid_cvv
|
|
41
|
-
@creditcard.verification_value = @invalid_verification_value
|
|
42
|
-
assert response = @gateway.purchase(100, @creditcard)
|
|
43
|
-
|
|
44
|
-
assert_equal Response, response.class
|
|
45
|
-
assert_match /CVV failed; the number provided is not the correct verification number for the card/, response.message
|
|
46
|
-
assert_equal false, response.success?
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def test_successful_purchase_with_avs
|
|
50
|
-
assert response = @gateway.purchase(100, @creditcard, :address => @valid_address)
|
|
51
|
-
assert_equal 'Y', response.params["avs"]
|
|
52
|
-
assert_match /The transaction was successful/, response.message
|
|
53
|
-
|
|
54
|
-
assert_equal true, response.success?
|
|
55
|
-
assert !response.authorization.blank?
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def test_purchase_with_avs_for_invalid_address
|
|
59
|
-
assert response = @gateway.purchase(100, @creditcard, :address => @invalid_address)
|
|
60
|
-
assert_equal "N", response.params["avs"]
|
|
61
|
-
assert_match /The transaction was successful/, response.message
|
|
62
|
-
assert_success response
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
def test_successful_authorize
|
|
66
|
-
@creditcard.verification_value = @valid_verification_value
|
|
67
|
-
assert response = @gateway.authorize(100, @creditcard)
|
|
68
|
-
assert_match /The transaction was successful/, response.message
|
|
69
|
-
assert_equal true, response.success?
|
|
70
|
-
assert !response.authorization.blank?
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
def test_unsuccessful_authorize_with_invalid_cvv
|
|
74
|
-
@creditcard.verification_value = @invalid_verification_value
|
|
75
|
-
assert response = @gateway.authorize(100, @creditcard)
|
|
76
|
-
assert_match /CVV failed; the number provided is not the correct verification number for the card/, response.message
|
|
77
|
-
assert_equal false, response.success?
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
def test_successful_authorize_with_avs
|
|
81
|
-
assert response = @gateway.authorize(100, @creditcard, {:address => @valid_address})
|
|
82
|
-
|
|
83
|
-
assert_equal "Y", response.params["avs"]
|
|
84
|
-
assert_match /The transaction was successful/, response.message
|
|
85
|
-
|
|
86
|
-
assert_equal true, response.success?
|
|
87
|
-
assert !response.authorization.blank?
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
def test_authorization_with_avs_for_invalid_address
|
|
91
|
-
assert response = @gateway.authorize(100, @creditcard, {:address => @invalid_address})
|
|
92
|
-
assert_equal "N", response.params["avs"]
|
|
93
|
-
assert_match /The transaction was successful/, response.message
|
|
94
|
-
assert_success response
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
def test_successful_capture
|
|
98
|
-
auth = @gateway.authorize(300, @creditcard)
|
|
99
|
-
assert_success auth
|
|
100
|
-
response = @gateway.capture(300, auth.authorization)
|
|
101
|
-
|
|
102
|
-
assert_success response
|
|
103
|
-
assert_equal 'The transaction was successful', response.message
|
|
104
|
-
assert_equal 'accepted', response.params['status']
|
|
105
|
-
assert response.params['transid']
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
def test_successful_credit
|
|
109
|
-
assert response = @gateway.credit(100, '011-0022698151')
|
|
110
|
-
|
|
111
|
-
assert_match /The transaction was successful/, response.message
|
|
112
|
-
assert_success response
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
def test_store_failure
|
|
116
|
-
assert response = @gateway.store(@creditcard)
|
|
117
|
-
|
|
118
|
-
assert_equal Response, response.class
|
|
119
|
-
assert_match /The merchant can't accept data passed in this field/, response.message
|
|
120
|
-
assert_failure response
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
def test_unstore_failure
|
|
124
|
-
assert response = @gateway.unstore('testme')
|
|
125
|
-
|
|
126
|
-
assert_match /The merchant can't accept data passed in this field/, response.message
|
|
127
|
-
assert_equal false, response.success?
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
def test_recurring_failure
|
|
131
|
-
assert response = @gateway.recurring(100, @creditcard, :periodicity => :weekly)
|
|
132
|
-
|
|
133
|
-
assert_match /The merchant can't accept data passed in this field/, response.message
|
|
134
|
-
assert_equal false, response.success?
|
|
135
|
-
end
|
|
136
|
-
end
|