#Adaman
1 messages · Page 1 of 1 (latest)
hello! how are you planning to be notified for successful payments or fulfil orders?
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
can you elaborate more on the actions necessarily to fulfil the order? what steps would you need to perform at a high level?
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
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
That actually makes a lot of sense, a secondary check so to speak?
yep
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?
that's up to you, which event would you need the data from? Alternatively, you can also add it to both i.e.
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-metadata
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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)
so you want to check your own payment id?
effectively yes