PayPal simple Subscribe and Unsubscribe - paypal

I have a page that will have a monthly subscription fee and I was wondering if PayPal's simple subscribe and unsubscribe buttons can do the trick without using the API.
On subscription the user is returned to my page and I handle the subscription, but if the user decides to unsubscribe how can I handle it? Or is it possible at all?
Does the page make a return call to the same address I have given for redirection?
Thank you for the help in advance.

Yes, Standard Subscription buttons can be used without any API calls. I would recommend using Instant Payment Notification (IPN) to handle all transactions associated with subscription profiles.
PayPal's IPN server will POST transaction data to a listener script you have on your server when transactions occur in real-time. This allows you to automate post-transaction procedures like updating your database, sending email notifications, or anything else you might like to do when transactions occur.

Related

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).

Is IPN required to detect cancellation of REST created Subscriptions?

I have REST API created Payment Plans and agreements and would like to be able to detect when a user cancel an agreement. My original take on this was that the cancel_url on the merchant_preferences object for billing_plan would be used if a users canceled the agreement through the PayPal API, but I am not seeing any callbacks coming in so perhaps this is incorrect?
I have seen plenty on information on IPN processing cancellations and I would love to know if that is the only way to receive a cancellation notification or should I be using another field in the REST API to set this up?
I'm not against using IPN (hey whatever gets the job done!), but it seems to me that the REST API should have its own capabilities for achieving this as well.
Hey this is Avi from PayPal. Refer to this github issue for information about getting IPN notifications for subscription events.
The REST API does have webhooks, and work is in progress to support subscription events for webhooks as well.

PayPal transaction status change hook/notification

Is it possible to register some PayPal web hook that will get executed whenever some transaction with concrete seller changes it's status, becomes charged back etc.? I couldn't find anything about this in docs. It would be much efficient than periodically checking status of every transaction.
Thanks!
Check out Instant Payment Notification (IPN).
Instant Payment Notification (IPN) is a message service that notifies
you of events related to PayPal transactions. You can use this service
to automate back-office and administrative functions, including
fulfilling orders, tracking customers, and providing status and other
information related to transactions.
Note: you can register ONE place to be notified ... and it will need to parse out which notifications should be handled by what code.

transactional operations with paypal api

I am adding payments to our website. I would like a way to update my database and capture a payment via paypal api within a transaction. Does anybody know if there is any way to do this? Perhaps a paypal callback?
Do the capture and after that, update the database. Some minutes later you'll receive an IPN message with details about the capture and you can use it to check whether the database is updated. But don't rely on IPN only, from my experience I can say that it's not 100% reliable. Sometimes it happens that I don't receive some of the IPNs, or they are delayed with some hours.

How does paypal notify you that a user has successfully paid

If we use a paypal buy it now button, how are we notified that a user has completed their transaction?
I'm guessing there is a way other than checking our email and past transactions?
I'm language agnostic at this point, so any sample code would be a great help
Thanks
Paypal has a system called Instant Payment Notification.
Instant Payment Notification (IPN) is a message service that notifies you of events related to PayPal transactions. You can use it to automate back-office and administrative functions, such as fulfilling orders, tracking customers, and providing status and other information related to a transaction.
The linked page should have all the information you need to get set up.