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

Update automatically attached credit cards for 3DS2 testing #66

Merged
merged 3 commits into from
Aug 22, 2019
Merged
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
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|
mshafrir-stripe marked this conversation as resolved.
Show resolved Hide resolved
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