Shopify / mobile-buy-sdk-android

Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using their credit card.
MIT License
214 stars 136 forks source link

Phone number is not valid #582

Closed dri94 closed 4 years ago

dri94 commented 5 years ago

When trying to create a user i continuously get phone number is not valid. My code is


       val input = Storefront.CustomerCreateInput("test@gmail.com", "password")
                .setFirstNameInput(Input.value("John"))
                .setLastNameInput(Input.value("Doe"))
                .setAcceptsMarketingInput(Input.value(true))
                .setPhoneInput(Input.value("1-123-456-7890"))

I tried replacing the info on the input to my personal info but the same error comes back

rebeccajfriedman commented 5 years ago

A phone number formatted like that should work, provided that you are passing in a valid country code and area code.

dri94 commented 5 years ago

The documentation needs to be updated to state phone must be E164 format. The error returned simply says "Phone is invalid" when it should say that the phone is already registered with another customer, or that the phone format is wrong.

rebeccajfriedman commented 5 years ago

Thank you for your patience. We have added this suggestion to our backlog, and we will be addressing it in the new year.

rebeccajfriedman commented 4 years ago

We have updated the API documentation: https://help.shopify.com/en/api/storefront-api/reference/mutation/customercreate The description for phone input now explicitly mentions formatting using E.164 standard.

The next time the SDK is updated, all comments in Storefront.java will also be updated to mention the format as well.