Skip to content

Commit

Permalink
Adds support for Google Pay sourced cards (#2725)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshnuss authored and pi3r committed Jan 31, 2018
1 parent 5737c27 commit 5ea7c4a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* Payeezy: Surface gateway_message on failure [curiousepic] #2717
* Payment Express: Scrub merchant password [curiousepic] #2723
* Stripe: Fix Partial Application Fee Refunds [curiousepic] #2713
* GooglePay: Support network tokenized cards [joshnuss] #2725

== Version 1.76.0 (January 3, 2018)
* PayU Latam: Change default text for description [nfarve] #2669
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class NetworkTokenizationCreditCard < CreditCard
attr_accessor :payment_cryptogram, :eci, :transaction_id
attr_writer :source

SOURCES = [:apple_pay, :android_pay]
SOURCES = %i(apple_pay android_pay google_pay)

def source
if defined?(@source) && SOURCES.include?(@source)
Expand Down
5 changes: 5 additions & 0 deletions test/unit/network_tokenization_credit_card_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ def setup
@tokenized_android_pay_card = ActiveMerchant::Billing::NetworkTokenizationCreditCard.new({
source: :android_pay
})
@tokenized_google_pay_card = ActiveMerchant::Billing::NetworkTokenizationCreditCard.new({
source: :google_pay
})
@tokenized_bogus_pay_card = ActiveMerchant::Billing::NetworkTokenizationCreditCard.new({
source: :bogus_pay
})
Expand All @@ -27,6 +30,7 @@ def test_credit_card?
assert @tokenized_card.credit_card?
assert @tokenized_apple_pay_card.credit_card?
assert @tokenized_android_pay_card.credit_card?
assert @tokenized_google_pay_card.credit_card?
assert @tokenized_bogus_pay_card.credit_card?
end

Expand All @@ -38,6 +42,7 @@ def test_source
assert_equal @tokenized_card.source, :apple_pay
assert_equal @tokenized_apple_pay_card.source, :apple_pay
assert_equal @tokenized_android_pay_card.source, :android_pay
assert_equal @tokenized_google_pay_card.source, :google_pay
assert_equal @tokenized_bogus_pay_card.source, :apple_pay
end
end

0 comments on commit 5ea7c4a

Please sign in to comment.