Which webhooks to subscribe for payments on paypal recurring payments? - paypal

I'm creating a website using paypal recurring payments. Each month the payment happens automatically, but I need to know when this happens in order to update the user profile in my application, so I know until when the subscription is valid.
Using paypal webhooks, which events do I need to subscribe to in order to know when the payment actually happens (or fails) each month?

Related

Is the INVOICING.INVOICE.SCHEDULED automatically created?

I've implemented PayPal gateway in my application, and I'm looking for a way to send a notification to my customer when an upcoming renewal is coming.
Unfortunately in the documentation I didn't find a depth explaination about INVOICING.INVOICE.SCHEDULED but I'm guessing should be the same as invoice.upcoming of Stripe which is triggered when a recurring payment is going to be renewed.
My question is: INVOICING.INVOICE.SCHEDULED is sended by PayPal automatically when a recurring payment is going to be renewed?
Invoicing and Subscriptions are two separate PayPal products. I would not expect an Invoicing webhook in relation to a Subscription recurring payment.
The subscription webhooks are listed here: https://developer.paypal.com/docs/integration/direct/webhooks/event-names/#subscriptions
If you are looking for one that happens "in advance" of a scheduled payment, I am not aware of one.

PayPal Webhooks not working on Recurring payments

I have implemented recurring payments using PayPal Rest API. I have subscribed to some events of webhooks. When the subscription is created, I got a notification from paypal. But when the recurring payment created I have not get any notification, even on the events console of developer account.
There is a solution to get the list of transactions from transaction API and on the basis of agreement id verify the transaction you want.

Recurring Payment IPN

Quick question about the notify_url HTML variable (from PayPal Payments Standard). I am specifying the URL as a variable that is sent to PayPal via a redirect URL for a recurring payment setup (all is working as expected when setting up the recurring payment).
But I am wondering, when PayPal goes to actually process a payment in the future (actual recurring payment), will it use the same URL for the IPN notification that was used during the recurring payment setup?
I have multiple IPN scripts, one for regular payments and one for recurring payments - I want to be sure that each future recurring payment uses a specific IPN script.
Cheers!
First, for the sake of terminology, if you're using HTML buttons then you're using Standard Subscriptions, not Recurring Payments. Technically, they're the same thing, but Recurring Payments is API based and IPN data is different for Standard Subscriptions vs. Recurring Payments. Just keep that in mind when searching for information about the two.
As for the IPN's, unfortunately, it will not continue to use that same URL. You'll need to make sure that IPN is configured in the PayPal account profile in order for future transactions related to the profile to trigger IPN's.
This goes for both Standard Subscriptions and Recurring Payments API transactions.

Is it possible to unsubscribe an user via the Paypal Adaptive payment API?

My users subscribe to my project using the paypal button "Subscribe", and then I manage the monthly payments via the IPN, but if the user delete his account, I'd like to unsubscribe him automatically, without asking him to go to Paypal to cancel his subscription.
Is it possible to use the Paypal Adaptive Payment API to tell Paypal to unsubscribe this user ?
Bonus question : is it possible to use the Paypal Adaptive Payment API to know the status of the subscription, and eventually also to modify it (lower the amount for example) ?
You wouldn't use the Adaptive Payments API to unsubscribe a user from a subscription. If the buyer signed up for a subscription, you could ManageRecurringPaymentsProfileStatus API to cancel the profile. As for the status, you would not be able to use the "GetRecurringPaymentsProfileDetails" API call to get the status for subscriptions. This would only be supported for recurring payments, not subscriptions. However, you could use IPN which would send you the details when the profile gets created, when a new transaction is processed, and etc. Then you could just query your own database for the details.

Do Paypal recurring payments have unique txn_ids?

I'm using the Paypal "Subscription" button. I have an IPN handler and overall I think I've got it all figured out. My last problem is that apparently there's no good way to test a recurring payment (except to wait for the cycle to occur). This issue is discussed here: [question]: Testing Paypal subscription IPN
I don't really need to test this recurring payment but I do need to know if every recurring payment will have it's own txn_id or if every payment in a subscription shares the same ID.
Thanks!
Yes, each recurring payment cycle will create a new transaction with its own transaction ID.
You'd link these transactions together via their recurring payments profile ID.