#itaied-checkout-pi-metadata

1 messages ยท Page 1 of 1 (latest)

tepid dawn
#

Hey!

#

However there's no parameter available that will set metadata on the underlying PI

#

What is it you're trying to do exactly?

hallow notch
#

I'm trying to listen for completion of both payment and subscription.
When I receive payment_intent.succeeded then I read the metadata field and execute my business process.
How can I send metadata then to a subscription completion event? Is there a better event for subscriptions other than payment_intent.succeeded?

tepid dawn
#

It depends what your 'business process' involves and what data you need and when

#

You could set metadata on the subscription and listen for customer.subscription.created events

hallow notch
#

I need the metadata when the payment has succeeded

tepid dawn
#

Otherwise there's no way to automatically set metadata on the initial invoice PI

hallow notch
#

By listening to invoice.paid I can reach the subscription and get the metadata.
Is there any difference between invoice.paid and payment_intent.succeeded or they both indicate a successful payment?
And can I get the subscription field expanded somehow on the webhook for invoice.paid?

tepid dawn
#

Is there any difference between invoice.paid and payment_intent.succeeded or they both indicate a successful payment?
invoice.paid will fire for out-of-band payments too (i.e. if you just marked it as paid in the Dashboard). invoice.payment_succeeded does not

#

And can I get the subscription field expanded somehow on the webhook for invoice.paid?
You can't expand event payload fields, so you'd need to make an additional API request

hallow notch
#

ok I understand it. Thank you very much for your support ๐Ÿ™‚

tepid dawn
#

np!