How can I link a payment intent back to the subscription?
If you include metadata in your subscription request to query while retrieving payment intentions, the id will be listed in the subscription_id
object.
Another approach would be to watch webhooks for the event payment_intent.succeeded
, which includes the payment_intent_id
and subscription_id
.