How to test webhooks in paypal sandbox? - paypal

I have implemented paypal payment in my shop with the new paypal rest api.
I noticed the is no notification url any more to get a callback when i create a transaction. But i saw that there are now webhooks. So i configured some webhooks in paypal and would not like to test them.
But i can not find any tool or interface to test the webhooks. I do not mean the way to access them by the rest api. I want paypal to execute a request to my server when a payment is for e.g. revoked somehow.
Where can i tell paypal to execute webhook request?

You need to setup the APN gateway.
In the developer account, you can log into the test accounts in sand box mode.
Next go to the account settings and look for APN.
You can setup the path to your test servers url and capture the "webhooks" there.
Hope this helps.

Related

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.

Using PayPal webhooks with NVP DoExpressCheckoutPayment

I'm working on a website where a user can pay for products to another user, the user that is getting paid has his API Signature set and the payment is accomplished using ExpressCheckout (NVP) (the payer just gets redirected to a PayPal page where he logs in if necessary and just clicks a button to pay).
The problem is I tried using webhooks to track refunds for these payments, so I can later insert the refund data into my database via callback URL (php function), but the URL I've set doesn't get called at all(I've previously simulated an event on the same URL and everything was fine).
I am trying to get this to work by setting my API Signature and a friend of mine paying me some cents(via DoExpressCheckoutPayment) after which I refund them to him (no calls, only using the PayPal website).
Also nothing appears on the Sandbox Webhooks Events page or the Live one. I've tried registering other events like "Payment capture completed" or "Payment sale completed" to my webhook but with the same result.
Do I have to change some settings in my account? I've created a REST API app in order to use webhooks, but I've seen there's an option for NVP/SOAP API apps. I have considered IPN if webhooks don't work.
"Webhooks" are used with the REST API. Express Checkout uses IPN.
You'll need to setup a separate listener for IPN similar to what you've done with webhooks on the REST API.

how can I monitor sandboxed PayPal NVP service calls in developer portal?

I see in executing the ruby sample from the github.com/paypal/adaptivepayments-sdk-ruby/blob/master/README.md that tests against the App ID APP-80W284485P519543T will succeed, no matter what credentials are configured.
Moreover, I gather from the 'FOR APP TESTING' message at the bottom of the welcome page to the Adaptive Payments Developer Apps portal, www.paypal-apps.com/user/my-account/applications, that it is not possible to set up a PayPal NVP test account with dummy user accounts:
Does this mean, then, that transactions from sandboxed use of PayPal NVP services cannot be configured to show at developer.paypal.com/developer/dashboard/sandbox?
In developer.paypal.com dashboard => Sandbox=>Transactions, it only list REST API transactions. There is no place to show NPV service API calls in developer website. you need to login sandbox.paypal.com to check the transaction list.

PayPal: How do you get notifications of payment through the permissions API?

Using the PayPal permissions API can you receive notifications from payments made after a customer clicks on a payment button, proceeds to PayPal, and then pays?
I notice they have IPN, but will this work with the permissions API?
Thanks!
You can include NotifyURL in your API requests to set a URL for IPN to POST data to. It's not something that technically "works with the permissions API" but any transaction that is made would indeed trigger the IPN.
If you're building an app for 3rd parties to use, though, and you're passing NotifyURL in your API requests, that will override any IPN configuration each individual merchant using your tool might have setup on their own. This can cause frustration for such users because then their own IPN solution doesn't get hit when they take payments through your app.
If you're going to do that I recommend setting up a way for your users to enter their own IPN URL in your app settings, and then if they have a value, forward the POSTed data to their URL when PayPal sends it to yours. That way both IPN scripts will get hit and process the data accordingly.

PayPal IPN and live accounts

A user clicks on a buy now button on my website which takes them to PayPal where they can purchase my item. I then receive the relevant information through my IPN listener. This all works fine with sandbox accounts.
To implement this with my live business account, am I right in thinking I don't need to worry about creating live API certificates etc? I understand this is needed when making API calls to live accounts but I'm assuming a simple buy now button doesn't need this stuff setup.
Correct. You only need API credentials when you will make an API call. IPN is a push notice, so PayPal is sending the data to you instead. All you need to do is post the data back to PayPal to verify it and then process the POST data.