Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
fix: WIP views using handle_stripe_payment returning temp url
Browse files Browse the repository at this point in the history
  • Loading branch information
julianajlk committed Mar 2, 2023
1 parent b32b4c8 commit 4bcdac1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ecommerce/extensions/payment/views/stripe.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,17 @@ def post(self, request):
try:
with transaction.atomic():
try:
self.handle_payment(stripe_response, basket)
self.handle_stripe_payment(stripe_response, basket)
except CardError as err:
return self.stripe_error_response(err)
except: # pylint: disable=bare-except
logger.exception('Attempts to handle payment for basket [%d] failed.', basket.id)
return self.error_page_response()

# JK need a response, temp
return JsonResponse({}, status=200)
# JK: need a response, temp to Payment MFE but need a loading URL
return JsonResponse({
'payment_mfe_loading_url': self.request.site.siteconfiguration.payment_microfrontend_url,
}, status=201)

def error_page_response(self):
"""Tell the frontend to redirect to a generic error page."""
Expand Down

0 comments on commit 4bcdac1

Please sign in to comment.