#whimsy_api
1 messages ¡ Page 1 of 1 (latest)
đ 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/1306744580586344450
đ 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.
- whimsy_api, 1 hour ago, 34 messages
- whimsy_portal-differences, 3 hours ago, 11 messages
- whimsy_customer-list, 6 days ago, 65 messages
- whimsy_subscription-event, 6 days ago, 68 messages
Hello! Can you give me a specific Event ID I can take a look at? It's the ID starting with evt_.
uh im just asking generally, since it is documented that payment_intent is nullable so i wonder when that is the case, currently what i tested i did get that field
It would be null if you were using a legacy integration that directly created Charges and didn't use Payment Intents.
I can't say that for sure because I'm not familiar with your integration or how it works, that's something you would need to determine on your end.
If all of your Charges are created by Payment Intents it shouldn't ever be null though.
im not directly working with payment intents only subscriptions api so i guess so
what about 2nd query from main message
Subscriptions create Invoices, Invoices create Payment Intents, and Payment Intents create Charges, so you should be good.
For your other question, you would need to add that logic on your end. I don't believe it's something we support directly, but let me check one thing to make sure...
Yeah, no, not seeing anything. You'd need to listen for dispute events to determine when a dispute happens and then cancel the associated Subscription.
sure do, if i would need that on my end, how would i do that, im using webhook events, so what webhook event would that ig be, charge.dispute.funds_withdrawn or other event?
That one works if it makes sense for your use case and business needs, yeah.
The Charge has a payment_intent property. The Payment Intent has an invoice property. The Invoice has a subscription property. You can use expansion to retrieve all of that info in a single API request instead of multiple: https://docs.stripe.com/api/expanding_objects
oh damn
You might find these videos helpful:
And possibly others on that page.
thanks, so this should do, assuming that expand returns directly objects, i can check if its a string because of typescript, but it shouldnt be right?
No, you want to expand payment_intent.invoice.subscription, not two separate things.
oh right
what's the difference between charge.invoice and charge.payment_intent.invoice?
Oh, I forgot Charges have an invoice property. You could expand charge.invoice.subscription instead if you don't want/need the Payment Intent info.
Most people want the Payment Intent info, which is why I default to that approach.
i mean in this case i only want to cancel the sub, then customer.subscriptions.delete handles it accordingly
Yep, should be fine for that use case.
i wonder should i also invoice_now? little weird since its a consequence of a dispute
Also, I realize I said to expand charge.invoice.subscription but it would just be invoice.subscription since you're already at the Charge level.
yeah i noticed, it says on docs