#Davaogoods-Connect
1 messages · Page 1 of 1 (latest)
hello! i think this is what you're looking for - https://stripe.com/docs/connect/charges-transfers?
Thank you I will check this out
does this apply to both standard and express connect accounts?
and does this redirect to the stripe payment page once created?
yes, you can use Separate Charges and Transfers (SCT) for both Standard and Express connect. SCT in essence means a charge on your platform, and then subsequently creating transfers to those connected accounts.
The guide i previously mentioned uses a custom checkout flow (i.e. you build your own checkout page) to illustrate the example. If you want a low code solution, you can make use of Stripe Checkout (which will redirect the customer to the Stripe hosted payment page) - https://stripe.com/docs/checkout/quickstart. You will still need to implement your own logic to transfer funds to the different connected accounts though
got it thank you
do you have sample php code that illustrates the checkout with SCT I can take a look?
I only have these at the moment
I need to know where to put in the payment intent from SCT on your previos mentioned
since there are two objects needs to be included
you should remove the stripe_account header in your code
the Checkout Session (and hence payment) will then occur on your platform account
i'd suggest you include metadata also for which accounts you need to transfer the money to after payment is made
you don't need the portion to create a PaymentIntent anymore
lets take this step by step
have you created the Checkout Session yet?
ok lets do step by step
this is my main payment for / checkout session
literally this goes fine. but I need to send it to multiple sellers like 2 products different sellers in 1 cart
so this would not work since its a direct payment to 1 seller
the last line that you have ['stripe_account' =>....] -> remove this
okay, so now when you create the Checkout Session, can you share the id? It'll look like cs_test_...
taking a look just to make sure everything is correct
alright, great, now make payment for that Checkout Session
you should have the checkout url : https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-url
open it in a browser and make payment with a test card - you can use 4242 4242 4242 4242
after you make payment let me know
yeah
done
if you login / look at this page : https://dashboard.stripe.com/test/events/evt_1Lfe8DKhLpImRHOfMylPvPuO
this is the checkout.session.completed event that will be generated
okay.. and?
there's also a corresponding payment_intend.succeeded event generated : https://dashboard.stripe.com/test/events/evt_3LfdzcKhLpImRHOf0d0DkAxu
now in the payment_intend.succeeded event - you'll see a Charge id : ch_3LfdzcKhLpImRHOf0tR7xt7e
yea I see it
when you create the transfer -
curl https://api.stripe.com/v1/transfers \
-u sk_test_...: \
-d amount=100 \
-d currency=usd \
-d destination=acct_... \
-d transfer_group=ORDER_95 \
-d source_transaction=ch_...
you should pass in the charge id to the source_transaction
that's how you transfer to connected accounts
now backtracking a bit
the next question you'll likely have is how do i know which connected accounts i need to transfer to then
yea and so how?
when creating the Checkout Session, pass in the connected account and amounts you want to transfer to in the payment_intent_data.metadata : https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata
so when you receive the payment_intend.succeeded event - that metadata that you passed in when creating the Checkout Session will also be reflected in this event
just to clarify
so you'll have to read and process the metadata then create the transfers accordingly
when doing payment charges to multiple sellers
the platform receives the payment
and is the one that transfers those payment to the sellers?
yes that's right. This is how it works when you want to transfer to multiple connected accounts
but if its direct payment, the way I did before is the one that will be implemented
yep
I see.. got it
I will review our conversation since I already have a webhook created
thank you so much
you rock man!
feel free to reach out again if you're having issues. Connect can be very confusing
will do
you can refer to the sample code in our documentation : https://stripe.com/docs/api/transfers/create?lang=php