close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

sending to success if no need for payment on paypal express

Thread began 5/25/2012 6:37 am by Christopher West | Last modified 5/30/2012 8:40 am by Christopher West | 1796 views | 7 replies

Jason ByrnesWebAssist

On the checkout page at lines line 103 - 214 is the code for the authentication for paypal express checkout behavior.

it begins the first few lines and last few lines look like this:

php:
<?php

$WA_PP_ECO_SetResult 
WA_PP_ECO_SOAPObject();
if (isset(
$_POST["PayPal_ExpressCheckout_button_x"]))  {
.....
.....
.....
  
$WA_PP_ECO_SetResult WA_PP_ECO_Set_Post($WA_PP_ECO_Set_params,$WA_PP_ECO_Do_itemized);
  if (
$WA_PP_ECO_SetResult->isError) {
    if (
"http://www.dinkyfingerprint.co.uk/failure.php" != "") {
      
header("Location: ""http://www.dinkyfingerprint.co.uk/failure.php"); exit;
    }
  }
  else {
    
$DinkyCart->redirStr $WA_PP_ECO_SetResult->ECOServer;
  }
}
?>




add an if statement around that code so it only executes if the cart total is greater than 0:

php:
<?php if($DinkyCart->GrandTotal() > 0) { ?>

<?php
$WA_PP_ECO_SetResult 
WA_PP_ECO_SOAPObject();
if (isset(
$_POST["PayPal_ExpressCheckout_button_x"]))  {
.....
.....
.....
  
$WA_PP_ECO_SetResult WA_PP_ECO_Set_Post($WA_PP_ECO_Set_params,$WA_PP_ECO_Do_itemized);
  if (
$WA_PP_ECO_SetResult->isError) {
    if (
"http://www.dinkyfingerprint.co.uk/failure.php" != "") {
      
header("Location: ""http://www.dinkyfingerprint.co.uk/failure.php"); exit;
    }
  }
  else {
    
$DinkyCart->redirStr $WA_PP_ECO_SetResult->ECOServer;
  }
}
?>
<?php 
} else { $DinkyCart->redirStr "http://www.dinkyfingerprint.co.uk/confirm.php" ?>







on the confirm page, at lines 19 - 134, there is also express checkout code, for the Get Payer Profile and Process transaction with express checkout behaviors, you need to add a similar statements to prevent that code from processing if the total is not greater than 0 and set the redirect to the success page if it is.

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