News:

Support the VirtueMart project and become a member

Main Menu

PayPal double shipping issue?

Started by joerinehart, October 09, 2008, 16:16:52 PM

Previous topic - Next topic

joerinehart

We are using VirtueMart 1.0.15 stable on Joomla! 1.0.15 Stable and Paypal.

Everything works fine, but it seems we are experiencing double shipping charges peridocially on orders.

Some info I received from our client include:
Subject: **PayPal IPN Error: Order Total/Currency Check failed
*During a paypal transaction on your site the received amount didn't match the order total.
The amount received was: 93.34 USD.
It should be: 82.52 USD.

The extra Payment Extra Info includes:

<?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)+$db->f("order_shipping"),
"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.'" />';
}

echo '</form>';

}
?>

Any clues how to resolve this?

joao

hi,

if you:
- use cupons discounts and
- present on the store prices with vat and
- discounts are calculated after vat

then you have a problem with this code, it calculates wrong the amont sent to paypal..

try this change on the configuration tab of paypal module:

- coment this // "amount" => round( $db->f("order_subtotal")+$tax_total-$discount_total, 2),

-replace by: "amount" => round( $db->f("order_total")-sprintf("%.2f", $db->f("order_shipping")), 2),

but if you:

if you:
- use cupons discounts and
- present on the store prices with NO vat and
- discounts are calculated PRIOR to vat
than it should be ok.



joao sarmento