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 2 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: 17 additions & 1 deletion web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,25 @@ def authenticate!
else
begin
@customer = create_customer()

payment_methods = []

['4000000000003220', '4000000000003238', '4000000000003246', '4000000000003253', '4242424242424242'].each { |cc_number|
mshafrir-stripe marked this conversation as resolved.
Show resolved Hide resolved
pm = Stripe::PaymentMethod.create({
type: 'card',
card: {
number: cc_number,
exp_month: 8,
exp_year: 2022,
cvc: '123',
},
})
payment_methods.push pm.id
}

# 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|
payment_methods.each { |pm_id|
Stripe::PaymentMethod.attach(
pm_id,
{
Expand Down