#putte
1 messages · Page 1 of 1 (latest)
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
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'
},
}
}
});
Do you have the same error if the parameters are just type: 'custom'?
Yes, does not matter what value I put there
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
You can find all the types needed starting here: https://github.com/stripe/stripe-node/blob/master/types/AccountsResource.d.ts#L5
Ok I'll try it out
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
Ok I'll just add the ignore comment because I really dont know where to start here