diff --git a/lib/active_merchant/billing/gateways/authorize_net.rb b/lib/active_merchant/billing/gateways/authorize_net.rb index 3119a246a5d..6ce77e44789 100644 --- a/lib/active_merchant/billing/gateways/authorize_net.rb +++ b/lib/active_merchant/billing/gateways/authorize_net.rb @@ -90,7 +90,6 @@ class AuthorizeNetGateway < Gateway }.freeze APPLE_PAY_DATA_DESCRIPTOR = 'COMMON.APPLE.INAPP.PAYMENT' - PAYMENT_METHOD_NOT_SUPPORTED_ERROR = '155' INELIGIBLE_FOR_ISSUING_CREDIT_ERROR = '54' diff --git a/test/remote/gateways/remote_authorize_net_test.rb b/test/remote/gateways/remote_authorize_net_test.rb index 30ccbd793c1..2dd8f4ef594 100644 --- a/test/remote/gateways/remote_authorize_net_test.rb +++ b/test/remote/gateways/remote_authorize_net_test.rb @@ -9,6 +9,17 @@ def setup @check = check @declined_card = credit_card('400030001111222') + @payment_token = network_tokenization_credit_card( + '4242424242424242', + payment_cryptogram: 'dGVzdGNyeXB0b2dyYW1YWFhYWFhYWFhYWFg9PQ==', + brand: 'visa', + eci: '05', + month: '09', + year: '2030', + first_name: 'Longbob', + last_name: 'Longsen' + ) + @options = { order_id: '1', email: 'anet@example.com', @@ -56,6 +67,26 @@ def test_successful_purchase assert response.authorization end + def test_successful_purchase_with_google_pay + @payment_token.source = :google_pay + response = @gateway.purchase(@amount, @payment_token, @options) + + assert_success response + assert response.test? + assert_equal 'This transaction has been approved', response.message + assert response.authorization + end + + def test_successful_purchase_with_apple_pay + @payment_token.source = :apple_pay + response = @gateway.purchase(@amount, @payment_token, @options) + + assert_success response + assert response.test? + assert_equal 'This transaction has been approved', response.message + assert response.authorization + end + def test_successful_purchase_with_minimal_options response = @gateway.purchase(@amount, @credit_card, duplicate_window: 0, email: 'anet@example.com', billing_address: address) assert_success response