close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

eCart now directing to PayPal Sandbox

Thread began 1/07/2011 9:52 am by adam106173 | Last modified 1/10/2011 9:01 am by Jason Byrnes | 1552 views | 5 replies |

adam106173

eCart now directing to PayPal Sandbox

Hello, this site has been working fine for years now, and suddenly it goes from the checkout page to the following link: webscr?cmd=_express-checkout&token=

PayPayl says the problem lies with the confirm.php. I see where there are a couple of areas about Sandbox, but I never changed anything. I did try changing the values of the two ares that mention sandbox to every combination and this did not seem to solve my problems.

I've attached my confirm page with the password stuff replaced with "REMOVED"

Here is the site URL: www.calmerparenting.com

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

Jason ByrnesWebAssist

this page has 2 code blocks to process the transaction through paypal, it should only have 1, you can probably delete the code from lines 201 - 352:

php:
<?php

if ($_SERVER["REQUEST_METHOD"] == "POST")  {
  
$PP_DirectPayment_required = array();
  
$PP_DirectPayment_required[0] = array();
  
$PP_DirectPayment_required[1] = array();
  
$PP_DirectPayment_itemized = array();
  
$PP_DirectPayment_itemized[0] = array();
  
$PP_DirectPayment_itemized[1] = array();
  
$PP_DirectPayment_optional = array();
  
$PP_DirectPayment_optional[0] = array();
  
$PP_DirectPayment_optional[1] = array();
  
$cartIndex 0;
  
$nextIndex 0;
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "Username";
  
$PP_DirectPayment_required[1][$nextIndex] = "REMOVED";
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "Password";
  
$PP_DirectPayment_required[1][$nextIndex] = "REMOVED";
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "Signature";
  
$PP_DirectPayment_required[1][$nextIndex] = "REMOVED";
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "PaymentAction";
  
$PP_DirectPayment_required[1][$nextIndex] = "Sale";
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "Currency";
  
$PP_DirectPayment_required[1][$nextIndex] = "USD";
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "IPAddress";
  
$PP_DirectPayment_required[1][$nextIndex] = "".$_SERVER["REMOTE_ADDR"]  ."";
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "CreditCardType";
  
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["cc_type"]))?$_POST["cc_type"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "CreditCardNumber";
  
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["cc_number"]))?$_POST["cc_number"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "ExpMonth";
  
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["exp_month"]))?$_POST["exp_month"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "ExpYear";
  
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["exp_year"]))?$_POST["exp_year"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "FirstName";
  
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["firstname"]))?$_POST["firstname"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "LastName";
  
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["lastname"]))?$_POST["lastname"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "Street1";
  
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["street1"]))?$_POST["street1"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "CityName";
  
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["city"]))?$_POST["city"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "StateOrProvince";
  
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["state_province"]))?$_POST["state_province"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "PostalCode";
  
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["postcode"]))?$_POST["postcode"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "Country";
  
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["country"]))?$_POST["country"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_required[0]);
  
$PP_DirectPayment_required[0][$nextIndex] = "UseSandbox";
  
$PP_DirectPayment_required[1][$nextIndex] = "true";

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

    
$cehp->MoveNext();
    
$cartIndex ++;
  }
  
$cehp->MoveFirst();
  
$nextIndex count($PP_DirectPayment_optional[0]);
  
$PP_DirectPayment_optional[0][$nextIndex] = "MerchantSessionID";
  
$PP_DirectPayment_optional[1][$nextIndex] = "".session_id()  ."";
  
$nextIndex count($PP_DirectPayment_optional[0]);
  
$PP_DirectPayment_optional[0][$nextIndex] = "Payer";
  
$PP_DirectPayment_optional[1][$nextIndex] = "".((isset($_POST["email"]))?$_POST["email"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_optional[0]);
  
$PP_DirectPayment_optional[0][$nextIndex] = "Street2";
  
$PP_DirectPayment_optional[1][$nextIndex] = "".((isset($_POST["street2"]))?$_POST["street2"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_optional[0]);
  
$PP_DirectPayment_optional[0][$nextIndex] = "Phone";
  
$PP_DirectPayment_optional[1][$nextIndex] = "".((isset($_POST["phone"]))?$_POST["phone"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_optional[0]);
  
$PP_DirectPayment_optional[0][$nextIndex] = "CVV2";
  
$PP_DirectPayment_optional[1][$nextIndex] = "".((isset($_POST["cvv"]))?$_POST["cvv"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_optional[0]);
  
$PP_DirectPayment_optional[0][$nextIndex] = "ItemTotal";
  
$PP_DirectPayment_optional[1][$nextIndex] = "".$cehp->TotalColumn("TotalPrice")  ."";
  
$nextIndex count($PP_DirectPayment_optional[0]);
  
$PP_DirectPayment_optional[0][$nextIndex] = "ShippingTotal";
  
$PP_DirectPayment_optional[1][$nextIndex] = "".$cehp->GetShipping()  ."";
  
$nextIndex count($PP_DirectPayment_optional[0]);
  
$PP_DirectPayment_optional[0][$nextIndex] = "HandlingTotal";
  
$PP_DirectPayment_optional[1][$nextIndex] = "".$cehp->GetCharges() - $cehp->GetDiscounts()  ."";
  
$nextIndex count($PP_DirectPayment_optional[0]);
  
$PP_DirectPayment_optional[0][$nextIndex] = "TaxTotal";
  
$PP_DirectPayment_optional[1][$nextIndex] = "".$cehp->GetTax()  ."";
  
$nextIndex count($PP_DirectPayment_optional[0]);
  
$PP_DirectPayment_optional[0][$nextIndex] = "SH_Name";
  
$PP_DirectPayment_optional[1][$nextIndex] = "".((isset($_POST["shipping_firstname"]))?$_POST["shipping_firstname"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_optional[0]);
  
$PP_DirectPayment_optional[0][$nextIndex] = "SH_Street1";
  
$PP_DirectPayment_optional[1][$nextIndex] = "".((isset($_POST["shipping_street1"]))?$_POST["shipping_street1"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_optional[0]);
  
$PP_DirectPayment_optional[0][$nextIndex] = "SH_Street2";
  
$PP_DirectPayment_optional[1][$nextIndex] = "".((isset($_POST["shipping_street2"]))?$_POST["shipping_street2"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_optional[0]);
  
$PP_DirectPayment_optional[0][$nextIndex] = "SH_CityName";
  
$PP_DirectPayment_optional[1][$nextIndex] = "".((isset($_POST["shipping_city"]))?$_POST["shipping_city"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_optional[0]);
  
$PP_DirectPayment_optional[0][$nextIndex] = "SH_StateOrProvince";
  
$PP_DirectPayment_optional[1][$nextIndex] = "".((isset($_POST["shipping_state_province"]))?$_POST["shipping_state_province"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_optional[0]);
  
$PP_DirectPayment_optional[0][$nextIndex] = "SH_PostalCode";
  
$PP_DirectPayment_optional[1][$nextIndex] = "".((isset($_POST["shipping_postcode"]))?$_POST["shipping_postcode"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_optional[0]);
  
$PP_DirectPayment_optional[0][$nextIndex] = "SH_Country";
  
$PP_DirectPayment_optional[1][$nextIndex] = "".((isset($_POST["shipping_country"]))?$_POST["shipping_country"]:"")  ."";
  
$nextIndex count($PP_DirectPayment_optional[0]);
  
$PP_DirectPayment_optional[0][$nextIndex] = "SH_Phone";
  
$PP_DirectPayment_optional[1][$nextIndex] = "".((isset($_POST["shipping_phone"]))?$_POST["shipping_phone"]:"")  ."";

  
$WAGatewayResponse PP_DirectPayment_Post($PP_DirectPayment_required,$PP_DirectPayment_itemized,$PP_DirectPayment_optional);
  if (
$WAGatewayResponse)  {
    
$cehp->redirStr "";
  }
  else if (
"" != "") {
    
header("Location: """);
    exit();
  }
}
?>
Sign in to reply to this post

adam106173

I removed that redundant block of code, but am getting the same issues. I also just learned that each time the page is redirected from confirm to paypal, the order actually goes through. Can you look at the file again and see if you see anything else? On line 422 there is a reference to sandbox, but changing that still doesn't help. I see in the address bar that the confirm page first starts to come in, then it's redirected.

Thanks,

Adam

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

Jason ByrnesWebAssist

this code at line 387 - 434 is used for express checkout, it should not be on the confimr page:

php:
<?php

$WA_PP_ECO_SetResult 
WA_PP_ECO_SOAPObject();
if (
$_SERVER["REQUEST_METHOD"] == "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] = "REMOVED";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "Password";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "REMOVED";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "Signature";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "REMOVED";
  
$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] = "".$cehp->GrandTotal()  ."";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "ReturnURL";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "http://www.calmerparenting.com/checkout_success.php";
  
$nextIndex count($WA_PP_ECO_Set_params[0]);
  
$WA_PP_ECO_Set_params[0][$nextIndex] = "CancelURL";
  
$WA_PP_ECO_Set_params[1][$nextIndex] = "http://www.calmerparenting.com/checkout_failure.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] = "true";

  
$WA_PP_ECO_SetResult WA_PP_ECO_Set_Post($WA_PP_ECO_Set_params);
  if (
$WA_PP_ECO_SetResult->isError) {
    if (
"" != "") {
      
header("Location: """); exit;
    }
  }
  else {
    
$cehp->redirStr $WA_PP_ECO_SetResult->ECOServer;
  }
}
?>
Sign in to reply to this post

adam106173

That seems to have fixed the problem. Now how did all that extra code get there? I certainly didn't put it there.

Sign in to reply to this post

Jason ByrnesWebAssist

Ok, glad to hear it is working.


I cannot say how the code into the page.

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