diff --git a/payments/models.py b/payments/models.py index 2cbd8206a..c1c88a35e 100644 --- a/payments/models.py +++ b/payments/models.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals import json from uuid import uuid4 +from decimal import Decimal from django.conf import settings from django.core.urlresolvers import reverse @@ -54,10 +55,10 @@ class BasePayment(models.Model): #: Currency code (may be provider-specific) currency = models.CharField(max_length=10) #: Total amount (gross) - total = models.DecimalField(max_digits=9, decimal_places=2, default='0.0') - delivery = models.DecimalField( - max_digits=9, decimal_places=2, default='0.0') - tax = models.DecimalField(max_digits=9, decimal_places=2, default='0.0') + total = models.DecimalField(max_digits=20, decimal_places=8, default=Decimal('0.0')) + delivery = models.DecimalField(max_digits=20, + decimal_places=8, default=Decimal('0.0')) + tax = models.DecimalField(max_digits=20, decimal_places=8, default=Decimal('0.0')) description = models.TextField(blank=True, default='') billing_first_name = models.CharField(max_length=256, blank=True) billing_last_name = models.CharField(max_length=256, blank=True) @@ -73,7 +74,7 @@ class BasePayment(models.Model): message = models.TextField(blank=True, default='') token = models.CharField(max_length=36, blank=True, default='') captured_amount = models.DecimalField( - max_digits=9, decimal_places=2, default='0.0') + max_digits=20, decimal_places=8, default=Decimal('0.0')) class Meta: abstract = True