#Muttakin Islam Hasib - Checkout + Connect
1 messages ยท Page 1 of 1 (latest)
Basically in live mode funds will take time to arrive from the bank. We typically simulate that in test mode but you can bypass it by using these test cards in your checkout session https://stripe.com/docs/testing#available-balance
my checkout session implementation is ok?
If you are actually getting to the point where the payment has succeeded and the funds are pending it sounds like it is working. Do you have specific concerns with it at the moment?
one thing,
i have a wedding application
example (wedding.com) -> the root company
we are providing monthly subscription system to our venue
there will be couple account who will create website with venue reference
on the couple website guest will purchase giftcard for their couple like $105
$100 will receive the couple to their stripe express account and it will automatically payout to their bank
and for the rest $5, their will be stripe fee and $1 will send to the venue's bank account and the rest will receive the root company, i mean company owner
how can i implement this?
the company owner will receive their payment directly to their main stripe dashboard account
I think this doc can help you, you can create a checkout session and specify how much to send to which account once the payment has completed https://stripe.com/docs/connect/creating-a-payments-page
Or rather, in this doc we show an application_fee_amount which would be how much your platform keeps when the payment is made.
Is that doc helpful for you here?
Muttakin Islam Hasib - Checkout + Connect
how can i divide one transaction into two separate transfers?
example:
one checkout session will create for $100
and this $100 will transfer into two bank account, per account will receive $50
Ah gotcha, so your platform gets $5 and each bank account gets $50. In that case you will want to use our separate charges and transfers flow https://stripe.com/docs/connect/charges-transfers
In that doc we show a custom form but you can just use a checkout session and create transfers using its payment intent once the checkout session has completed.
Basically you would wait for the payment to complete and then make two API calls to create transfers for $50 to each account.
With this flow there isn't an explicit platform fee. You essentially charge a fee by not sending all of the funds away (so in this case you send $100 away and keep $5)
Yes, checkout.session.completed will likely be a good one to listen to to see when the payment has succeeded https://stripe.com/docs/api/events/types?lang=curl#event_types-checkout.session.completed
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
and in this webhook, i will create paymentIntent and transfer with two account?
The checkout session will already have a payment intent, so at that point you will create the two transfers https://site-admin.stripe.com/docs/api/checkout/sessions/object?lang=curl#checkout_session_object-payment_intent
wait i am showing you the code
this is the checkout session
and this one from webhooks
can you please check our old conversation ?
Okay so you trying to send multiple transfers
If you want to transfer immediately after a payment is made then you need to use source_transaction
Otherwise you will hit errors as the funds won't be available
from where i will get the source_transaction: "{CHARGE_ID}", charge id ?
this was my implementation in webhooks
You get the Charge from the latest_charge property of the PaymentIntent
So you would need to either listen for Payment_intent.succeeded or retrieve your Checkout Session and expand the PaymentIntent
there is no latest_charge property
On the PaymentIntent?
yes
Ah yeah it was recently added and isn't in our types
You need to override the type there
so the source_transaction will like this one ?
Yep
should i upgrade my stripe package?
Mostly depends