close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Paypal Process the charges, ecart save order in the databse but user ends at the failure page

Thread began 5/22/2021 10:24 am by ccdantas101117 | Last modified 5/22/2021 3:29 pm by Ray Borduin | 169 views | 1 replies |

ccdantas101117

Paypal Process the charges, ecart save order in the databse but user ends at the failure page

Hi everybody, I need help, please, to figure it out why paypal process the transaction, eCart saves it on the database and user ends at the pp_checkout_failure page.
I have substituted the api, key and password with "x" for security reasons.
Find the process transaction code at the confirmation page below:
<?php
$WA_PP_ECO_DoResult = WA_PP_ECO_SOAPObject();
if (($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST)) {
$WA_PP_ECO_Do_required = array();
$WA_PP_ECO_Do_required[0] = array();
$WA_PP_ECO_Do_required[1] = array();
$WA_PP_ECO_Do_itemized = array();
$WA_PP_ECO_Do_itemized[0] = array();
$WA_PP_ECO_Do_itemized[1] = array();
$WA_PP_ECO_Do_optional = array();
$WA_PP_ECO_Do_optional[0] = array();
$WA_PP_ECO_Do_optional[1] = array();
$cartIndex = 0;
$nextIndex = 0;
$nextIndex = count($WA_PP_ECO_Do_required[0]);
$WA_PP_ECO_Do_required[0][$nextIndex] = "Username";
$WA_PP_ECO_Do_required[1][$nextIndex] = "xxxxxxxxxxxx";
$nextIndex = count($WA_PP_ECO_Do_required[0]);
$WA_PP_ECO_Do_required[0][$nextIndex] = "Password";
$WA_PP_ECO_Do_required[1][$nextIndex] = "xxxxxxxxxx";
$nextIndex = count($WA_PP_ECO_Do_required[0]);
$WA_PP_ECO_Do_required[0][$nextIndex] = "Signature";
$WA_PP_ECO_Do_required[1][$nextIndex] = "xxxxxxxxxxxxx";
$nextIndex = count($WA_PP_ECO_Do_required[0]);
$WA_PP_ECO_Do_required[0][$nextIndex] = "Token";
$WA_PP_ECO_Do_required[1][$nextIndex] = "".((isset($_SESSION["PayPal_ECO_Token"]))?$_SESSION["PayPal_ECO_Token"]:"") ."";
$nextIndex = count($WA_PP_ECO_Do_required[0]);
$WA_PP_ECO_Do_required[0][$nextIndex] = "PayerID";
$WA_PP_ECO_Do_required[1][$nextIndex] = "".((isset($_SESSION["PayPal_ECO_PayerID"]))?$_SESSION["PayPal_ECO_PayerID"]:"") ."";

$WA_PP_ECO_Do_itemized[0][0] = "OrderTotal";
$WA_PP_ECO_Do_itemized[1][0] = "".$feteCart->GrandTotal() ."";
$WA_PP_ECO_Do_itemized[0][1] = "OrderDescription";
$WA_PP_ECO_Do_itemized[1][1] = "";
while ( !$feteCart->EOF() ) {
$nextIndex = count($WA_PP_ECO_Do_itemized[0]);
$WA_PP_ECO_Do_itemized[0][$nextIndex] = "Amount" . strval($cartIndex+1) . "";
$WA_PP_ECO_Do_itemized[1][$nextIndex] = "".$feteCart->DisplayInfo("truePrice") ."";
$nextIndex = count($WA_PP_ECO_Do_itemized[0]);
$WA_PP_ECO_Do_itemized[0][$nextIndex] = "Name" . strval($cartIndex+1) . "";
$WA_PP_ECO_Do_itemized[1][$nextIndex] = "".$feteCart->DisplayInfo("Name") ."";
$nextIndex = count($WA_PP_ECO_Do_itemized[0]);
$WA_PP_ECO_Do_itemized[0][$nextIndex] = "Number" . strval($cartIndex+1) . "";
$WA_PP_ECO_Do_itemized[1][$nextIndex] = "".$feteCart->DisplayInfo("ID") ."";
$nextIndex = count($WA_PP_ECO_Do_itemized[0]);
$WA_PP_ECO_Do_itemized[0][$nextIndex] = "Quantity" . strval($cartIndex+1) . "";
$WA_PP_ECO_Do_itemized[1][$nextIndex] = "".$feteCart->DisplayInfo("Quantity") ."";

$feteCart->MoveNext();
$cartIndex ++;
}
$feteCart->MoveFirst();
$nextIndex = count($WA_PP_ECO_Do_optional[0]);
$WA_PP_ECO_Do_optional[0][$nextIndex] = "System";
$WA_PP_ECO_Do_optional[1][$nextIndex] = "US";
$nextIndex = count($WA_PP_ECO_Do_optional[0]);
$WA_PP_ECO_Do_optional[0][$nextIndex] = "PaymentAction";
$WA_PP_ECO_Do_optional[1][$nextIndex] = "Sale";
$nextIndex = count($WA_PP_ECO_Do_optional[0]);
$WA_PP_ECO_Do_optional[0][$nextIndex] = "Currency";
$WA_PP_ECO_Do_optional[1][$nextIndex] = "USD";
$nextIndex = count($WA_PP_ECO_Do_optional[0]);
$WA_PP_ECO_Do_optional[0][$nextIndex] = "ItemTotal";
$WA_PP_ECO_Do_optional[1][$nextIndex] = "".$feteCart->TotalColumn("TotalPrice") ."";
$nextIndex = count($WA_PP_ECO_Do_optional[0]);
$WA_PP_ECO_Do_optional[0][$nextIndex] = "ShippingTotal";
$WA_PP_ECO_Do_optional[1][$nextIndex] = "".$feteCart->GetShipping() ."";
$nextIndex = count($WA_PP_ECO_Do_optional[0]);
$WA_PP_ECO_Do_optional[0][$nextIndex] = "HandlingTotal";
$WA_PP_ECO_Do_optional[1][$nextIndex] = "".$feteCart->GetCharges() - $feteCart->GetDiscounts() ."";
$nextIndex = count($WA_PP_ECO_Do_optional[0]);
$WA_PP_ECO_Do_optional[0][$nextIndex] = "TaxTotal";
$WA_PP_ECO_Do_optional[1][$nextIndex] = "".$feteCart->GetTax() ."";

$WA_PP_ECO_DoResult = WA_PP_ECO_Do_Post($WA_PP_ECO_Do_required,$WA_PP_ECO_Do_itemized,$WA_PP_ECO_Do_optional);
if (!$WA_PP_ECO_DoResult->isError) {
$feteCart->redirStr = "pp_checkout_success.php";
}
else if ("pp_checkout_failure.php" != "") {
header("Location: ". "pp_checkout_failure.php"); exit;
}
}
?>

Sign in to reply to this post

Ray BorduinWebAssist

Maybe a redirect on a different page? The issue probably isn't in the code you provided.

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

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