Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.
15 changes: 11 additions & 4 deletions services/billing.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,25 +726,32 @@
return None

try:
default_payment_method = stripe.Customer.retrieve(
owner.stripe_customer_id
).invoice_settings.default_payment_method
customer = stripe.Customer.retrieve(owner.stripe_customer_id)
log.info(f"Retrieved customer: {customer}")
default_payment_method = customer.invoice_settings.default_payment_method
log.info(f"Retrieved default payment method: {default_payment_method}")

log.info(
f"Modifying payment method with billing details: name={name}, address={billing_address}"

Check failure on line 735 in services/billing.py

View check run for this annotation

GitHub Advanced Security / CodeQL

Clear-text logging of sensitive information

This expression logs [sensitive data (private)](1) as clear text.
)
stripe.PaymentMethod.modify(
default_payment_method,
billing_details={"name": name, "address": billing_address},
)

log.info(f"Modifying customer address: {billing_address}")

Check failure on line 742 in services/billing.py

View check run for this annotation

GitHub Advanced Security / CodeQL

Clear-text logging of sensitive information

This expression logs [sensitive data (private)](1) as clear text.
stripe.Customer.modify(owner.stripe_customer_id, address=billing_address)
log.info(
f"Stripe successfully updated billing address for owner {owner.ownerid} by user #{self.requesting_user.ownerid}"
)
except Exception:
except Exception as e:
log.error(
"Unable to update billing address for customer",
extra=dict(
customer_id=owner.stripe_customer_id,
subscription_id=owner.stripe_subscription_id,
error=str(e),
error_type=type(e).__name__,
),
)

Expand Down
Loading