#mks00_connect-sct

1 messages ยท Page 1 of 1 (latest)

midnight oakBOT
#

๐Ÿ‘‹ 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.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— 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/1234623643074560010

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

empty radishBOT
lofty field
#

@cursive crystal if you use Separate Charges and Transfers then all the objects would live in your own platform account and you would ~never use the Stripe-Account header feature really

#

So yeah you need to fix your code and have the Checkout Session created on your own platform account not the connected account instead

#

mks00_connect-sct

cursive crystal
#

@lofty field Thank you for your reply.
I'm not sure I understood correctly.
In the documentation, I don't need to specify an id. But I have no trace of the payment.
I have to specify a stripe id to retrieve the event in my webhook.

    'line_items' => [
        [
            'price_data' => [
                'currency' => 'usd',
                'product_data' => ['name' => 'Restaurant delivery service'],
                'unit_amount' => 10000,
            ],
            'quantity' => 1,
        ],
    ],
    'payment_intent_data' => ['transfer_group' => 'ORDER100'],
    'mode' => 'payment',
    'success_url' => $url_success . '?total_price=' . $total_price,
], ['stripe_account' => $sellerStripeAccountId]); <--- here ```
lofty field
#

The code you have, the last line is passing the Stripe-Account header. That is what you should not use since you want to use Separate Charges and Transfers. Everything should be on your own Stripe account not on the connected account

cursive crystal
#

All right!
But how can I retrieve the event in my webhook?
Is this the way I can make a payment for a buyer to different stripe connect accounts?

lofty field
#

I'm sorry I think you are misunderstanding the flow of funds completely. You explicitly said you want to use Separate Charges and Transfers. Usually what this means is that I pay you $100 on your account and then you transfer $30 to seller A for a book, $20 to seller B for another book and $40 to seller C and keep $10 for yourself

cursive crystal
#

Oh, excuse me.
I work on an amazon-type site.
Where a customer will fill his cart with motorcycle parts from different sellers.
The customer validates his cart, and registers his information in a payment session. Then my goal is to send the money to the connected stripe accounts of the motorcycle parts sellers.
Am I making a mistake in my integration?

lofty field
#

you are picking the right flow of funds but your code is incorrect. The Checkout Session should be on your platform account and it should aggregate all the line items together

cursive crystal
#

Oh I see my code has an error!
So I have to put the stripe_account in the header must be my identifier?
Which I find in the account category of my profile?

lofty field
#

I'm sorry I don't really understand your sentences right now

cursive crystal
#

Sorry for my english ^^

lofty field
#
  // parameters
], ['stripe_account' => $sellerStripeAccountId]); <--- here ```

Your code does this and that's incorrect. That last line should be removed so that the Checkout Session happens on your own Stripe account instead
#

(no problem I know it's a lot of moving pieces to understand our product)

cursive crystal
#

You're so kind to help me so much

#

But when I remove this line I see nothing on my Stripe account. The checkout session complete well but I have nothing in my webhook

lofty field
#

The Checkout Session is now created on your platform account. You should see everything in the Dashboard on your own account and not the connected account(s)
You also need to make sure you create an Account WebhookEndpoint instead of a Connect WebhookEndpoint to listen to Events on your own account

cursive crystal
#

Ooooooh

#

Wait I test it

#

LETS GOOOOO

#

I think it works !!!

#

gg ggggg

lofty field
#

amazing ๐Ÿ™‚

cursive crystal
#

ahaha

#

you save me

#

im sorry

lofty field
#

No problem at all, I'm glad you figured it out ๐Ÿ™‚

midnight oakBOT