Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correct Phone number format for stripe connect create customer

I'm trying to create a stripe connect customer using node.js. However, every time I make the request it gives me an "invalid phone number" error.

I've already tried several different phone numbers and formats.

  • "+10000000000"
  • "0000000000"
  • "+1000-000-0000"
  • "000-000-0000"
    const opts: any = {
                            type: 'custom',
                            country: 'US',
                            email: user.email,
                            business_type: 'individual',
                            business_profile:{
                                url: 'www.blulight.tech'
                            },
                            individual:{
                                phone: user.phoneNumber,
                                email: user.email,
                                first_name: user.name.firstName,
                                last_name: user.name.lastName,
                                dob: {
                                    day: user.dateOfBirth.day,
                                    month: user.dateOfBirth.month,
                                    year: user.dateOfBirth.year
                                },
                                address:{
                                    line1: user.address.line1,
                                    line2: user.address.line2,
                                    postal_code: user.address.postal_code,
                                    city: user.address.city,
                                    state: user.address.state
                                },
                                ssn_last_4: user.dateOfBirth.ssn_last_4,
                                verification: {
                                    document:{
                                        back:  documents[1].id,
                                        front:  documents[0].id,
                                    }
                                }
                            },
                            tos_acceptance: {
                                date: Math.floor(Date.now() / 1000),
                                ip: user.ipAddress
                            }
                        };
Not a valid phone number
    at Function.generate (/srv/node_modules/stripe/lib/Error.js:49:16)
    at IncomingMessage.res.once (/srv/node_modules/stripe/lib/StripeResource.js:167:39)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:139:11)
    at process._tickDomainCallback (internal/process/next_tick.js:219:9)
like image 676
Evan Thomas Avatar asked Sep 05 '19 01:09

Evan Thomas


People also ask

How can I change my mobile number in Stripe?

To update your personal information, first head to the Account page via the person icon in the top right corner: Under Stripe Express Account, you can update the email address and phone number used to log in to Stripe Express. Please note that only one contact method can be updated at a time.

What information does Stripe require?

To transact on Stripe, Stripe must verify: Business identification (address and website ownership) and bank account information. Supportability of your business: what you sell, and if we can support your product/category. The overall risk level of your business.

How do I get my Stripe customer ID?

Just use the following line of code you will get the customer id. $customer = $stripe->customers()->create([ 'email' => $_POST['stripeEmail'], 'source' => $_POST['stripeToken'], 'plan' => trim($plan) ]); echo $customer['id'];


1 Answers

You probably already solved the issue but there is no answer. I found that what works best is full international number i.e. '+49 89 416115623'.

I am using libphonenumber-js and its parsePhoneNumberFromString method:

const parsedPhoneNumber = parsePhoneNumberFromString(phoneNumber); parsedPhoneNumber.formatInternational();

which outputs just the number listed above.

like image 137
sihill Avatar answered Oct 05 '22 20:10

sihill