#whimsy_api

1 messages ¡ Page 1 of 1 (latest)

spring treeBOT
#

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

young perch
#

Hello! Can you give me a specific Event ID I can take a look at? It's the ID starting with evt_.

earnest sable
#

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

young perch
#

It would be null if you were using a legacy integration that directly created Charges and didn't use Payment Intents.

earnest sable
#

so im safe to say it'll never be null

#

considering im just newly integrating it

young perch
#

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.

earnest sable
#

im not directly working with payment intents only subscriptions api so i guess so

#

what about 2nd query from main message

young perch
#

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.

earnest sable
#

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?

young perch
#

That one works if it makes sense for your use case and business needs, yeah.

earnest sable
#

neat

#

oh just uh how would i trace back subscription from charge

young perch
#

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

earnest sable
#

oh damn

young perch
earnest sable
young perch
#

No, you want to expand payment_intent.invoice.subscription, not two separate things.

earnest sable
#

oh right

#

what's the difference between charge.invoice and charge.payment_intent.invoice?

young perch
#

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.

earnest sable
#

i mean in this case i only want to cancel the sub, then customer.subscriptions.delete handles it accordingly

young perch
#

Yep, should be fine for that use case.

earnest sable
#

i wonder should i also invoice_now? little weird since its a consequence of a dispute

young perch
#

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.

earnest sable
#

yeah i noticed, it says on docs