#_best-practices

1 messages · Page 1 of 1 (latest)

dense cypressBOT
#

👋 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/1404642803803361411

📝 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.

late mango
#

Hi

#

I want to use some payment options that have delayed delivery or whatever its called

#

so I'm using webhooks but I don't know exactly what the flow should be

#

I'm thinking to take checkout session completed -> store payment intent to db -> wait for the corresponding payment intent success, and grant the product

#

I wanted to just use the payment intent success event but theres no data on it like customer email, or payment link metadata

elder star
#

checkout.session.completed is correct

#

if you are using Checkout

late mango
#

I've created a payment link

elder star
late mango
#

just what I needed

#

it doesnt mention anything about the delayed payment options, like the European bank transfer, etc..

#

but I'll assume its implied that the payment has been 100% completed & funds transferred

#

is that correct

elder star
#

Some payment methods aren’t instant, such as ACH direct debit and other bank transfers. This means, funds won’t be immediately available when Checkout completes. Delayed payment methods generate a checkout.session.async_payment_succeeded event when payment succeeds later. The status of the object is in processing until the payment status either succeeds or fails.

late mango
#

ohsht

#

my bad

#

thx

elder star
#

np

late mango
#

just to clear it up before I implement this,

  1. User finishes checkout
  2. Webhook is received with the status of paid (Store details in DB)
  3. Grant the product

or

  1. User finishes checkout
  2. Webhook is received with status of pending (Store details in DB)
  3. Either grant the product or wait for the async event and then grant the product
elder star
#

Yes correct (please test in Sandbox)

late mango
#

what happens if theres an error during the webhook

#

and I return http 500

#

delayed re-try?

elder star
#

We will retry, resend. Be careful cause sometimes that will affect how Stripe treat the object

#

With Checkout Session we pretty much not care, but ie for invoice.created, we do look at webhook event response and decide to move forward or pending Subscription behavior

#

So my advice is try to response 200 as soon as you received the webhook event, then do your logic async

late mango
#

sure thing

#

and do I need to worry about any other events

#

like refund etc...