Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 0df1087

Browse files
committed
trying to log more stuff to debug an error
1 parent f2f7812 commit 0df1087

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

services/billing.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -726,25 +726,31 @@ def update_billing_address(self, owner: Owner, name, billing_address):
726726
return None
727727

728728
try:
729-
default_payment_method = stripe.Customer.retrieve(
730-
owner.stripe_customer_id
731-
).invoice_settings.default_payment_method
729+
log.info(f"Retrieving customer with ID {owner.stripe_customer_id}")
730+
customer = stripe.Customer.retrieve(owner.stripe_customer_id)
731+
log.info(f"Retrieved customer: {customer}")
732+
default_payment_method = customer.invoice_settings.default_payment_method
733+
log.info(f"Retrieved default payment method: {default_payment_method}")
732734

735+
log.info(f"Modifying payment method with billing details: name={name}, address={billing_address}")
733736
stripe.PaymentMethod.modify(
734737
default_payment_method,
735738
billing_details={"name": name, "address": billing_address},
736739
)
737740

741+
log.info(f"Modifying customer address: {billing_address}")
738742
stripe.Customer.modify(owner.stripe_customer_id, address=billing_address)
739743
log.info(
740744
f"Stripe successfully updated billing address for owner {owner.ownerid} by user #{self.requesting_user.ownerid}"
741745
)
742-
except Exception:
746+
except Exception as e:
743747
log.error(
744748
"Unable to update billing address for customer",
745749
extra=dict(
746750
customer_id=owner.stripe_customer_id,
747751
subscription_id=owner.stripe_subscription_id,
752+
error=str(e),
753+
error_type=type(e).__name__,
748754
),
749755
)
750756

0 commit comments

Comments
 (0)