News:

Looking for documentation? Take a look on our wiki

Main Menu

getting paypal error after checkout

Started by kimmieme, September 19, 2008, 20:35:36 PM

Previous topic - Next topic

kimmieme

can someone please help me. I am getting a paypal error from all customers. after the checkout is confirmed, they are redirected to paypal with this error....

"sorry- your last action cannot be completed".... and then... "If you were making a purchase or sending money, we recommend that you check both your PayPal account and your email for a transaction confirmation during the next day.

If you came to this page from another website, please return to that site (don't use your browser's Back button) and restart your activity.

If you came from PayPal's website, click the PayPal logo in the upper-left corner to return to our home page and restart your activity. You might have to log in again."

the code in the extra info is...

<?php
$url = "https://www.paypal.com/cgi-bin/webscr";
$tax_total = $db->f("order_tax") + $db->f("order_shipping_tax");
$discount_total = $db->f("coupon_discount") + $db->f("order_discount");
$post_variables = Array(
   "cmd" => "_xclick",
   "business" => PAYPAL_EMAIL,
   "receiver_email" => PAYPAL_EMAIL,
   "item_name" => $VM_LANG->_PHPSHOP_ORDER_PRINT_PO_NUMBER.": ". $db->f("order_id"),
   "order_id" => $db->f("order_id"),
   "invoice" => $db->f("order_number"),
   "amount" => round( $db->f("order_subtotal")+$tax_total-$discount_total, 2),
   "shipping" => sprintf("%.2f", $db->f("order_shipping")),
   "currency_code" => $_SESSION['vendor_currency'],
   "first_name" => $dbbt->f('first_name'),
   "last_name" => $dbbt->f('last_name'),
   "address_street" => $dbbt->f('address_1'),
   "address_zip" => $dbbt->f('zip'),
   "address_city" => $dbbt->f('city'),
   "address_state" => $dbbt->f('state'),
   "address_country" => $dbbt->f('country'),
   "image_url" => $vendor_image_url,
   "return" => SECUREURL ."index.php?option=com_virtuemart&page=checkout.result&order_id=".$db->f("order_id"),
   "notify_url" => SECUREURL ."administrator/components/com_virtuemart/notify.php",
   "cancel_return" => SECUREURL ."index.php",
   "undefined_quantity" => "0",
   "test_ipn" => PAYPAL_DEBUG,
   "pal" => "NRUBJXESJTY24",
   "no_shipping" => "1",
   "no_note" => "1"
);
if( $page == "checkout.thankyou" ) {
   $query_string = "?";
   foreach( $post_variables as $name => $value ) {
      $query_string .= $name. "=" . urlencode($value) ."&";
   }
   mosRedirect( $url . $query_string );
} else {

   echo '<form action="'.$url.'" method="post" target="_blank">';
   echo '<input type="image" name="submit" src="http://images.paypal.com/images/x-click-but6.gif" border="0" alt="Make payments with PayPal, it is fast, free, and secure!" />';

   foreach( $post_variables as $name => $value ) {
      echo '<input type="hidden" name="'.$name.'" value="'.$value."\" />\n";
   }

   echo '</form>';

}
?>


is there something wrong with this configuration?

kimmieme

it worked for awhile and one day stopped... any ideas?


joao

are you using cupons?
thereĀ“s a bug on the total amount this code calculates if you used copuns and you are presenting total price and aply discount after tax.

joao sarmento