#diana_code

1 messages · Page 1 of 1 (latest)

fossil sunBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question. Thank you for your patience!

⏱️ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1215030616916107294

📝 Have more to share? You can add more detail below, including code, screenshots, videos, etc.

manic terraceBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

jolly glen
#

Hello

cyan wave
#

Hello

jolly glen
#

Can you clarify exactly what you are having trouble with? Is this in test mode?

cyan wave
#

Now I can shame my code complete

  $customer = $stripe->customers->create([
    'description' => 'Cliente de ejemplo',
    'name' => 'Diana Trevino',
    'email' => 'diana@cliente.com',
  ]);

  echo "Customer ID: $customer->id <br>";

  $bankAccount = \Stripe\Customer::createSource(
    $customer->id, // el ID del cliente
    [
      'source' => [
        'object' => 'bank_account',
        'country' => 'US',
        'currency' => 'usd',
        'account_holder_name' => "$nombre_titular",
        'account_number' => "$numero_cuenta",
        'routing_number' => "$numero_ruta",
        'account_holder_type' => "$tipo_cuenta",
      ],
    ]
  );
  echo "La cuenta bancaria se ha agregado correctamente a tu cuenta de Stripe. ID de la cuenta bancaria: " . $bankAccount->id . "<br>";

  $payout = \Stripe\Payout::create([
    "amount" => 100, // cantidad en centavos
    "currency" => "usd", // moneda
    "destination" => $bankAccount->id, // ID de la cuenta bancaria del cliente
    "source_type" => 'bank_account', // tipo de fuente
    "description" => 'Depósito directo de prueba',
  ]);

  echo "Se ha realizado un depósito directo de $1 en la cuenta bancaria de prueba.";
jolly glen
#

Gotcha yeah you are misunderstanding how this works.

cyan wave
#

Yes, let me explain

jolly glen
#

Customers are used to collect pay-ins.

#

If you want to create payouts then you need to create Connected Accounts

cyan wave
#

Thank you for your guidance. I understand the distinction now. I've attempted to create customer accounts previously, but encountered some errors along the way. Before proceeding further, I'd like to ensure I have a solid understanding of the correct approach. Would it be possible to share my code with you for feedback and guidance on setting up Connected Accounts?

#

// Crear una cuenta conectada para el cliente
$account = $stripe->accounts->create([
'type' => 'custom',
'country' => 'US',
'email' => 'diana.trevino@cliente.com',
]);
echo "Account ID: $account->id <br>";

// Vincular la cuenta bancaria a la cuenta conectada
$bankAccount = $stripe->accounts->createExternalAccount(
$account->id,
[
'external_account' => [
'object' => 'bank_account',
'country' => 'US',
'currency' => 'usd',
'account_holder_name' => $nombre_titular,
'account_number' => $numero_cuenta,
'routing_number' => $numero_ruta,
'account_holder_type' => $tipo_cuenta,
],
]
);

// Realizar el pago a la cuenta conectada
$payout = $stripe->payouts->create([
"amount" => 100,
"currency" => "usd",
"destination" => $bankAccount->id,
"source_type" => 'bank_account',
"description" => 'Depósito directo de prueba',
], ['stripe_account' => $account->id]);

jolly glen
#

You will also need to move funds from your platform to the Connected Account before you can create a payout

#

And the funds will need to be available

cyan wave
#

I would like to inquire about the best method for depositing funds to my employees with only the following information: account holder's name, account number, and routing number. Could you please advise on the most effective and secure approach for processing payments using this information?

jolly glen
#

That's not possible.

#

You have to onboard them as a Connected Account with the required verification information.