Skip to content

Commit

Permalink
clarify doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiroUsagi-san committed Oct 13, 2023
1 parent 72bf479 commit fb404d3
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions insalan/payment/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Product(models.Model):


class Transaction(models.Model):
"""A transaction"""
"""A transaction is a record from helloasso intent. A transaction cannot exist alone and should be used only to reflect helloasso payment"""
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
payer = models.ForeignKey(User, null=True, on_delete=models.SET_NULL)
products = models.ManyToManyField(Product) # A transaction can be composed of n products
Expand Down Expand Up @@ -52,13 +52,6 @@ def new(**data):
transaction.synchronize_amount()
return transaction

def synchronize_amount(self):
"""Recompute the amount from the product list"""
self.amount = Decimal(0.00)
for product in self.products.all():
self.amount += product.price
logger.debug(f"{self.amount} and {product.price}")

def validate_transaction(self):
""" set payment_statut to validated """

Expand Down

0 comments on commit fb404d3

Please sign in to comment.