Skip to content

Commit

Permalink
Fix logging stripe one time charge transactions
Browse files Browse the repository at this point in the history
Stripe's API probably changed sometime ago.
  • Loading branch information
amCap1712 committed Jul 15, 2024
1 parent 71c690d commit 224cdd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions metabrainz/model/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ def log_subscription_charge(cls, invoice):
def log_one_time_charge(cls, session):
""" Log successful Stripe charge for one time payment/donation """
payment_intent = stripe.PaymentIntent.retrieve(session["payment_intent"],
expand=["charges.data.balance_transaction"])
charge = payment_intent["charges"]["data"][0]
expand=["latest_charge.balance_transaction"])
charge = payment_intent["latest_charge"]
metadata = payment_intent["metadata"]
return cls._log_stripe_charge(charge, metadata)

Expand Down

0 comments on commit 224cdd4

Please sign in to comment.