From 0acfc9eb2adaa2a8f01cf95fb06880bc0b5e044f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santiago=20Castillo=20Garz=C3=B3n?= Date: Tue, 6 Dec 2022 09:35:02 -0500 Subject: [PATCH] [Authorize]Gooogle pay token support Added remote test cases to Authorize for google pay authorize GWI-404 ................................................................................... Finished in 96.632847 seconds. ---------------------------------------------------------------------------------------------------------------------------------------------------- 83 tests, 297 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed ---------------------------------------------------------------------------------------------------------------------------------------------------- 0.86 tests/s, 3.07 assertions/s --- .../billing/gateways/authorize_net.rb | 1 - .../gateways/remote_authorize_net_test.rb | 31 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) 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