PayPal express useraction not working when legacy fallback happens - paypal

Trying to Accomplish:
In checking out using PayPal Express lightbox pops up and displays "Pay Now." I bypass the order review page and send user to an order confirmation page that completes payment and displays confirmation.
Problem: PayPal will sometimes display lightbox overlay with "Pay Now" and sometimes redirect the whole page to a legacy paypal page that shows "Continue - You're almost done. You will confirm your payment on New Owner's Test Store."
Why this is a problem?
They get sent to an order confirmation page that bypasses an order review page, it would look strange if they click continue and they are immediately transferred to a payment success order confirmation page.
Technical details:
URL they are sent to after handshake for token-https://www.sandbox.paypal.com/checkoutnow?useraction=commit&token=&useraction=commit#/checkout/login
Fallback URL they sometimes get redirected to-https://www.sandbox.paypal.com/webapps/hermes/fallback?product=ec&reason=hermes_to_legacy&fallback=1&incontext=1&token=&useraction=commit
-The fallback URL shows users 'continue' even though I selected commit (ie.pay now)
What I don't know how to do:
I don't know how I can create a catch on the return URL in the response I get from PayPal so I know whether or not the user was shown a "Pay Now" button or a "Continue - You're almost done. You will confirm your payment on New Owner's Test Store." If they were shown "Pay Now", I want it to show a payment confirmation page, if they are shown "Continue" I want to not call the DoExpressCheckoutPayment and instead show a "Complete Order" button which will then call the DoExpressCheckoutPayment and show them then payment confirmation.
Note: I am working in the Sandbox.

Related

Payment completed "return to merchant" using cancel url

I'm having a weird issue with PayPal Express Checkout.
When a user completes a payment on PayPal it'll show them that the payment has been completed along with a "return to merchant" button. The button is set to the cancel URL instead of the return URL.
I'm setting the return and cancel url manually in the code when making the initial request to PayPal.
One way to reproduce this is to click back after you get automatically redirected back to the merchant's website.
Is this a bug?
At our end, We could see that the buyer has been redirected to return URL correctly. Kindly file an MTS ticket at https://www.paypal-techsupport.com with more information for investigating this issue further.

PayPal REST API cancel URL called after payment executed

I have a strange problem, I'm trying to figure out.
I'm using PHP and REST API.
This is the scenario:
1) Users press the checkout button
2) Payment is approved
3) Payment is executed
4) User is redirected to the completed purchase page
5) Few seconds later, Cancel URL of the transaction is called (like when users clicks on Cancel and return to merchant button, instead of approving the payment).
Out of about 100 transactions I had 3 wich manifested this way on all 3 the payment was actually made, and the funds where available. I have checked the server access log files and 2 of them were using ios 9.3.1 and one was an ios 9.2.1. How is this possible?
My guess is that they somehow hit the back button and then the cancel button, can this be the case?
My cancel URL contains a script which sets the order status to canceled, should I adjust the script to only set the status to canceled if the order wasn't previously executed.
Can anybody still cancel the payment AFTER I have executed the payment?
I think you should "trust" the IPN message sent by PayPal rather than the ok/cancel return url.
https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNIntro/
The ok/cancel url should only be used to display the information to the user
Let PayPal know your IPN endpoint (the script which will receive the IPN GET/POST message). Once your script get called, update the database accordingly
Doing this way the user would not be able to screw up the transaction, you are guarantee to receive 1 IPN message, either it is an "transaction ok" or a "transaction error" message
Your issue seems to be similar to the question posted here.
From user2090027's response which was marked as answer
"We can overcome this by checking/maintaining the no of responses which we get after the payments are made on paypal.
We can maintain this using cookies on client end or on server using sessions or something else similar."
Hope this helps.
This is an old question but having built a PayPal integration myself I thought I'd add some info about why it happens.
If the user ends up on your "return" page after completing their payment and hits the back button, they'll get a PayPal page like this:
If they click "Return to merchant", they'll be sent to your /cancel URL. So if you get one of these and the payment has already gone through, you can show them the payment confirmation page.

Need help regarding IPN and paypal payment page

I'm working on a website where the users can create listings like in a regular classifieds website.
My concern is that if a user wants to feature his listing on the website, he has to make a payment via Paypal (IPN). The problem is that when the user completes the payment, the paypal payment confirmation page will give the user 2 links at the bottom of the confirmation page. The first one is "return to your website" and the second one is "view your paypal account".
If the user clicks the first link it will trigger the featured option and make his listing featured. However if he clicks the second link the user will be sent to his paypal account and will not trigger the featured option.
My concern is that users who will click the second link will pay however will not get the service they paid for. This portion of the website was done by my developer and he said that it would only work if the user clicks the "return on your website" link.
Would you guys have any suggestions or help on how to resolve this? If Paypal did not show the second link it would resolve this pb.
That's what IPN is for. If you enable it, PayPal will send you a payment notification. You should enable the feature for the user when you get the money, regardless of what the user navigates to.

Paypal Payment Standard: Callback URL

On Paypal Sandbox:
After logging in using a test account and then clicking the "Pay Now" button, the user is redirected to "Thanks for your order" page inside Paypal. The page has three(3) links below the message that says:
Return to Test Store
Go to PayPal account overview
Add funds from your bank
Clicking the "Return to Test Store" will redirect me to the return URL I specified on my query string. This marks the order as "Completed" or whatever the value of the payment_status returned by Paypal is.
The Problem:
Clicking the other links bypasses the return URL and goes to user account profile which leaves the order incomplete even if the transaction was successfully paid because the return URL has the script to mark the outcome of the transaction.
The Question:
Is there a way to bypass the Thank you page and just redirect to my return URL so the transaction can be concluded accordingly?
BTW, I have my Test Business Account set to autoredirect to the return URL after the order.
You want to read about PayPal's Instant Payment Notification and about Identifying Your IPN Listener to PayPal.
You have the option to be notified whenever a transaction takes place, regardless of what users clicks on. Paypal's servers will make requests to a Notification URL you provide and give you informations about that transaction.

How can I ensure a PayPal payment bounces back to my website to immediately credit a user?

Well I am working on a site that basically accepts PayPal payments to give their accounts a premium status, don't need to get into exact details of what it does but what I am trying to accomplish is to have a "Pay Now with PayPal" button that will accept the payment then bounce them back to my site with some kind of verification code so I can say "Okay, paid let me run this code to set your account to premium"
Any idea how I can do this? I can specify a success URL but it requires a user to click a button saying "Return to *" after they pay and even that gives them a scary warning message.
https://www.paypal.com/ipn