Skip to content

Commit

Permalink
Authorize.net: Google 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

Closes #4659

...................................................................................
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 authored and curiousepic committed Jan 17, 2023
1 parent a0bc3c6 commit 199d114
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
* Global Collect: fix bug on transaction inquire request [almalee24] #4676
* Credorax: Support google pay and apple pay [edgarv09] #4661
* Plexo: Add support for 5 new credit card brands (passcard, edenred, anda, tarjeta-d, sodexo) [edgarv09] #4652
* Authorize.net: Google pay token support [sainterman] #4659

== Version 1.127.0 (September 20th, 2022)
* BraintreeBlue: Add venmo profile_id [molbrown] #4512
Expand Down
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 199d114

Please sign in to comment.