XF 1.5 PayPal tax invalid amount

Marks534

Member
Hi,

To follow the EU relegations regarding taxes, some people within EU are required to pay VAT depending on their country. This is fairly easily as PayPal allows you to set a VAT amount for each country individually. However Xenforo seems to be having issues with this. Whenever someone buys and upgrade with VAT paid, Xenforo notices it's not the expected amount and rejects the upgrade.

Example, user from UK buys $10 account upgrade. They check out, paypal adds 20% tax. The amount is $12 now. XenForo expects $10 and won't process the upgrade for this reason.

Any way of quickly fixing this?
 
I can't really think of a quick fix for this, short of modifying the way the payment amount check happens in library/XenForo/UserUpgradeProcessor/PayPal.php. Look for $paymentAmountPassed. I suppose the simplest hack would be to check if the amount paid (mc_gross) is >= than what was expected (rather than ==).
 
I can't really think of a quick fix for this, short of modifying the way the payment amount check happens in library/XenForo/UserUpgradeProcessor/PayPal.php. Look for $paymentAmountPassed. I suppose the simplest hack would be to check if the amount paid (mc_gross) is >= than what was expected (rather than ==).
Can you get me the exact code I need to replace? I'm not really the strongest when it comes to development.
 
I can't really think of a quick fix for this, short of modifying the way the payment amount check happens in library/XenForo/UserUpgradeProcessor/PayPal.php. Look for $paymentAmountPassed. I suppose the simplest hack would be to check if the amount paid (mc_gross) is >= than what was expected (rather than ==).
Code:
                    $paymentAmountPassed = $paymentAmountPassed || (
                        round($this->_filtered['mc_gross'], 2) >= round($cost, 2)
                        && strtolower($this->_filtered['mc_currency']) == $currency
                    );

Like that?
 
Code:
                    $paymentAmountPassed = $paymentAmountPassed || (
                        round($this->_filtered['mc_gross'], 2) >= round($cost, 2)
                        && strtolower($this->_filtered['mc_currency']) == $currency
                    );

Like that?
Yes, that should work for now.

We have, however, identified a workaround which we have implemented for the next XF release.
 
Top Bottom