#ripitried

1 messages · Page 1 of 1 (latest)

random hornetBOT
fossil helm
#

Hello! You can create a Customer without any details at all. Happy to take a look at your request IDs!

pearl ledge
#

req_Z7CdaEnLNhUdfO

#

req_o2S1H1cpQwpCzc

#

Here are 2, its showing that "address" is required

#
      // user might not have addressInfo
      let address: AddressInfo = undefined;
      if (user.addressInfo) address = user.addressInfo;

      const fullName = `${user.firstName?.trim()} ${user.lastName?.trim()}`;
      const params: Stripe.CustomerCreateParams | Stripe.CustomerUpdateParams = {
        name: fullName,
        email: user.emailAddr || '',
        phone: user.phoneNumber || '',
        shipping: {
          name: fullName,
          address,
        },
        metadata: {
          uid: user.uid,
        },
      };
#

Here is the code snippet that I believe we are creating the customer from

fossil helm
#

Ah, if you specify shipping information you must supply a full address. You can't just supply a name. You can omit the shipping property entirely though.

pearl ledge
#

Ah okay so if I do not have the shipping address yet i need to skip providing the shipping property

fossil helm
pearl ledge
#

Ah great

#

alright thanks!

#

So if i just conditionally omit the shipping when I do not have the address but all other fields persist the customer creation should be ok right?

fossil helm
#

Yep!