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

Commit 5354ebd

Browse files
authored
Merge pull request #54 from stripe/yuki-attach-test-cards-to-customer
Attach test cards to created customers for testing convenience
2 parents 8ae297d + a672e61 commit 5354ebd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

web.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,17 @@ def authenticate!
102102
:my_customer_id => '72F8C533-FCD5-47A6-A45B-3956CA8C792D',
103103
},
104104
)
105+
# Attach some test cards to the customer for testing convenience.
106+
# See https://stripe.com/docs/testing#cards
107+
['pm_card_threeDSecure2Required', 'pm_card_visa'].each { |pm_id|
108+
Stripe::PaymentMethod.attach(
109+
pm_id,
110+
{
111+
customer: @customer.id,
112+
}
113+
)
114+
}
115+
105116
rescue Stripe::InvalidRequestError
106117
end
107118
session[:customer_id] = @customer.id

0 commit comments

Comments
 (0)