PayPal Webhooks. How can I link a webhook to a previous subscription - paypal

Maybe this is a dumb question, but here goes none the less.
I created a webhook and added its clientID to my PayPal-button-container code.
When I have gotten a new subscription purchase with this button, I see that it accesses my webhook when a new BILLING.SUBSCRIPTION.ACTIVATED fires. This is a live account and a live button. My hope is that the webhook will fire for PAYMENT.SALE.COMPLETED but this hasn't happened yet.
Here is my real question: what do I have to do to connect this webhook to the subscriptions that did NOT have this clientID in the button when they purchased/set up the subscription. I want this webhook to fire when those accounts process the PAYMENT.SALE.COMPLETED call.
I can put the webhook clientID in the original PayPal-button-container retroactively... but will that work for existing subscriptions?
Or does a webhook work for all payments, and I just haven't seen anything else post yet?
Thanks

Webhooks only work for payments and subscriptions that were created with that same webhook's client ID.
If payments were created with a different client ID, register a webhook event listener for that other client ID.

Related

Paypal Invoice Paid Webhook

PS: I am unsure the right place to ask this question
I have recently been working with PayPal invoices in an application. This application generates an invoice which the user then pays. It is then meant to listen to PayPals "Invoicing invoice paid" webhook. I have a application created, assigned it the necessary webhook and set the required URL. This is all done in PayPal Sandbox. No event is ever sent to the URL given, no request, no poll, nothing. Nothing is done at all and in the Webhook Event Logs there are no events visible. Am I doing something wrong?
Thanks

Which webhook event will call if subscription payment failed for paypal

I'm integrating PayPal payment gateway into my application. I'm using the PayPal REST API's. I'm able to authorize the request and webhook. Also, API and webhooks are working fine for me. The only thing about I'm little confused that which event and sequences of events will be if subscription payment failed?
For subscriptions, the only event you need to act on is PAYMENT.SALE.COMPLETED. When you receive this event, update the profile's valid date through the next cycle (e.g. 1 month in the future). If you don't receive a new PAYMENT.SALE.COMPLETED in time, the subscription has lapsed.
When creating the subscription you can set a custom_id which is useful for reconcilliation.

Does PayPal REST Webhook supports instant payments notification

I am building the system to listen to the Payment changes in PayPal for that I research and recommended using Webhooks over the IPN.
As of now, I can able to create an app and add webhooks with event subscribers. Also, with the webhook simulator I am getting notified correctly but with the actual Payment made in the sandbox does not trigger anything to the listener.
I have verified the correct business account linked with credentials as well.
Everything is working perfectly except the Webhooks triggering from PayPal.
Also, as noting is triggering I do not have debug id as well.
If you have not registered any webhook listeners for any of your REST Apps (either sandbox or live), PayPal will not send any webhooks because it does not know which ones to send events for, or where to send them.
To register webhooks for an app, either:
Find the app for the correct sandbox account in My Apps and Credentials (or create one), and Add Webhook
Do so via using thewebhooks API, with the correct REST App client id and secret for authentication
Until you register a listener URL for event(s), no webhooks will be sent.

PayPal webhook did not receive any events

I created a PayPal plus Payment in my website. I can choose a payment methode and I can pay.
I have also created a PayPal webhook. The webhook works. I tested it in the webhook simulator.
The problem is: if I pay i receive nothing in my webhook.
What can I do?
Presumably you need to Subscribe to Events by providing your webhook URLs PayPal; note that this is completely separate from testing in the simulator. See: https://developer.paypal.com/docs/integration/direct/webhooks/rest-webhooks/#subscribe-to-events

Paypal doesn't fire webhook on BILLING.SUBSCRIPTION.CANCELLED in sandbox

I haven't tested in live, but currently I have a webhook subscribed to the following events
Billing subscription cancelled
Billing subscription created
Billing subscription re-activated
Billing subscription suspended
Billing subscription updated
I'm receiving Webhook events for CREATED but nothing is being sent when a user cancels the subscription from their PayPal dashboard.
Is this expected behavior? is there another event I should be subscribe to to capture that user action?
Is there a debug id that you can share so we can trouble shoot?
Thanks,
Usha
From Paypal support (I still don't understand why the BILLING.SUBSCRIPTION.CANCELLED doesn't fire when a user cancels from their dashboard, similar issue here: BILLING.SUBSCRIPTION.CANCELLED does not fire upon user action?)
"But surely users subscribing via the button is the most common method of subscribing (how else would they subscribe?). The IPN route seems like a completely non-developer-friendly one (seeing as there isn't even simulator events for it)"
If you integrate a solution which is not based on our REST API's and want to receive HTTP notifications, you need to use instant payment notification (IPN). The IPN simulator may not provide a method of simulating the events, but you can create subscriptions in our sandbox environment and setup a sandbox business account with IPN and test cancelling the subscriptions, which will generate an IPN for the cancellation. We have a sandbox testing guide available here if you're not familiar with that environment and want to get started.
"So why would webhooks ONLY fire for API-based subscriptions (and why would a business website subscribe users using the API rather than the simple button)? What is the logic behind this?"
It depends on the integration and needs of the individual business. Some businesses only use our REST-based API solutions for their complete integration, from checkout payments to subscriptions and logically, this makes sense to them to only have to use one set of API's for their complete integration. Other business only want / need a more simple solution such as using buttons and as these are legacy solutions which are not REST-based, they use our legacy HTTP notification service which is instant payment notification (IPN).