#Tyren
1 messages ยท Page 1 of 1 (latest)
Hi there ๐
When using our Separate Charges and Transfers flow, you have control over how much of a transaction is sent to your merchants/vendors by controlling the amount that the Transfers are created for.
This is explained here, along with a visual representation of the flow, but please let me know if it doesn't clear things up and I'll be happy to talk through this further:
https://stripe.com/docs/connect/charges-transfers#collecting-fees
Yes I do understand but in that case should I include the amount I want my platform to be left with inside the price data of each item ?
For example how can i create a Separate Charges and Transfers payment for 2 different products worth each 10$ while adding extra 5$ for my platform using Checkout ?
As far as I understand, something like the code below will only charge for 20$ whereas the total amount I want is 25$ to be able only to transfer 20$ and to keep 5$.
await stripe.checkout.sessions.create({
line_items: [
{
price_data: {
currency: 'usd',
product_data: {
name: 'T-shirt1',
},
unit_amount: 10,
},
quantity: 1,
},
{
price_data: {
currency: 'usd',
product_data: {
name: 'T-shirt2',
},
unit_amount: 10,
},
quantity: 1,
}
],
mode: 'payment',
success_url: 'http://localhost:4242/success',
cancel_url: 'http://localhost:4242/cancel',
});
The thing is, i'm not sure how Checkout computes the total charge amount and how to precisely set it to the amount I need in order to both transfer money and have my share.
Checkout Sessions build their amount based on the line items that you provide. Typically the Platform collects its fees from the charged price (in this case by not transferring the full amount of the payment to your merchants/vendors) so that it is essentially the merchants/vendors paying the Platform's fees. If you instead want to add an extra cost to the payment so that your customers pay the Platform's fees (and have confirmed it is legal for you to do so in your region) then you would need to include an additional line item for that fee.
Ok so in my example i'll need to add an extra line_item called Service at 5$.
Kind a related question : do checkout.session.completed webhook event also triggers a payment_intent.succeeded webhook event ?
The completion of a Checkout Session, that was created with payment as its mode, will trigger both of those events, unless you're accepting delayed notification types of payment methods.
https://stripe.com/docs/payments/checkout/fulfill-orders#delayed-notification
Thanks a lot ๐
Happy to help!