From 31b9676a2bf0de94a5cdc4fcf74a7f60e7eff7e3 Mon Sep 17 00:00:00 2001 From: feliixx Date: Fri, 17 Jan 2025 15:25:48 +0100 Subject: [PATCH] Invoice: Add `customer_email` in invoice object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [Stripe documentation on invoices] describes this field like this: > customer_email - nullable string > > The customer’s email. Until the invoice is finalized, this field will equal > customer.email. Once the invoice is finalized, this field will no longer be > updated. So it's the field to use to know where the invoice was effectively sent if it was sent by email after being finalized. The current commit add the field to the invoice object, but it's always set to the current customer email to keep the implementation simple. [Stripe documentation on invoices]: https://docs.stripe.com/api/invoices/object#invoice_object-customer_email --- localstripe/resources.py | 1 + 1 file changed, 1 insertion(+) diff --git a/localstripe/resources.py b/localstripe/resources.py index 0b12960..5cd1b48 100644 --- a/localstripe/resources.py +++ b/localstripe/resources.py @@ -1208,6 +1208,7 @@ def __init__(self, customer=None, subscription=None, metadata=None, super().__init__() self.customer = customer + self.customer_email = cus.email self.subscription = subscription self.tax_percent = tax_percent self.default_tax_rates = default_tax_rates