mirror of
https://github.com/lemeow125/DRF_Template.git
synced 2024-11-17 04:09:25 +08:00
Fixed stripe checkouts
This commit is contained in:
parent
99dfcef67b
commit
8d40a33882
1 changed files with 2 additions and 6 deletions
|
@ -67,22 +67,18 @@ class StripeCheckoutView(APIView):
|
|||
}, status=status.HTTP_404_NOT_FOUND)
|
||||
|
||||
# Get the stripe_price_id from the related StripePrice instances
|
||||
PRICE = None
|
||||
PRICE_ID = None
|
||||
|
||||
if annual:
|
||||
PRICE = SUBSCRIPTION.annual_price
|
||||
PRICE_ID = PRICE.stripe_price_id
|
||||
else:
|
||||
PRICE = SUBSCRIPTION.monthly_price
|
||||
PRICE_ID = PRICE.stripe_price_id
|
||||
|
||||
# Return 404 if no price is set
|
||||
if not PRICE or PRICE_ID:
|
||||
if not PRICE:
|
||||
return Response({
|
||||
'error': 'Specified price does not exist for plan'
|
||||
}, status=status.HTTP_404_NOT_FOUND)
|
||||
|
||||
PRICE_ID = PRICE.stripe_price_id
|
||||
prorated = PRICE.prorated
|
||||
|
||||
# Return an error if a user is in a user_group and is availing pro-rated plans
|
||||
|
|
Loading…
Reference in a new issue