#theryanmark
1 messages · Page 1 of 1 (latest)
Nope
cool. and when the checkout.session events hit the webhook i assume it passes an id. is it the Checkout Session object id or payment_intent? i am trying to determine what to store in my DB to know which payment is being communicated about.
It'll contain the checkout session object: https://stripe.com/docs/api/checkout/sessions/object
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Which contains a lot of info (including both payment intent id and checkout session id)
ok cool. I just notices in test mode that the payment_intent was null. but if the whole object gets passed that allows me flexibility. I guess i could set a client_reference_id as well.
payment intent will be null if it's a subscription payment
otherwise should be populated
Oh. that makes sense I just changed that. does stripe handle any email notification when future subscription payments execute? or would i need to handle that on my end with webhooks?
Do you want the customer to get an email, or you as the account holder want to get the email?
the customer
Yeah it's the first option here: https://dashboard.stripe.com/settings/emails
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
awesome. thank you.
one last thing (I think) can my customer cancel their subscription through Stripe or do I need to develop an in app implementation of this?
They can if you give them access to the customer portal: https://stripe.com/docs/customer-management
it's the stripe-hosted portal to manage their invoices/subscriptions
ok great. thank you. I really appreciate that there is a dev discord. You guys have made it really simple to get support!
Of course!
how would you suggest handling different types of payments?
For example I have an account subscription to be a paid user and also a merch store. what is best practice for sorting through different session events?
You're going to be using checkout.session.completed and want to differentiate between subscription events and one-time events?
i guess i could pass a reference into client_reference_id also?
If you're using checkout.session.completed events, just look at mode: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-mode
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
will be payment for 1-time payments
will be subscription for subscription payments
got it. ok thanks a bunch for the clarifications. you just got a brain dump from my thoughts over the last few days. I really appreciate your patience.
No problem
One thing to note if you're using checkout.session.completed events is depending on the payment method type, that won't necessarily mean payment has succeeded
Recommend reading: https://stripe.com/docs/payments/checkout/fulfill-orders
If you accept any of: Bacs Direct Debit, Bank transfers, Boleto, Canadian pre-authorized debits, Konbini, OXXO, SEPA Direct Debit, SOFORT, or ACH Direct Debit. then you'll need to listen to additional events
yup. already on that. i want to listen for the checkout.session.async_payment_failed and checkout.session.async_payment_succeeded. So if I am only accepting CC then payment is immediate and checkout.session.completed is sufficient?
Yeah
Awesome on my way to being a Stripe Dev Superuser!
Indeed!