PayPal transaction status change hook/notification - paypal

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.

Related

What event is triggered from PayPal on successful recuring payment (for subscription)?

I have a subscription based web site where I would like to get statistics about all the current active subscribers and how many cycles they have made. This would have been easy task if the PayPal API had an endpoint for fetching all subscriptions but this is missing from their API. So I'm tracking this in our DB. I'm successfully recording the new subscriptions and the cancellations. But I'm not sure what event I should expect from PayPal to be triggered when a subscription renews.
In PayPal's documentation I have found only few events related to the subscriptions, and none of those seems to serve my needs. There are also an event called BILLING.SUBSCRIPTION.RE-ACTIVATED but it comes from "Billing plans and agreements" which is deprecated.
In SO I have found this post which advises to check for the PAYMENT.SALE.COMPLETED, but this is not perfect as I will get all sort of payments that hit this PayPal account (it is used not only for subscriptions but also for one-time payments).
It's PAYMENT.SALE.COMPLETED
For one time payments, a /v2/checkout/orders integration shouldn't trigger that same event, only the deprecated /v1/payments does AFAIK.
You can tell whether it's a subscription payment by the payload, subscription IDs begin with I-

Paypal Webhook is created sufficient to imply activated

Paypal with active webhooks. We use a subscription plan.
When a customer
subscribes to the subscription plan PayPal's webhook sends us a BILLING.SUBSCRIPTION.CREATED. 

We do not get a BILLING.SUBSCRIPTION.ACTIVATED. Can I expect it being activated when it is
created or do I need to double check that?
(Side note, when trying to send an api request to activate it, an error message informs me that the subscription plan is not “suspended”. So that looks like it is already activated. Logging into PayPal also confirms it is activated.)

The documentation on it is a little vague.
Created means the user clicked the button to subscribe. It does not mean they entered any payment details, or finished subscribing.
If you are not receiving a BILLING.SUBSCRIPTION.ACTIVATED event but the subscription is active, perhaps you did not subscribe to that event?
In any case, the most useful event to listen for is PAYMENT.SALE.COMPLETED. This will occur for the first payment as well as every future payment on the schedule. You can build all your business logic with only PAYMENT.SALE.COMPLETED , using every receipt of this event to mark how long the subscription is valid for in your system (e.g. 1 month from receipt)

Automatically get a different status for an authorized vs. captured payment?

Is there a way or an extension out there that allows a Magento order to get a different status automatically once a payment has been captured?
The reason why we're looking for this is because we connect to ShipStation (www.shipstation.com) for shipping and eCC Webgility (www.webgility.com) to post orders to our accounting software. We need a more automated way for those orders that get pulled in for us to know whether the order has had funds captured or not. The only way for us to do this now is manually change the order status since Magento's default method keeps the order in "processing" regardless of it being invoiced or not.
You'll be able to do all of that with an Instant Payment Notification (IPN) solution.
For any transaction that ever hits your PayPal account, whether it's a payment, a refund, a cleared or failed pending payment, disputes, etc. their server will POST the transaction data to a listener script on your server.
Within this script you can use that data to update your database, generate custom email notifications, hit 3rd party web service API's, etc. all automatically, in real-time.

PayPal simple Subscribe and Unsubscribe

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.

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.