PayPal asynchronous notification - asynchronous

Now information about the successful transaction I get with a redirect the user back to my site from paypal. And then I make additional requests to api paypal.
But if the user cancels the redirect to my site, for some reason, I do not get the information about the transaction.
Is there an asynchronous notification from Paypal for Website Payments Standard or Express Checkout?

Instant Payment Notification (IPN) works for all payment methods through PayPal. The Developer.PayPal.com document you linked is a list of variables for the Express Checkout feature and it is telling you that you can only pass the NOTIFYURL variable successfully in the DoExpressCheckoutPayment API call.
In Payments Standard transactions you'll use the notify_url variable.
You can also just enable IPN within your account to have an IPN post sent to your notification page when any payment completes - regardless of whether or not you define a URL in the button code or API request (the URL you define in the code will always override what is set in your account).

Related

PayPal Sandbox subscription webhook response not getting

I'm trying to get notified via webhooks when a simple payment is made and subscription, however I don't receive any request from paypal on the specified URL. Here is what I've done:
I have 2 sandbox accounts: Facilitator and Buyer
Create an app (sanbox mode) for the facilitator account
Add a webhook URL in that app
Login into sanbox.paypal.com with the sandbox facilitator username and password
Get payment through express checkout and customer also agree for subscription
Received success response from PayPal
Prepare query string to create subscription for that customer and send data through REST Api
Received response from PayPal related to subscription.
When I login to business account or Facilitator account, I can see bot payment and subscription transaction but the webhook page on my server is not called.
Also if I go to Developer Account -> Webhook Notifications and select the app I have this message: You don't have any events for the selected application
NOTE: If I add the URL in the webhook simulator everything works great.
Am I doing something wrong?
Thanks
You can try to add "All events" for your webhook endpoint.
Then check if you received anything after completing your order in Developer Account -> Webhook Notifications.
If you still get nothing there, consider cross checking your clientId + secret that you use while creating your order.

Waiting for Paypal Payment Notification ASP.NET

I am implementing an ASP.NET web app where the user will fill an application that spans over multiple steps/Pages, with previous/Next buttons on each page to navigate back and forth to each step.
On the second step/page, I have a paypal payment button, so the user can pay for the services they selected on the first page.
My requirements is to wait for the user to pay with paypal and get the notification that a payment was received then navigate to the next page automatically. The user should not be able to proceed without payment.
The paypal payment button opens a new window with paypal site where the user makes the payment.
I looked at Paypal IPN (Instant Payment Notification), Paypal can send the notification to a service on the back-end in the web app, but how can I forward the user to the next page once this notification is received, since this service is not tied directly to the page that the user has opened on his browser?
The one way I am thinking to do is to store the payment in some table with the userid and a unique code and have a javascript function with setInterval(checkPayment, 5000); so every 5 seconds, it calls a service to check if there was a payment and forward the user.
Is there any better solution ?
Better solution is to NOT involve IPN in your checkout flow. As stated:
Because IPN is not a real-time service, your checkout flow should not wait for the IPN message before it is allowed to complete.
REF: https://developer.paypal.com/docs/classic/products/instant-payment-notification/
Paypal has an extensive API that handles your flow - e.g
Express Checkout
REST

Silent payment using paypal without redirecting to paypal url

Is there a way I can pass the sellers credentials to the Paypal API and it can make a transaction without taking him to Paypal URL?
TL. DR.
I am trying to build an eCommerce website for a shop with Paypal as the payment medium. The payment for user has been implemented where he is redirected to the Paypal website and he can purchase an item. But under certain conditions he is allowed to cancel his purchase and his payment must be credited back to him.
I need this transaction to happen without navigating to the Paypal URL.The reason is that, the buyer is the one initiating the transaction. So there is no way he can authorize a transfer from sellers to buyers account. The buyer should be able to press the "Cancel Order" button and the payment should be immediately credited back to his paypal account.
I can store the sellers credentials in the server and send it to the API which should be able to authorize him but I was looking for an API which Paypal provides to make this happen.
My requirement is different from the anser provided in this question as here they still show a popup of paypal webpage.

Using IPN to verify successful payment on PayPal

I'm using PayPal hosted pages for payments on my site. I pass return url when creating SECURETOKEN used in iframe url. After client successful payment, I get browser postback from PayPal on return url passed when SECURETOKEN was created. What happens from time to time is that user close tab before I get postback, saying transaction is approved, and I can't mark it as approved in my local DB.
Workaround was to create IPN listener, and update my local records when I receive valid IPN request.
Now the issue is, I miss some params that I'm getting in iframe postback, that are mandatory, such as ACC, EXPTIME, PNREF.
As far as I can read, IPN will NEVER send those data in it's request. Can this be overridden within paypal manager? If not, can anyone suggest any solution to this problem?
Thanks
I managed to do this by enabling Silent POST url feature in my paypal manager, so same server to server postback will be fired regardless of client closing browser, after payment is accepted.

Paypal integration without IPN

I want to integrate paypal buy now button and get feedback from paypal in a school project, but i don't want to use IPN because the computer running the website will not be accessible from outside.
Are there any options for doing this?
You don't have to enable IPN to have buy now buttons on Paypal, it's completely optional. The buy now button will still take you to the correct page on Paypal so the purchase can be made. IPN only allows you to get feedback from Paypal when this happens.
Well, I need to get some information
when a successful payment is made.
Paypal can notify you by mail when something has happened.
Apologies for the bump. Just adding this in case anyone else needs it:
Use "rm=2". (input type hidden, name=rm, value=2)
https://merchant.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables
Return method. The FORM METHOD used to send data to the URL specified by the return variable after payment completion. Allowable values:
0 – all shopping cart transactions use the GET method
1 – the payer’s browser is redirected to the return URL by the GET method, and no transaction variables are sent
2 – the payer’s browser is redirected to the return URL by the POST method, and all transaction variables are also posted

Resources