Ad

Node Js Stripe Connect Missing Requested_capabilities: ['card_payments'] Param From Create Account Function

im trying to use stripes node js api to create connect accounts and then allow them to pay for services and receive transfers. Iv read all of stripes current api docs but i cannot add the requested_capabilities:[] param to my function for some reason. im useing the node js stripe api version 7.8.0 with "@types/stripe": "^6.31.20"

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

Iv read the stripe docs and even looked into the class file for the function im calling but the param dosent seem to exist.

console.log('Creating stripe account for user ', user);
            const customer: Promise<Stripe.accounts.IAccount> = 
            stripe.accounts.create(
                {
                    type: 'custom',
                    country: 'US',
                    email: user.email,
                    business_type: 'individual',
                    individual:{
                        email: user.email,
                        first_name: user.name.firstName,
                        last_name: user.name.lastName,
                    },
                    tos_acceptance: {
                        date: Math.floor(Date.now() / 1000),
                        ip: user.ipAddress
                    }
                }

'You must request at least one of the following capabilities: platform_payments, card_payments, legacy_payments. Please visit https://stripe.com/docs/connect/capabilities-overview to learn more.',

Object literal may only specify known properties, and 'requested_capabilities' does not exist in type 'IAccountCreationOptions'.

Ad

Answer

Here's an example of how you pass the requested_capabilities:

const account = await stripe.accounts.create({
  type: 'custom',
  country: 'us',
  requested_capabilities: ['card_payments']
});

(relevant docs)

Ad
source: stackoverflow.com
Ad