close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Bugs with cart process: CustomerID occasionally missing and redirect failure

Thread began 12/27/2010 8:37 pm by SaladoGuy | Last modified 12/28/2010 2:18 pm by SaladoGuy | 1357 views | 2 replies |

SaladoGuyBeta Tester

Bugs with cart process: CustomerID occasionally missing and redirect failure

I'm having two problems with my checkout process:

1) Occasionally the customer's customerid is not posted (saved) into the orders table. Strangely, this is the ONLY field in the whole database that has this problem. The exact same customer id is always posted correctly in the "rosters" table (which is the "orderdetail" table in my DB).

Could you please examine the attached file and determine why the customer ID would occasionally fail to post (the table/field name is orders.ordercustomerid)?

I would say it fails about 25% or 30% of the time. It is a random failure as best I can tell. Sometimes it happens with new customers, sometimes not. Sometimes it posts correctly when a customer places an order, then immediately after does not post when they place a second order. But there are also many (maybe most) times it works fine in those same scenarios.

We are using the SecurityAssist/DataAssist user login / authentication to make the users log in before purchasing. The customerid gets set into a session variable at login (or registration). I have not been able to find a circumstance where that customerID session var fails to get set, and this is backed up (I think) by the fact that the orderdetail table ("rosters") always stores the customerid correctly

2) For some reason, when users try to use an invalid credit card type (for example, AmEx) or do something else to cause a declined transaction (bad address, perhaps - I received the user reports third hand so I'm not sure the details) instead of being redirected to checkout_failure.php they are (at least sometimes) being redirected to checkout_success.php as if the order had gone through. This is causing terrible confusion. The only way some users know something is wrong is that on the confirmation page, the orderid is blank - and they've called us to ask what went wrong. We're afraid other people have probably placed orders that were actually declined, but because they saw the checkout_success page they probably think their order went through fine :-(

If I need to add any additional info or if you need to see any of the other site files, please let me know.

Thanks.

Attached Files
confirm.php.zip
Sign in to reply to this post

Ray BorduinWebAssist

I see on your page:

$WAGatewayResponse = AuthNet_Post($AuthNet_required,$AuthNet_itemized,$AuthNet_optional);
if ($WAGatewayResponse) {
$eCart1->redirStr = "checkout_success.php";
}
// else if ("checkout_failure.php" != "") {
else if ("checkout_success.php" != "") {
header("Location: ". "checkout_success.php");
exit();
}



this should probably read:


$WAGatewayResponse = AuthNet_Post($AuthNet_required,$AuthNet_itemized,$AuthNet_optional);
if ($WAGatewayResponse) {
$eCart1->redirStr = "checkout_success.php";
}
else if ("checkout_failure.php" != "") {
header("Location: ". "checkout_failure.php");
exit();
}



It looks like someone has manually updated the code to make it always redirect to the success page even when it fails.

You can probably reproduce it by entering a bad credit card number like: 4111111111111111

it will happen if the transaction fails for any reason.

You'll also want to move the code:

<?php
// WA eCart Redirect
if ($eCart1->redirStr != "") {
header("Location: ".$eCart1->redirStr);
}
?>



below the email... it should be immediately above the DOCTYPE tag to give the email receipt time to send.

In terms of the customerID it looks like in the orders table you are using:

$_SESSION['customers_customerid']

and in the orderdetails you are using:

$_SESSION['customerid']

you can probably just correct that on line 430

Sign in to reply to this post
Did this help? Tips are appreciated...

SaladoGuyBeta Tester

Thanks, all that seems to work now.

Sign in to reply to this post

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...