Skip to content

Commit

Permalink
[Authorize]Gooogle pay token support
Browse files Browse the repository at this point in the history
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
  • Loading branch information
scastilloendava committed Jan 6, 2023
1 parent 26d0b6e commit 0acfc9e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/active_merchant/billing/gateways/authorize_net.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
31 changes: 31 additions & 0 deletions test/remote/gateways/remote_authorize_net_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0acfc9e

Please sign in to comment.