Skip to content

Commit

Permalink
Merge pull request #235 from jazzband/purchaseditem_taxrate
Browse files Browse the repository at this point in the history
Add tax_rate to PurchasedItem
  • Loading branch information
Hugo Barrera authored Oct 11, 2020
2 parents b50bb9c + ebe38b0 commit 8c7cf42
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions payments/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from collections import namedtuple
from decimal import Decimal
from typing import NamedTuple
from typing import Optional

from django.apps import apps
from django.conf import settings
Expand All @@ -9,8 +11,16 @@

__version__ = version.version

PurchasedItem = namedtuple('PurchasedItem',
'name, quantity, price, currency, sku')

class PurchasedItem(NamedTuple):
"""A single item in a purchase."""

name: str
quantity: int
price: Decimal
currency: str
sku: str
tax_rate: Optional[Decimal] = None


class PaymentStatus:
Expand Down

0 comments on commit 8c7cf42

Please sign in to comment.