stripe-node
stripe-node copied to clipboard
Allow for deleting customer's email address in type defintions
You can delete a customer's email address via stripe.customers.update(id, {email: null}). However, this is currently causing a type error, since the type definitions don't allow the use of null here. But if you bypass the type check it works as expected. I wonder if other CustomerUpdateParams properties have the same issue?
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
Hello @snoack, sorry for the delay on this.
You can pass the empty string '' in order to trigger the emptying of the email string (stripe-node represents null values as empty strings when sending them over the wire anyway because the Stripe API is form-encoded).
I investigated and apparently there's an issue with several fields of type string that would be better represented as Stripe.Emptyable<string> to allow passing null. Many of them were fixed in v12.17.0 but the particular field in your report is waiting on a little extra work to fix the definitions upstream.
Thank you for reporting and thanks for your patience!