#sleepyhead_docs

1 messages ยท Page 1 of 1 (latest)

bright saddleBOT
#

๐Ÿ‘‹ 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.

lethal whaleBOT
#

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.

halcyon drum
sage cape
#

or when creating a customer

#

ok, i tried "Decline after attaching" but I guess that isn't what I was looking for

halcyon drum
#

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.

sage cape
#

looks like that is failing before stripe submits to my end

lethal whaleBOT
halcyon drum
#

Can you elaborate a bit on what that means?

sage cape
#

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

halcyon drum
#

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?

sage cape
#

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)

halcyon drum
#

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.

sage cape
#

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

halcyon drum
#

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?

sage cape
#

sure but too much work now ๐Ÿ™‚

#

anyways, I believe I fixed that bug so I will wait and see if there is any further issues instead of trying to test this myself

#

thanks