Skip to content
Browse files

[FIX] payment: Wrong extra fees with payment acquier

Steps to reproduce the bug:

- Install Sales
- Configure Paypal payment acquier
- Add extra fees such as 10€ of domestic fee
- Create a customer C with an email E and with no country
- Create a quotation Q of 100€ for C and send it by email to C
- Go in the email box of E and click on the link
- Click on 'Sign and Pay' button
- Sign Q and click on 'Pay'
- Choose Paypal as payment acquier
- Process the payment with Paypal


An error log was displayed saying:

Paypal incorrect data:
mc_gross received 100 instead of 110

PS: the domestic fee was not counted because the partner_country_id
was not set in function render defined in model payment.acquirer

Inspired from function create defined in model payment.transaction
(addons/payment/models/ +961) where the domestic fee
is counted.


closes #43197

Signed-off-by: Simon Goffin (sig) <>
  • Loading branch information
simongoffin committed Jan 13, 2020
1 parent 3316fd4 commit 581020c733044b52cacd0d41a6a8eb8708671d0d
Showing with 2 additions and 2 deletions.
  1. +1 −1 addons/payment/models/
  2. +1 −1 addons/payment_paypal/models/
@@ -402,7 +402,7 @@ def render(self, reference, amount, currency_id, partner_id=False, values=None):
'partner_address': _partner_format_address(partner.street, partner.street2),
'partner_country_id': or self.env['']._company_default_get(),
'partner_country': partner.country_id,
'partner_state': partner.state_id,
@@ -165,7 +165,7 @@ def _paypal_form_get_invalid_parameters(self, data):
invalid_parameters.append(('txn_id', data.get('txn_id'), self.acquirer_reference))
# check what is buyed
if float_compare(float(data.get('mc_gross', '0.0')), (self.amount + self.fees), 2) != 0:
invalid_parameters.append(('mc_gross', data.get('mc_gross'), '%.2f' % self.amount)) # mc_gross is amount + fees
invalid_parameters.append(('mc_gross', data.get('mc_gross'), '%.2f' % self.amount + self.fees)) # mc_gross is amount + fees
if data.get('mc_currency') !=
invalid_parameters.append(('mc_currency', data.get('mc_currency'),
if 'handling_amount' in data and float_compare(float(data.get('handling_amount')), self.fees, 2) != 0:

0 comments on commit 581020c

Please sign in to comment.
You can’t perform that action at this time.