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

Commit b147f02

Browse files
jemerick-stripemshafrir-stripe
authored andcommitted
Update automatically attached credit cards for 3DS2 testing (#66)
1 parent 0f3c3de commit b147f02

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

web.rb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,23 @@ def authenticate!
110110
else
111111
begin
112112
@customer = create_customer()
113+
113114
# Attach some test cards to the customer for testing convenience.
114-
# See https://stripe.com/docs/testing#cards
115-
['pm_card_threeDSecure2Required', 'pm_card_visa'].each { |pm_id|
115+
# See https://stripe.com/docs/payments/3d-secure#three-ds-cards
116+
# and https://stripe.com/docs/mobile/android/authentication#testing
117+
['4000000000003220', '4000000000003238', '4000000000003246', '4000000000003253', '4242424242424242'].each { |cc_number|
118+
payment_method = Stripe::PaymentMethod.create({
119+
type: 'card',
120+
card: {
121+
number: cc_number,
122+
exp_month: 8,
123+
exp_year: 2022,
124+
cvc: '123',
125+
},
126+
})
127+
116128
Stripe::PaymentMethod.attach(
117-
pm_id,
129+
payment_method.id,
118130
{
119131
customer: @customer.id,
120132
}

0 commit comments

Comments
 (0)