#abinashvision135

1 messages · Page 1 of 1 (latest)

south wrenBOT
keen viper
#

I don't understand the question. What API calls are you making?

wind fiber
#

i want to use stripe connect.

#

i try with this code

#

i take a form which is given field accoding body, like that account no. holder name, email, name, and pin code

#

*routing no.

keen viper
#

Can you paste the code here?

wind fiber
#

ok

agile pecan
wind fiber
#

code is long

#

this not able to send code

agile pecan
#

then use gist

#

be sure to scrub sensitive api keys first though.

wind fiber
#

const handleBankDetails = async (e, bankDetails) => {
e.preventDefault();

try {
  const stripe = await stripePromise;
  const account = await stripePromise?.accounts?.create({
    type: 'custom',
    country: 'US',
    email: bankDetails.account_holder_email,
    requested_capabilities: ['transfers'],
    business_type: 'individual',
    individual: {
      email: bankDetails.account_holder_email,
      first_name: bankDetails.account_holder_name,
      last_name: '',
      address: {
        line1: '123 Main Street',
        city: 'Anytown',
        state: 'CA',
        postal_code: bankDetails.account_holder_pin,
      },
      dob: {
        day: '01',
        month: '01',
        year: '1970',
      },
      verification: {
        document: {
          front: 'file_123',
        },
      },
    },
    business_profile: {
      url: 'https://example.com',
    },
    tos_acceptance: {
      date: Math.floor(Date.now() / 1000),
      ip: '127.0.0.1',
    },
  });
#

await stripe?.accounts?.createExternalAccount(account.id, {
external_account: {
object: 'custome',
country: 'Belgium',
currency: 'AUD',
account_holder_name: bankform.holderName,
account_holder_type: 'custome',
routing_number: bankform.routing,
account_number: bankform.account_no,
},
});

  await stripe?.accounts?.update(account.id, {
    external_account: {
      default_for_currency: true,
    },
  });

  const bankAccount = {
    country: 'US',
    currency: 'USD',
    account_holder_name: bankform.fname,
    account_holder_type: 'individual',
    account_number: bankform.account_no,
    account_holder_email: bankform.email,
    routing_number: bankform.routing,
    account_holder_pin: bankform.pincode,
  };
  const result = await stripe?.createToken('bank_account', bankAccount);
  if (result.error) {
    console.log(result.error.message);
  } else {
    token: result?.token?.id
    console.log(result.token.id);
    updateBankDetails(user?.uid, { ...bankAccount, token: result.token?.id });
    console.log(`Bank details for user ${user?.uid} added successfully.`);
  }
} catch (error) {
  console.error(`Error adding bank details for user : ${error.message}`);
}

}

#

i sent code in two parts but both parts in one function

agile pecan
wind fiber
#

ok

keen viper
#

What is the actual issue you're having here? So far you've sent me a wall of code without describing the problem you have

wind fiber
#

i sent please check

#

i want to use stripe connect

#

i want to implement Stripe Connect, will
involve integration as well as adding an option in reviewer profile to
subscribe/connect/manage Stripe Connect Account with this code

keen viper
#

Ok, you told me what you want to do. But what issues are you having with the code you've shared? Is there a specific error?

wind fiber
#

i implement this code, i got token and user id with bank details, i see user added but i didn't see any account create on stripe connect

keen viper
#

Are you an Indian merchant/account?

wind fiber
#

yes

keen viper
#

You're trying to create Accounts with type: 'custom', so the API request is likely failing

south wrenBOT
wind fiber
#

sorry, i used custome account for belgium

keen viper
#

No, your code here:

const account = await stripePromise?.accounts?.create({
        type: 'custom',
        country: 'US',
        ...
})
#

You're trying to create a US based custom account. If you're an Indian platform, it won't work

wind fiber
#

i used belgium stripe connect account

#

i have stripe account of belgium

vagrant burrow
#

Hi! I'm taking over this thread.

wind fiber
#

is this safe to share account id, because this is not my project, this is client project

#

and client account

#

can you provide me code of stripe connect account, customer, transfer payment . if you have

vagrant burrow
#

is this safe to share account id, because this is not my project, this is client project
If you are not comfortable with sharing the account ID publicly, then you should contact Stripe support to have a private conversation: https://support.stripe.com/contact

wind fiber
#

i want do this

vagrant burrow
wind fiber
#

i want to create custome account

vagrant burrow
wind fiber
#

yes i know some limitation custome accounts for some coutries, but belgium can use custome accounts

#

am i right

vagrant burrow
wind fiber
#

i also used belgium stripe secret key and publish key

#

can i create customer and stripe connect account, on stripe by code use next.js with firebase

#

like that this is created by code, same as well as i want to connect stripe connect by code

vagrant burrow