close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Problems With PayPal Checkout

Thread began 1/08/2015 11:44 pm by Lee Firth | Last modified 2/02/2015 12:28 pm by Jason Byrnes | 867 views | 13 replies |

Lee Firth

Problems With PayPal Checkout

This has been working but for some reason it doesn't anymore. If the customer pays by credit card it all works fine. But if they select PayPal it fails. I've traced the problem to the confirm.php file where the ReturnURL & CancelURL values are set. If I have them set like so:

$WA_PP_ECO_Set_params[0][$nextIndex] = "ReturnURL";
$WA_PP_ECO_Set_params[1][$nextIndex] = "https://www.championnutrition.net.nz/pp_confirm.php";
$nextIndex = count($WA_PP_ECO_Set_params[0]);
$WA_PP_ECO_Set_params[0][$nextIndex] = "CancelURL";
$WA_PP_ECO_Set_params[1][$nextIndex] = "https://www.championnutrition.net.nz/cart.php?ppcancel=1";
$nextIndex = count($WA_PP_ECO_Set_params[0]);

I get a "Not Found" error because the eCart is trying to go to the following URL:

https://www.championnutrition.net.nz/https://www.paypal.com/checkoutnow?token=

If I have ReturnURL & CancelURL values set like this:

$WA_PP_ECO_Set_params[0][$nextIndex] = "ReturnURL";
$WA_PP_ECO_Set_params[1][$nextIndex] = "pp_confirm.php";
$nextIndex = count($WA_PP_ECO_Set_params[0]);
$WA_PP_ECO_Set_params[0][$nextIndex] = "CancelURL";
$WA_PP_ECO_Set_params[1][$nextIndex] = "cart.php?ppcancel=1";

You are redirected to the "Transaction Failed" page and the following error messages:

Transaction refused because of an invalid argument.
ReturnURL is invalid.
CancelURL is invalid.

I can't seem to win either way.

Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

Lee Firth

See PM

Sign in to reply to this post

Jason ByrnesWebAssist

I Updated the web assist/framework/library.php file to fix this.

Sign in to reply to this post

Lee Firth

Thanks for that Jason. Was this a known issue? Just would like to know for future reference.

Sign in to reply to this post

Jason ByrnesWebAssist

It is a bug that has been fixed in the most recent eCart version.

Sign in to reply to this post

Lee Firth

There is still an issue with this, if a client successfully makes a payment using their credit card they are redirected to http://checkout_success.php instead of http://domainname.com/checkout_success.php.

The code that controls the redirect is on the confirm.php page on line 195:

$WAGatewayResponse = PP_DirectPayment_Post($PP_DirectPayment_required,$PP_DirectPayment_itemized,$PP_DirectPayment_optional);
if ($WAGatewayResponse) {
$eCart1->redirStr = "checkout_success.php";
}
else if ("checkout_failure.php" != "") {
header("Location: ". "checkout_failure.php");
exit();
}

If I change the redirect to "http://domainname.com/checkout_success.php"

You are directed to "http://http://domainname.com/checkout_success.php"

If I change it to "domainname.com/checkout_success.php"

You end up at the shopping cart, where it is saying that the cart is empty.

Sign in to reply to this post

Jason ByrnesWebAssist

you should be using:
domainname.com/checkout_success.php

for the success redirect.

the shopping cart empty is being caused by domain switching between using the www address and returning to the none www address. In order words, you are adding the items to the cart using:
www.domainname.com/products.php

and then returning to the non www address:
domainname.com/checkout_success.php

this is a different browsing session. to prevent this you can use mod rewrite and hataccess to force the www address, see the following page for details:
http://www.htaccessbasics.com/force-www-nonwww-domain/

Sign in to reply to this post

Lee Firth

This post has been deleted.

Lee Firth

Is it OK to use www.domainname.com? I did the rewrite and this did work when typing it in the browser address bar like so http://domainname.com/filename.php redirected to https://www.domainname.com/filename.php but when I did a test purchase it redirected as before. After changing the the redirect to www.domainname.com it worked.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...