Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
Update automatically attached credit cards for 3DS2 testing (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
jemerick-stripe authored and mshafrir-stripe committed Aug 22, 2019
1 parent 0f3c3de commit b147f02
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,23 @@ def authenticate!
else
begin
@customer = create_customer()

# Attach some test cards to the customer for testing convenience.
# See https://stripe.com/docs/testing#cards
['pm_card_threeDSecure2Required', 'pm_card_visa'].each { |pm_id|
# See https://stripe.com/docs/payments/3d-secure#three-ds-cards
# and https://stripe.com/docs/mobile/android/authentication#testing
['4000000000003220', '4000000000003238', '4000000000003246', '4000000000003253', '4242424242424242'].each { |cc_number|
payment_method = Stripe::PaymentMethod.create({
type: 'card',
card: {
number: cc_number,
exp_month: 8,
exp_year: 2022,
cvc: '123',
},
})

Stripe::PaymentMethod.attach(
pm_id,
payment_method.id,
{
customer: @customer.id,
}
Expand Down

0 comments on commit b147f02

Please sign in to comment.