Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions fundraising/management/commands/create_stripe_plans.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def handle(self, **kwargs):
try:
stripe.Plan.retrieve("monthly")
print("Monthly plan exists, not creating!")
except stripe.error.InvalidRequestError:
except stripe.InvalidRequestError:
name = "Monthly donation"
logger.info(f"Creating plan: {name}")
stripe.Plan.create(
Expand All @@ -25,7 +25,7 @@ def handle(self, **kwargs):
try:
stripe.Plan.retrieve("quarterly")
print("Quarterly plan exists, not creating!")
except stripe.error.InvalidRequestError:
except stripe.InvalidRequestError:
name = "Quarterly donation"
logger.info(f"Creating plan: {name}")
stripe.Plan.create(
Expand All @@ -40,7 +40,7 @@ def handle(self, **kwargs):
try:
stripe.Plan.retrieve("yearly")
print("Yearly plan exists, not creating!")
except stripe.error.InvalidRequestError:
except stripe.InvalidRequestError:
name = "Yearly donation"
logger.info(f"Creating plan: {name}")
stripe.Plan.create(
Expand Down
2 changes: 1 addition & 1 deletion fundraising/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def stripe_data(self, filename):
file_path = settings.BASE_DIR.joinpath(f"fundraising/test_data/{filename}.json")
with file_path.open() as f:
data = json.load(f)
return stripe.util.convert_to_stripe_object(data, stripe.api_key, None)
return stripe.convert_to_stripe_object(data, stripe.api_key, None)

def post_event(self, data):
return self.client.post(
Expand Down
4 changes: 2 additions & 2 deletions fundraising/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def update_card(request):
donation.stripe_customer_id,
source=request.POST["stripe_token"],
)
except stripe.error.StripeError as e:
except stripe.StripeError as e:
data = {"success": False, "error": str(e)}
else:
data = {"success": True}
Expand Down Expand Up @@ -195,7 +195,7 @@ def receive_webhook(request):
request.headers["stripe-signature"],
settings.STRIPE_ENDPOINT_SECRET,
)
except (KeyError, ValueError, stripe.error.SignatureVerificationError):
except (KeyError, ValueError, stripe.SignatureVerificationError):
return HttpResponse(status=422)

return WebhookHandler(event).handle()
Expand Down
2 changes: 1 addition & 1 deletion requirements/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ pykismet3==0.1.1
requests==2.32.5
sorl-thumbnail==12.11.0
Sphinx==8.1.3
stripe==12.5.1
stripe==13.0.1
time-machine==2.19.0