Aadmaa
Aadmaa

Reputation: 932

How can I set up a test, Stripe connect account on the backend and skip onboarding?

When I try to set up a test, Stripe connect account on the backend and skip onboarding, I run into address and identity verification issues. How can I resolve these?

Background: for testing backend features other than Stripe onboarding, it would be helpful to set up a test Stripe connect account that has completed onboarding. There are other answers here indicating that there is no one-call process to complete that, but it's not clear exactly what the steps are.

Below I try to complete this in 3 steps; but I am running into an issue: the address is unverified even though I'm using the address 'token' that the documentation says will automatically verify.

My steps:

  1. Create an account token
  2. Create a bank_account token
  3. Create an account, using those tokens

Result: when I check the account after a few seconds (I wait 10 seconds for verification) I get:

account.payouts_enabled:  true
account.charges_enabled:  true
account.currently_due:  [
  "individual.address.line1"
]
account.past_due:  []
account.eventually_due:  []
account.disabled_reason:  requirements.pending_verification
account.pending_verification:  [
  'individual.address.city',
  'individual.address.line1',
  'individual.address.postal_code',
  'individual.address.state',
  'individual.id_number'
]

The problem: why is the address line marked "currently_due" (when I'm using the documented token "address_full_match​") and address verification incomplete? Additionally, why is the individual.id_number pending verification (when I'm using the documented token "222222222")?

Code below, using the Stripe Node API:

    const accountToken = await stripe.tokens.create({
      account: {
        business_type: 'individual',
        
        individual: {
          first_name: 'Jenny',
          last_name: 'Rosen',

          // https://stripe.com/docs/connect/testing
          // Use these addresses for line1 to trigger certain verification conditions. You must pass in legitimate values for the city, state, and postal_code arguments.
          // address_full_match​       Successful verification.
          // address_no_match         Unsuccessful verification.
          address: {
            line1:  'address_full_match​',
            city: 'Columbus',
            state: 'OH',
            postal_code: '43214',
            // country: 'US'
          },

          // https://stripe.com/docs/connect/testing#test-dobs
          // 1901-01-01 Successful verification. Any other DOB results in unsuccessful verification.
          // 1902-01-01 Successful, immediate verification. The verification result is returned directly in the response, not as part of a webhook event.
          // 1900-01-01 This DOB will trigger an Office of Foreign Assets Control (OFAC) alert.
          dob: {
            day: 1,
            month: 1,
            year: 1902
          },

          // https://stripe.com/docs/connect/testing
          // Use these personal ID numbers for individual[id_number] or the id_number attribute on the Person object to trigger certain verification conditions.
          // 000000000  Successful verification. 0000 also works for SSN last 4 verification.
          // 111111111  Unsuccessful verification (identity mismatch).
          // 222222222  Successful, immediate verification. The verification result is returned directly in the response, not as part of a webhook event.
          id_number: '222222222',
          // ssn_last_4: '0000',
          email: '[email protected]',
          phone: '000 000 0000'
        },
        tos_shown_and_accepted: true,
      },
    });

    const bankAccountToken = await stripe.tokens.create({
      bank_account: {
        country: 'US',
        currency: 'usd',
        account_holder_name: 'Jenny Rosen',
        account_holder_type: 'individual',
        routing_number: '110000000',
        account_number: '000123456789',
      },
    });

    const account = await stripe.accounts.create({
      type: 'custom',
      country: 'US',
      business_profile: {
        mcc: '5734',  // Merchant Category Code. 5734 = Computer Software Stores
        product_description: 'Cool Beans, Inc',
      },
      external_account: bankAccountToken.id,
      capabilities: {
        card_payments: {
          requested: true,
        },
        transfers: {
          requested: true,
        },
      },
      account_token: accountToken.id,

    });

Upvotes: 1

Views: 1521

Answers (3)

Matija
Matija

Reputation: 17902

I've managed to set it up today for my client in sandbox and production.

PHP version with using the official library SDK from stripe.

composer require stripe/stripe-php

At the time of this writing the above version of stripe/stripe-php is exactly v9.6.0

<?php
\Stripe\Stripe::setApiKey('yourSandbox-STRIPE_SECRET_KEY-Here');
\Stripe\Account::create([
    "type" => "custom",
    "country" => "GB",
    "capabilities" => [
        "card_payments" => [
            "requested" => true,
        ],
        "transfers" => [
            "requested" => true,
        ],
    ],
    "business_type" => "individual",
    "external_account" => [
        "object" => "bank_account",
        "country" => "GB",
        "currency" => "gbp",
        "account_number" => "00012345",
    ],
    'tos_acceptance' => ['date' => 1609798905, 'ip' => '8.8.8.8'],
    "business_profile" => [
        "mcc" => 5045,
        "url" => "https://exmple.com",
    ],
    "individual" => [
        "first_name" => "Test",
        "last_name" => "User",
        "phone" => "+16505551234",
        "email" => "[email protected]",
        "id_number" => "222222222",
        "address" => [
            "line1" => "123 State St",
            "city" => "London",
            "postal_code" => "TF5 0DL",
        ],
        "dob" => [
            "day" => 01,
            "month" => 01,
            "year" => 1901,
        ],
    ],
]);

I hope it will help somebody to save some time. Cheers and good luck.

References:

https://stripe.com/docs/connect/custom-accounts#create

https://stripe.com/docs/connect/testing#identity-and-address-verification

https://stripe.com/docs/connect/updating-accounts

enter image description here

enter image description here

Upvotes: 0

Mohsin Sunasara
Mohsin Sunasara

Reputation: 56

You have to add document field as well for upload document to make the account active for testing purpose.

const account = await stripe.accounts.create({
  type: "custom",
  country: "US",
  capabilities: {
    card_payments: { requested: true },
    transfers: { requested: true },
  },
  business_type: "individual",
  external_account: {
    object: "bank_account",
    country: "US",
    currency: "usd",
    routing_number: "110000000",
    account_number: "000123456789",
  },
  tos_acceptance: { date: new Date(), ip: "8.8.8.8" },
  business_profile: { mcc: 5045, url: "https://bestcookieco.com" },
  individual: {
    first_name: "custom_user",
    last_name: "one",
    phone: "+16505551234",
    email: "[email protected]",
    id_number: "222222222",
    address: {
      line1: "address_full_match",
      city: "Schenectady",
      postal_code: "12345",
      state: "NY",
    },
    dob: {
      day: 01,
      month: 01,
      year: 1901,
    },
    verification: {
      document: {
        front: "file_identity_document_success",
      },
    },
  },
});

Upvotes: -1

NickP
NickP

Reputation: 61

Here's the config that works for me:

async function createTestStripeAccount() {
  return await stripe.accounts.create({
    type: 'custom',
    country: 'US',
    capabilities: {
      card_payments: { requested: true },
      transfers: { requested: true }
    },
    business_type: 'individual',
    external_account: {
      object: 'bank_account',
      country: 'US',
      currency: 'usd',
      routing_number: '110000000',
      account_number: '000123456789'
    },
    tos_acceptance: { date: 1609798905, ip: '8.8.8.8' },
    business_profile: { mcc: 5045, url: 'https://bestcookieco.com' },
    individual: {
      first_name: 'Test',
      last_name: 'User',
      phone: '+16505551234',
      email: '[email protected]',
      id_number: '222222222',
      address: {
        line1: '123 State St',
        city: 'Schenectady',
        postal_code: '12345',
        state: 'NY'
      },
      dob: {
        day: 10,
        month: 11,
        year: 1980
      }
    }
  })
}

Upvotes: 3

Related Questions