#sleepyhead_docs
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1220396305952800839
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- sleepyhead_error, 1 hour ago, 65 messages
Hi ๐ I believe our test cards that simulate declines will fail to attach:
https://docs.stripe.com/testing#declined-payments
or when creating a customer
ok, i tried "Decline after attaching" but I guess that isn't what I was looking for
Nope, that one will successfully attach and then fail to process payments later.
Let me know if those decline cards don't do what you're hoping though, I can take another look.
looks like that is failing before stripe submits to my end
Can you elaborate a bit on what that means?
I'm just saving the card using confirmCardSetup. After the card is saved with Stripe client side I create a new customer and attach the card on the server
That flow won't work. The Setup Intent will attach the Payment Method to the Customer, you don't need to explicitly do that on your own.
Oh, unless the Setup Intent doesn't have a customer specified?
correct
it is just an empty SI
@stripe_intent = Stripe::SetupIntent.create({
usage: 'off_session',
payment_method_options: {
card: {
request_three_d_secure: 'any'
}
}
}, @stripe_api_key)
I then do:
Stripe::Customer.create( {
:payment_method => @stripe_intent.payment_method
I want to test the las part here, triggering an error when saving the customer (or attaching the card to an existing customer)
Gotcha, yeah, we don't have a good test card for that scenario because if the card fails it should fail during the Setup Intent confirmation rather than only during the attachment step.
ok.
I had a bug in the part that was handling this scenario, so at least in my case the customer did not fail (or was able to proceed) the SI client side
Could you flip the order of your flow? Create the Customer first, and then pass its ID to customer when creating the Setup Intent. So the attachment is triggered by the intent so you don't have to worry about handling those steps separately?