#roshe10_best-practices

1 messages · Page 1 of 1 (latest)

boreal oysterBOT
#

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

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

west vigil
#

You'll need to fetch and expand the relevant resource from the API. So for payment sessions, retrieve the payment_intent and 'expand' payment_method field

For subscription mode sessions you likely want to retrieve the susbcription and expand default_payment_method

This is the concept I'm referring to when I say expand: https://docs.stripe.com/expand

Learn how to reduce the number of requests you make to the Stripe API by expanding objects in responses.

#

Those fields will then include the full Payment Method object, with relevant fields

vapid kraken
#

thanks, but the thing is that for subscription mode sessions, payment_intent is null ? I sent the event id as an example

west vigil
#

Sorry, meant to say subscription field

#

payment_intent field will only be set for payment sessions

vapid kraken
#

I see thanks

#

is there a way I can expand objects directly from stripe event, or I have that option only if explicitly using _.Get methods

#

e.g. I will now have checkout session object from "unmarhaling" event data, but that session object will contain only ids of relevant objects. I'm thinking is there a way we can have those fully populated child object directly from that event unmarshaling

west vigil
#

You cannot:

You can’t receive webhook events with properties auto-expanded. Objects sent in events are always in their minimal form. To access nested values in expandable properties, you must retrieve the object in a separate call within your webhook handler.
https://docs.stripe.com/expand#with-webhooks

Learn how to reduce the number of requests you make to the Stripe API by expanding objects in responses.

vapid kraken
#

Okay, I see

#

thank you very much

#

that's all I needed