Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for deleting customer's email address in type defintions #1834

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

snoack
Copy link

@snoack snoack commented Jun 30, 2023

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?

@CLAassistant
Copy link

CLAassistant commented Jun 30, 2023

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

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.

@richardm-stripe
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants