diff --git a/web.rb b/web.rb index fce305f..a638733 100644 --- a/web.rb +++ b/web.rb @@ -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, }