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

Commit

Permalink
fix: Rename in StripeWebhooks views
Browse files Browse the repository at this point in the history
  • Loading branch information
julianajlk committed Apr 9, 2024
1 parent 618dcc2 commit f077753
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ecommerce/extensions/api/v2/views/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def post(self, request):
payment_intent = event.data.object
dynamic_payment_methods_options = ['klarna', 'affirm', 'afterpay_clearpay']
if event.type == 'payment_intent.succeeded':
dynamic_payment_methods_type = payment_intent.payment_method_details.type
if dynamic_payment_methods_type in dynamic_payment_methods_options:
payment_methods_type = payment_intent['charges']['data'][0]['payment_method_details']['type']
if payment_methods_type in dynamic_payment_methods_options:
# This is a payment intent for a BNPL payment
logger.info(
'[Stripe webhooks] Dynamic Payment Methods event payment_intent.succeeded '
Expand All @@ -67,7 +67,7 @@ def post(self, request):
payment_intent.id,
)
webhooks_payment = StripeWebhooksPayment(site=None)
webhooks_payment.handle_webhooks_payment(request, payment_intent, dynamic_payment_methods_type)
webhooks_payment.handle_webhooks_payment(request, payment_intent, payment_methods_type)
else:
logger.info(
'[Stripe webhooks] event payment_intent.succeeded with amount %d and payment intent ID [%s].',
Expand Down

0 comments on commit f077753

Please sign in to comment.