PayPal return url

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

PayPal return url

Post by AbleMods » Tue Mar 06, 2018 9:35 am

I notice in the IPNProcessor.cs routine of the PayPal gateway, the return URL is coded as the member MyOrder page:

Code: Select all

            //ORDER LOAD SUCCESSFUL, UPDATE DEFAULT REDIRECT URL
            redirectUrl = "~/Members/MyOrder.aspx?OrderNumber=" + order.OrderNumber.ToString();
My question: Why aren't they sent to the /Members/Receipt.aspx page? Was there a specific technical reason for that decision?
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: PayPal return url

Post by Katie » Thu Mar 08, 2018 12:41 am

I think this happens when the PayPal payment was successful. Otherwise, we should send them to the receipt page and a Paypal payment button would should up there. We are trying to predict where to send them depending on the success of the transaction. This is the behavior that I've experienced during testing.
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: PayPal return url

Post by AbleMods » Thu Mar 08, 2018 12:51 am

It's that automatic redirect that was implemented back in Able 7.x, isn't it? People complained that shoppers had to click another button when a paypal order reached the receipt page. So you guys implemented an automatic-click on the paypal button when the receipt page loads.

And now that prevents (unpaid) paypal orders from landing to the receipt page because the button would render and auto-click would happen again.

All other payment methods like credit card, purchase order, pay by phone all land on the receipt page after checkout. But PayPal doesn't.

Our problem is any scripts installed on the receipt page to track sales never fire for PayPal orders.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: PayPal return url

Post by Katie » Thu Mar 08, 2018 1:05 am

Our problem is any scripts installed on the receipt page to track sales never fire for PayPal orders.
This is a bug. I absolutely understand what is happening, and I think it's been brought up before.

I don't know how old our Paypal integration is now....but I think it needs a total upgrade.
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: PayPal return url

Post by AbleMods » Thu Mar 08, 2018 1:59 am

I recall digging into it before and I believe that was the conclusion. I agree it needs re-worked into something more compatible with the usual checkout flow. A challenge I'm sure, PayPal is very awkward in how it has to be implemented.

Back in the early days of 7.x, a shopper that chose PayPal as the payment method on the checkout payment page would land on the receipt page. A "PAY NOW" PayPal button would render because that's how PayPal wanted it implemented. Clicking the button on the receipt page would redirect the shopper to the PayPal website where payment was accepted. But, users complained that they didn't realize they had to click that button. So lots of orders just sat there unpaid and Able admins expressed their desire to see this process improved.

The solution implemented was to add a snippet of javascript at the point when the PayPal button is rendered. The snippet would automatically click the button immediately after the page loaded, so the shopper never actually saw the receipt page. This worked great from a user standpoint and the immediate issue was resolved.

But it also meant that any other javascript on the receipt page never got the chance to fire.

Line 323 in the /IntegratedProviders/PayPal/PayNowButton.cs Gold R12 file:

Code: Select all

sb.Append("<body onload=\"document.PayPal_Button.submit();\">");
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
compunerdy
Admiral (ADM)
Admiral (ADM)
Posts: 1283
Joined: Sun Nov 18, 2007 3:55 pm

Re: PayPal return url

Post by compunerdy » Thu Mar 08, 2018 2:37 am

I understand it may be harder to implement than it is for CC but it would be great if failed paypal payments did not create orders.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: PayPal return url

Post by AbleMods » Thu Mar 08, 2018 2:50 am

compunerdy wrote:I understand it may be harder to implement than it is for CC but it would be great if failed paypal payments did not create orders.
Unfortunately I do not think that is possible. PayPal requires the Order Number to be known before the shopper is sent to PayPal. And the only way to generate a valid order number is to generate an order i.e. execute checkout.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
compunerdy
Admiral (ADM)
Admiral (ADM)
Posts: 1283
Joined: Sun Nov 18, 2007 3:55 pm

Re: PayPal return url

Post by compunerdy » Thu Mar 08, 2018 3:48 am

Option to auto cancel them with maybe a E-mail to the user just in case they did not get the memo that they didn't finish the checkout or there was a payment issue?

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: PayPal return url

Post by AbleMods » Thu Mar 08, 2018 4:08 am

I'm not following you. Auto cancel the order?

By the time the receipt page loads, there's no way for Able to know if the payment actually went through. Sometimes PayPal will take hours to notify Able via IPN that the payment was success or failure.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
compunerdy
Admiral (ADM)
Admiral (ADM)
Posts: 1283
Joined: Sun Nov 18, 2007 3:55 pm

Re: PayPal return url

Post by compunerdy » Thu Mar 08, 2018 4:30 am

Hmm.. no easy fix then I guess.

Post Reply