#davlia7-Connect

1 messages · Page 1 of 1 (latest)

low stirrup
#

Hi there, can you tell me what do you want to accomplish so that I can advise the best solution for you?

strong vapor
#

Hi, I'm using stripe connect and I have clients creating stripe account with our account

#

and now I need to create start using that stripe_account to create the checkout_session->url

low stirrup
#

Got it, so you want to create a Checkout session on the connected account.

strong vapor
#

thanks, but for example in this case (I'm using php sdk )

low stirrup
#

Can you copy and paste the code here? I can help you edit

#
\Stripe\Stripe::setApiKey('sk_test_51BEhnwABQjp5g5dRhpytw9qdGxHS6t5SPxpSAKn8fPgUxVe1ltq8ZxJtDuTmXTX4NsSAIqxzCNmf659xosOHYlFJ00SE5gg70J');
            $YOUR_DOMAIN = secure_url("/");
            $checkout_session = \Stripe\Checkout\Session::create([
                'line_items' => [[
                    'name' => $orden->producto,
                    'amount' => $monto,
                    'quantity' => 1,
                    'currency' => $currency_id,
                    'description' => $orden->producto.' con un valor de '.$orden->monto.' '.$currency_id
                ]],
                'client_reference_id' => $orden->id,
                'mode' => 'payment',
                'success_url' => $YOUR_DOMAIN . '/stripe/'.Hashids::encode($orden->id).'/success',
                'cancel_url' => $YOUR_DOMAIN . '/stripe/'.Hashids::encode($orden->id).'/cancel',
            ], ["stripe_account" => "{{CONNECTED_STRIPE_ACCOUNT_ID}}"]);

            return redirect($checkout_session->url);
#

You shouldn't paste your API key in discord, it's now leaked and compromised, please roll it as soon as possible.

strong vapor
#

working! thanks!

low stirrup
#

No problem! remember to roll your key 🙂

strong vapor
#

yes! I wil do now

#

last question

#

when a new client create an account with stripe connect, Can I get that stripe account id with a webhook ?

low stirrup
#

How do you connect your platform with connected account? Do you create the connected account from the platform?

strong vapor
#

yes, I'm using the standard account

#

// Create a Standard Account
$stripe = $this->stripe;
$stripe_account = $this->stripe->accounts->create(['type' => 'standard', 'country' => 'MX']);
$stripe_account = $stripe->accounts->create(['type' => 'standard']);

    // Create an account link
    $account_link = $this->stripe->accountLinks->create([
        'account' => $stripe_account->id,
        'refresh_url' => secure_url('/stripe/refresh_create_account'),
        'return_url' => secure_url('/stripe/success_create_account'),
        'type' => 'account_onboarding',
    ]);
    return redirect($account_link->url);
low stirrup
#

Right, then you can take a look at the link that I sent earlier, and listen to account.updated webhooks

strong vapor
#

great!

#

thanks!