Ensure the number of decimal places of payment fees

This commit is contained in:
Raphael Michel
2015-09-29 15:34:21 +02:00
parent 109e18e891
commit 1f28585dfb

View File

@@ -47,7 +47,7 @@ class BasePaymentProvider:
"""
fee_abs = self.settings.get('_fee_abs', as_type=Decimal, default=0)
fee_percent = self.settings.get('_fee_percent', as_type=Decimal, default=0)
return Decimal(price * fee_percent / 100 + fee_abs)
return (price * fee_percent / 100).quantize('.01') + fee_abs
@property
def verbose_name(self) -> str: