#Adaman

1 messages · Page 1 of 1 (latest)

balmy birchBOT
pseudo tundra
#

hello! how are you planning to be notified for successful payments or fulfil orders?

inland vine
#

Hi @pseudo tundra I'm currently using the stripe checkout just for clarity, there's 2 methods I can use as I see it because my project is solely dealing with digital goods: 1) when the user is directed to the success url upon a successful checkout I can perform the actions needed to fulfil their order then redirect them where they need to be
2) use a webhook as shown in the docs to perform the actions when it recieves a payment successful call

#

I'm not sure which works best tbh

pseudo tundra
#

can you elaborate more on the actions necessarily to fulfil the order? what steps would you need to perform at a high level?

inland vine
#

I'm still finalizing it but the most important action would be logging a record of the transaction in my database.

#

Once that's in place my system should be able to process it from there

#

So high level abstracted: User clicks checkout
we create their purchased listing in a dormant state,
user is redirected to stripe to complete payment,
once payment is complete payment is logged in our database, listing is brought live and user is redirected to their listing

#

Sorry if that's a bit gibberish

pseudo tundra
#

no worries, that's fine. I would strongly recommend that you use webhooks. Generally, we recommend webhooks because the customer can close the browser anytime

#

you can actually do both - perform the update when the user is redirected to the success_url. At the same time also listen for the webhook event. Both actions would check if the set of necessary actions has already been performed, if it's already been done, then there's no need to do it again

inland vine
#

That actually makes a lot of sense, a secondary check so to speak?

pseudo tundra
#

yep

inland vine
#

Amazing, while I've got you quickly. I'm looking to add some metadata to my checkout_session so that I can have an easy search on the dashboard in the future. Can I just add it to the checkout_session object directly or do I need to add it to the payment_intent?

pseudo tundra
#
inland vine
#

I'd just need to access the eventual payment if that makes sense (e.g. if there was a dispute and I wanted to check payment went through our end)

pseudo tundra
#

so you want to check your own payment id?

inland vine
#

effectively yes

pseudo tundra
#

tbh, i kinda think it may not be entirely necessary, you could use the Checkout Session and PaymentIntent id instead

#

I don't fully grasp how your implementation works right now, but I would just set it on both the Checkout Session and PaymentIntent 😅

inland vine
#

🤣 don't worry mate gotta love technobabble. Probably best to set it on both as you suggest and pray one of them works

#

normally works for most things

#

thanks for your help