stripe-node icon indicating copy to clipboard operation
stripe-node copied to clipboard

Allow for deleting customer's email address in type defintions

Open snoack opened this issue 2 years ago • 3 comments
trafficstars

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?

snoack avatar Jun 30 '23 23:06 snoack

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 30 '23 23:06 CLAassistant

CLA assistant check
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.

CLAassistant avatar Jun 30 '23 23:06 CLAassistant

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!

richardm-stripe avatar Aug 08 '23 18:08 richardm-stripe