#lobsterpizza18

1 messages · Page 1 of 1 (latest)

nova geyserBOT
silent spade
#

Yeah charge.succeeded is not really the relevant event here

dense sentinel
#

but why is it triggered during subscription flow

silent spade
#

The recommendation generally is to listen for checkout.session.completed events. However the payment_intent_data.metadata won't be available on that object/event, instead you'll want payment_intent.succeeded there

silent spade
#

But the fields/parameters you're setting aren't passed to the underlying Charge object

dense sentinel
silent spade
#

Yes whenever there is an actual payment, be that one-time or recurring, charge.succeeded will fire

dense sentinel
#

thanks for helping. just trying to understand which event I can listen for one time payments and subscription ones where i can access metadata

silent spade
#

mode: 'payment' -> payment_intent.succeeded
mode: 'subscription' -> customer.subscription.created

dense sentinel
#

I've used charge.succeded for one time payments to update my SaaS backend and allow user to access it. wonder if its the correct event and what to use for subscriptions. really need that metadata 😦

silent spade
dense sentinel
silent spade
#

No, .created is not indicative of a successful payment. For recurring payments you should use invoice.paid as per link I sent above

dense sentinel
#

thank you will check those now. appreciate your help

dense sentinel
silent spade
#

What's the evt_xxx ID?

dense sentinel
#

evt_

silent spade
dense sentinel
#

sorry I've copied the wrong payload from console. yes it does include the metadata.

#

@silent spade thank you so much. I think I got enough information for now to proceed with payments