Hi, I am following Subscription Plan Checkout and trying to create a payment link that subscribes the customer to a recurring subscription.
I have created my payment link and saved the order_id provided in my database. I then subscribe to the payment_updated webhook to detect a successful payment and match it back to the user via the order_id provided in this webhook. This works, however I believe it will only work for the first payment, and not any recurring payments, since the order_id will presumably change.
So how would I trace back a payment to the original payment link for subsequent recurring payments? I cannot see any information in the payment webhooks that would allow this, and I cannot find any other webhooks being fired that will achieve this. I have subscribed to all webhooks and can only see order and payment webhooks being triggered, none of which have information that would allow me to identify the original payment link.
Side note: The tutorial doesn’t work using the latest Square API versions (create payment link request fails due to subscription plan object having changed I believe), I had to rollback to 2023-05-17 in order to get it to work. Just thought I should mention this as could be worth updating it.
Cheers