Skip to content

Commit

Permalink
Update free tier usage amount to 3 from 5 and refactor minor things
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshinishio committed Nov 4, 2024
1 parent f75ffc0 commit cad640a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def get_env_var(name: str) -> str:
ENV: str = get_env_var(name="ENV")
IS_PRD: bool = ENV == "prod"
# Update here too: https://dashboard.stripe.com/test/products/prod_PokLGIxiVUwCi6
FREE_TIER_REQUEST_AMOUNT = 5
FREE_TIER_REQUEST_AMOUNT = 3
ISSUE_NUMBER_FORMAT = "/issue-" # DO NOT USE "#" as it is a special character and has to be encoded in URL, like in GitHub API URL
MAX_RETRIES = 3
PER_PAGE = 100
Expand Down
2 changes: 1 addition & 1 deletion services/stripe/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get_subscription(customer_id: str) -> stripe.ListObject[stripe.Subscription]


@handle_exceptions(default_return_value=FREE_TIER_REQUEST_AMOUNT, raise_on_error=False)
def get_request_count_from_product_id_metadata(product_id: str) -> int:
def get_request_count_from_product_id_metadata(product_id: str):
"""
https://docs.stripe.com/api/products/retrieve?lang=python
https://dashboard.stripe.com/test/products/prod_PqZFpCs1Jq6X4E
Expand Down
4 changes: 1 addition & 3 deletions services/supabase/users_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,7 @@ def get_how_many_requests_left_and_cycle(

stripe_customer_id: str = data[1][0]["owners"]["stripe_customer_id"]

subscription = get_subscription(
customer_id=stripe_customer_id,
)
subscription = get_subscription(customer_id=stripe_customer_id)

start_date_seconds, end_date_seconds, product_id = (
self.parse_subscription_object(
Expand Down

0 comments on commit cad640a

Please sign in to comment.