1

This question already has an answer here:

Have to fix this bug: magento works properly with prices and vat and coupon also, but when you place and order, using a coupon, and choose to pay with paypal it collects a wrong amount. usually less. Looks like if paypal re-calculate the goods price, the vat, and applies the coupon by itself not just taking from magento the grand total --it is not strange, what I cannot fix is that the two grand total are DIFFERENT. the mangetos is correct the paypal's is wrong (lower). As a result I have a suspected fraud, cause the amount collected is less than the magento's grand total. WHERE should I look to fix it ? THANK YOU

marked as duplicate by Fabian Blechschmidt, Marius, MTM, Keyul Shah, David Manners Aug 21 '14 at 12:10

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

Inspired from: http://www.magentocommerce.com/boards/viewthread/222075/P60/

In Mage_Sales_Model_Order_Payment::_isCaptureFinal()

Commented the line and added a precision fix. In your case the precision would be greater or just use an arbitrary number without opening a door to bad validation/vulnerability.

//if ($orderGrandTotal == $this->_formatAmount($this->getBaseAmountPaid(), true) + $amountToCapture) {
if (abs($orderGrandTotal - ($this->_formatAmount($this->getBaseAmountPaid(), true) + $amountToCapture)) <= 0.1 ) {

They are doing something with the forum right now. I'd suggest to read the topic quickly if it is of any help :)

If this is also a precision issue of total calculation you can try to modify: Mage_Core_Model_Store::roundPrice()

// return round($price, 2); to
return round($price, 4);

and test everything regarding totals.

Not the answer you're looking for? Browse other questions tagged or ask your own question.