Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Tiered Pricing Plans #629

Open
wants to merge 14 commits into
base: original
Choose a base branch
from
Prev Previous commit
Next Next commit
Handle null Amounts in convert_amount_for_db
  • Loading branch information
jksimoniii committed Feb 1, 2019
commit 766ed1e8d07619eac9d4db2ab3d0d49a3d3c5762
2 changes: 2 additions & 0 deletions pinax/stripe/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def convert_tstamp(response, field_name=None):
def convert_amount_for_db(amount, currency="usd"):
if currency is None: # @@@ not sure if this is right; find out what we should do when API returns null for currency
currency = "usd"
if amount is None: # @@@ not sure if this is right; find out what we should do when API returns null for amount
amount = 0
return (amount / decimal.Decimal("100")) if currency.lower() not in ZERO_DECIMAL_CURRENCIES else decimal.Decimal(amount)


Expand Down