Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorize.net google pay support #4659

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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