How to track cancel membership from Paypal - paypal

I am using recurring membership payment from Paypal. I would like to know if any member cancel the membership from paypal manually, how can I get the return value/URL from the paypal, so that I can track the member cancel the membership from paypal.

You can use Instant Payment Notifications and PayPal will notify you almost instantly when a customer cancels their recurring payments profile within PayPal. That will allow you to track members cancelling their memberships.
Here is a link to the documentation on IPN:
https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNIntro/
Here is a link for how to create an IPN Listener:
https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNImplementation/

Related

PayPal Subscription: Refund full or partial

I am using Paypal rest API on my site. Till now I have implemented flow for regular order -
Create checkout session
Approve Payment by Payer
Capture Payment
Refund against captured payment
For subscription, I have implemented -
Create a checkout session with a subscription
Approve subscription by the payer
But after this, I couldn't get any further to capture any payment even from webhook, against which I could initiate a refund. There is an API for subscription capture, but it only adjusts the outstanding balance with the current payment. Also, the API doesn't return any object that might carry any capture info to work on a refund.
Does PayPal have any way to refund against payments on recurring subscriptions?
Approved subscriptions will charge automatically on their schedule. That is the point of subscriptions.
To be notified of subscription payments, register a listener endpoint for the webhook event PAYMENT.SALE.COMPLETED.
To refund subscription payments, full or partially, use the rel:refund link within any such sale object to refund it. See the v1/payments/sale/.../refund API call.

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.

Which webhooks to subscribe for payments on paypal recurring payments?

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?

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.

Detecting cancellation of a paypal billing agreement setup with reference transactions

I am using the 'reference transactions' of the Paypal express checkout api to set up a recurring billing scenario for our customers. I have chosen this method since the amount billed per month will vary and there is no initial payment when entering into the billing agreement.
My question is, can I use the paypal IPN to detect when the user cancels this? I know that if the customer enters into this agreement they have the power to log into their own Paypal account and cancel the agreement. What variables should I be listening for through the IPN?
Whilst I see mention of recurring payments and recurring payment profiles in the IPN documentation these are not actually the same as setting up a recurring billing scenario via reference transactions (recurring payments and reference transactions are in two different parts of the general paypal api documentation).
Enable IPN in your PayPal account , then PayPal will notify you via IPN about the Billing agreement cancel from the customer.
If you include IPN with SetExpressCheckout, it will not work with Reference Transaction. You need to Enable IPN on PayPal site.