#putte

1 messages · Page 1 of 1 (latest)

dusky mossBOT
true coral
#

Can you share the snippet of code your using for this?

#

Are you assigning parameters to an object before the call, and passing that in?

#

You might need to specify a type for those parameters explicitly

#

This is just a limitation of TS inference, if i recall

steep flower
#

const adress = {
line1: billingAdress,
country: countryValue.countryCode,
state: municipality,
city: municipality,
postal_code: postal.split(' ')[0],
}

// Create the "custom" account on stripe
// so that the customer can recieve payments
const account = await stripe.accounts.create({
    type: "custom",
    country: countryValue.countryCode,
    email: email,
    metadata: {
        user_id: user_id
    },
    tos_acceptance: {
        date: unixTime,
        ip: '8.8.8.8'
    },
    business_type: 'individual',
    individual: {
        address: {...adress},
        email: email,
        first_name: firstname,
        last_name: lastname,
        phone: '+46737300000',
        id_number: identificationNumber,
        dob: {
            year: countryValue.dob.year,
            month: countryValue.dob.month,
            day: countryValue.dob.day
        }
    },
    company: {
        name: fullname,
        address: {...adress},
        phone: '+46737300000'
    },
    business_profile: {
        name: fullname,
        support_email: email,
        product_description: 'Cuberra',
        mcc: '8699',
        support_address: {...adress}
    },
    capabilities: {
      transfers: {requested: true},
      card_payments: {requested: true}
    },
    settings: {
        payouts: {
            debit_negative_balances: true,
            statement_descriptor: 'Cuberra',
            schedule: { 
                interval: 'manual' 
            },
        }
    }
});
true coral
#

Do you have the same error if the parameters are just type: 'custom'?

steep flower
#

Yes, does not matter what value I put there

true coral
#

right, probably you'll need to more finely type that param object

#

eg, try typing the whole thing as AccountCreateParams first, but you might also need to type deep portions of it

#

eg, you might also try explicitly typing your adress as Stripe.AddressParam

steep flower
#

Ok I'll try it out

true coral
#

The alternative would be to add the TS ignore comment and instead handle errors from the Stripe API if the parameters are malformed

#

So it depends on what you're trying to achieve

steep flower
#

Ok I'll just add the ignore comment because I really dont know where to start here