At the risk of saying "me, too!", but wanting to make as many comments with an answer I think is correct, I will agree with what is said below. Looking at the logs in detail shows that the AMT was being set correctly for orders over $1,000, but then was not being sent correctly to DoExpressCheckoutPayment (there the AMT was set to 1.0, which caused the 10413 error of totals not matching). Changing the code like below worked for me. I took a quicker, dirtier route since according to the PayPal documentation the comma separator is optional, I just removed the number_format alltogether from the DoExpressCheckoutPayment parameters.
Line 535 of paypalwpp.php:
$response = $doPayPal->DoExpressCheckoutPayment($_SESSION['paypal_ec_token'],
$_SESSION['paypal_ec_payer_id'],
(isset($options['AMT']) ? $options['AMT'] : $order_amount),
$options);
Good luck,
Todd
packet8bit:
I believe the problem lies in this line in the file:
/includes/modules/payment/paypalwpp.php
$response = $doPayPal->DoExpressCheckoutPayment($_SESSION['paypal_ec_token'],
$_SESSION['paypal_ec_payer_id'],
number_format((isset($options['AMT']) ? $options['AMT'] : $order_amount), 2),
$options);
The value of $options['AMT'] may already contain a formatted string such as 1,050.99. In the line above, it is formatted again by the number_format function which may now result to a truncated value of 1. This causes a mismatch now with the original value which should still be 1050.99. This may not affect values less than 1000.
To fix, I changed the above code to:
if (isset($options['AMT']))
{
$response = $doPayPal->DoExpressCheckoutPayment($_SESSION['paypal_ec_token'],
$_SESSION['paypal_ec_payer_id'],
$options['AMT'],
$options);
}
else
{
$response = $doPayPal->DoExpressCheckoutPayment($_SESSION['paypal_ec_token'],
$_SESSION['paypal_ec_payer_id'],
number_format($order_amount, 2),
$options);
}
Hope that helps!
packet8bit
:cool: