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
Browse files Browse the repository at this point in the history
  • Loading branch information
julianajlk committed Apr 11, 2024
1 parent 2b16bd4 commit c2cd4e5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ecommerce/extensions/api/v2/views/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ def post(self, request):
payment_intent = event.data.object
dynamic_payment_methods_options = ['klarna', 'affirm', 'afterpay_clearpay']
if event.type == 'payment_intent.succeeded':
payment_method_type = (payment_intent['charges']['data'][0]['payment_method_details']['type']
if payment_intent['charges']['data'] else None)
payment_method_type = (
payment_intent['charges']['data'][0]['payment_method_details']['type']
if payment_intent['charges']['data'] else None
)
# charge = payment_intent.charge.data.pop()
# payment_method_type = charge.payment_method_details.type
if payment_method_type in dynamic_payment_methods_options:
Expand Down

0 comments on commit c2cd4e5

Please sign in to comment.