close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

modifying powerstore with ecart

Thread began 9/01/2010 3:06 am by CraigR | Last modified 9/13/2010 11:03 am by Jason Byrnes | 3146 views | 11 replies |

CraigRBeta Tester

modifying powerstore with ecart

i am modifying a client's PS site with ecart, creating new shipping rules.

on the checkout.php page, i added a form for the customer to select various shipping options with an update button to reload the page and set the session value.

whenever the form is submitted, the page redirects to pp_checkout failure

i tried this with my own ecommerce site and it iworks ok, just not working in PS

Sign in to reply to this post

Jason ByrnesWebAssist

when it redirects to the failure page, does the url contain the shipping=failed querystring?



have you tried adding the debug code to the failure page:

php:
<?php  

 
if(!session_id()) session_start(); 

     echo 
"<p>Direct Pay: <br />"
     echo 
"Full Request: ".(isset($_SESSION["PP_DirectPayment_postedValues"])?htmlentities($_SESSION["PP_DirectPayment_postedValues"]):"n/a")."<br />";  
     echo 
"Full Response: ".(isset($_SESSION["PP_DirectPayment"])?htmlentities($_SESSION["PP_DirectPayment"]):"n/a")."<br /></p>";  
     echo 
"<p>Express Authorize <br />"
     echo 
"Full Request: ".(isset($_SESSION["ECO_Auth_Request"])?htmlentities($_SESSION["ECO_Auth_Request"]):"n/a")."<br />"
     echo 
"Full Response: ".(isset($_SESSION["ECO_Auth_Result"])?htmlentities($_SESSION["ECO_Auth_Result"]):"n/a")."<br />"
     echo 
"<p>Express Process: <br />"
     echo 
"Full Request: ".(isset($_SESSION["ECO_Process_Request"])?htmlentities($_SESSION["ECO_Process_Request"]):"n/a")."<br />"
     echo 
"Full Response: ".(isset($_SESSION["ECO_Process_Result"])?htmlentities($_SESSION["ECO_Process_Result"]):"n/a")."<br /></p>"

     echo 
"<p>Auth Net: <br />"
     echo 
"Full Request: ".(isset($_SESSION['WAAuthNet_postedValues'])?htmlentities($_SESSION['WAAuthNet_postedValues']):"n/a")."<br />"
     echo 
"Full Response: ".(isset($_SESSION['WAAuthNet'])?htmlentities($_SESSION['WAAuthNet']):"n/a")."<br /></p>"

     echo 
"<p>Express Authorize: <br />"
     echo 
"Full Request: ".(isset($_SESSION["ECO_Auth_Request"])?htmlentities($_SESSION["ECO_Auth_Request"]):"n/a")."<br />"
     echo 
"Full Response: ".(isset($_SESSION["ECO_Auth_Result"])?htmlentities($_SESSION["ECO_Auth_Result"]):"n/a")."<br /></p>"
     echo 
"<p>Express Process: <br />"
     echo 
"Full Request: ".(isset($_SESSION["ECO_Process_Request"])?htmlentities($_SESSION["ECO_Process_Request"]):"n/a")."<br />"
     echo 
"Full Response: ".(isset($_SESSION["ECO_Process_Result"])?htmlentities($_SESSION["ECO_Process_Result"]):"n/a")."<br /></p>"
 
     echo 
"<p>UPS: <br />"
     echo 
"Full Request: ".(isset($_SESSION["WA_Store_Cart_UPS_FullRequest"])?htmlentities($_SESSION["WA_Store_Cart_UPS_FullRequest"]):"n/a")."<br />";  
     echo 
"Full Response: ".(isset($_SESSION["WA_Store_Cart_UPS_FullResponse"])?htmlentities($_SESSION["WA_Store_Cart_UPS_FullResponse"]):"n/a")."<br /></p>";  

     echo 
"<p>FedEX: <br />"
     echo 
"Full Request: ".(isset($_SESSION["WA_Store_Cart_FedEx_FullRequest"])?htmlentities($_SESSION["WA_Store_Cart_FedEx_FullRequest"]):"n/a")."<br />";  
     echo 
"Full Response: ".(isset($_SESSION["WA_Store_Cart_FedEx_FullResponse"])?htmlentities($_SESSION["WA_Store_Cart_FedEx_FullResponse"]):"n/a")."<br /></p>";  
 
     echo 
"<p>USPS: <br />"
     echo 
"Full Request: ".(isset($_SESSION["WA_Store_Cart_USPS_FullRequest"])?htmlentities($_SESSION["WA_Store_Cart_USPS_FullRequest"]):"n/a")."<br />";  
     echo 
"Full Response: ".(isset($_SESSION["WA_Store_Cart_USPS_FullResponse"])?htmlentities($_SESSION["WA_Store_Cart_USPS_FullResponse"]):"n/a")."<br /></p>";  
 
?>
Sign in to reply to this post

CraigRBeta Tester

having trouble debugging this

with the debugging code, the failure page pp_checkout_failure.php gives me lots of

Full Request: n/a
Full Response: n/a...

for all methods of payment.


followed by transaction not completed.

what i want to do is just reload the checkout page

Sign in to reply to this post

Jason ByrnesWebAssist

can you send a copy of the checkout page?

This may help me see whats going wrong.

Sign in to reply to this post

CraigRBeta Tester

checkout page should be pretty much as standard, with some new code setting session variables around 197-240, and new code and form starting around line 683

Sign in to reply to this post

Jason ByrnesWebAssist

Ok, I see whats going wrong.

this code for express checkout uses the currant page submit trigger:

php:
<?php
$WA_PP_ECO_SetResult 
WA_PP_ECO_SOAPObject();
if (isset(
$_GET['ExpressCheckout']) || ($_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_Set_params = array();
  
$WA_PP_ECO_Set_params[0] = array();
  
$WA_PP_ECO_Set_params[1] = array();
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "Username";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "".$WAGLOBAL_Paypal_User  ."";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "Password";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "".$WAGLOBAL_Paypal_Password  ."";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "Signature";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "".$WAGLOBAL_Paypal_Signature  ."";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "System";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "US";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "Currency";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "USD";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "OrderTotal";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "".$WA_Store_Cart->GrandTotal()  ."";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "ReturnURL";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "".$WAGLOBAL_Root_URL  ."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] = "".$WAGLOBAL_Root_URL  ."pp_cancel.php";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "PaymentAction";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "Authorization";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "UseSandbox";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "".($WAGLOBAL_Paypal_Sandbox == 1)?"true":"false"  ."";

  
$WA_PP_ECO_SetResult WA_PP_ECO_Set_Post($WA_PP_ECO_Set_params);
  if (
$WA_PP_ECO_SetResult->isError) {
    if (
"pp_checkout_failure.php" != "") {
      
header("Location: ""pp_checkout_failure.php"); exit;
    }
  }
  else {
    
$WA_Store_Cart->redirStr $WA_PP_ECO_SetResult->ECOServer;
  }
}
?>




it's being executed when you set your shipping. change that to:

php:
<?php if((!isset($_POST['grpshipping'])) || $_POST['grpshipping'] == "") { ?>
<?php
$WA_PP_ECO_SetResult 
WA_PP_ECO_SOAPObject();
if (isset(
$_GET['ExpressCheckout']) || ($_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_Set_params = array();
  
$WA_PP_ECO_Set_params[0] = array();
  
$WA_PP_ECO_Set_params[1] = array();
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "Username";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "".$WAGLOBAL_Paypal_User  ."";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "Password";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "".$WAGLOBAL_Paypal_Password  ."";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "Signature";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "".$WAGLOBAL_Paypal_Signature  ."";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "System";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "US";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "Currency";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "USD";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "OrderTotal";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "".$WA_Store_Cart->GrandTotal()  ."";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "ReturnURL";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "".$WAGLOBAL_Root_URL  ."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] = "".$WAGLOBAL_Root_URL  ."pp_cancel.php";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "PaymentAction";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "Authorization";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "UseSandbox";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "".($WAGLOBAL_Paypal_Sandbox == 1)?"true":"false"  ."";

  
$WA_PP_ECO_SetResult WA_PP_ECO_Set_Post($WA_PP_ECO_Set_params);
  if (
$WA_PP_ECO_SetResult->isError) {
    if (
"pp_checkout_failure.php" != "") {
      
header("Location: ""pp_checkout_failure.php"); exit;
    }
  }
  else {
    
$WA_Store_Cart->redirStr $WA_PP_ECO_SetResult->ECOServer;
  }
}
?>
<?php 
?>




so it will only execute if the shipping radio button is not set.

Sign in to reply to this post

CraigRBeta Tester

thanks Jason, that seems to have done the trick.

:-)

Sign in to reply to this post

Jason ByrnesWebAssist

excellent, glad to hear it is working.

Sign in to reply to this post

CraigRBeta Tester

checkout_failure.php?shipping=fail

i am currently setting up some new shipping rules in eCart for PS3.

In this process, i have set the 3 default Shipping rules to 'Inactive' and created 2 new ones.

Basically, all is well, unless i add 2 heavy items to the cart.
I have pasted the code into my failure page, as outlined in an earlier response, and found the problem is when the cart weight exceeds 150 lbs.(UPS)

i am trying to identify where UPS is identified as the carrier, as it isn't mentioned in my shipping rules

Sign in to reply to this post

Jason ByrnesWebAssist

You choose the carrier to use in the store admin panel.

This sets the service to perform the shipping rate look-up. the Lookup is performed outside of the cart rules.

After the lookup is performed, the quote is stored in a session. the shipping rules are just set to check if the lookup session exists.


In the store admin, you can set the shipping to None to prevent the lookup code from executing.

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