#SusanP-checkout-success

1 messages · Page 1 of 1 (latest)

timid echo
#

I'm not sure I fully understand. So the payment is successful, which triggers your webhook endpoint, and your webhook handler then should be the one handling order creation. Is that not the case here?

ocean venture
#

No, the success_url actually creates the order

#

otherwise the success_url ends up showing "order already created"

timid echo
#

I would advise against doing that, if you can help it. There's an edge-case where the customer navigates away from the payments page right after the payment succeeds, but before being redirected. I would rely on the checkout.session.success webhook Event for fulfillment

ocean venture
#

i don't believe there is a way to do tht with this cart, but I'll ask

#

i was hoping just to use the webhook for backup, in the case you described

timid echo
#

That's not really the best approach and there isn't a good workaround, for the reason I mentioned.

ocean venture
#

ok. i'll see what i can figure out. i'm guessing there's no way to delay the webhook in case I can't find a better solution

#

or can it be guaranteed that the webhook will always reach me before the success_url is called? so that it's at least consistent?

timid echo
#

There's no way to guarantee the timing of the webhook, so you shouldn't be relying on the redirect at all

ocean venture
#

thanks for your help. i've hit up their developer support to try and see what I can do

ocean venture
#

@timid echo one more thing, the webhook doesn't seem to include the client_reference_id. Is there a way to get it in there? If not, I'm not sure how I can even tell which basket to convert to an order. Thank you.

#

the webhook payload, I mean

timid echo
#

Which webhook payload are you looking at?

#

checkout.session.succeeded should have that

ocean venture
#

ok great. i was using payment_intent.succeeded (i might not have done that exactly)