#Vince
1 messages ยท Page 1 of 1 (latest)
hello tarzan i hope you can help me ๐
they are additional charges.
I am new to stripe so bear with me ๐
you can't consider additional charges as part of Tax
is this a subscription? or a one-off invoice?
its a one time charge.
is it possible to show that in the checkout page? I am using your checkout link
you'd have to create the checkout session with 2 line_items 1 price (Cash Commission to Creator) with the tax_behavior exclusive and the other one with tax_behavior inclusive and set the tax rate to 5%
Hi! I'm taking over my colleague. Please, give me a moment to catch up.
What do you mean exactly?
Wait.
it should be displayed as a product
What are you refering to by "it"?
Wait.
i mean it would be like this right??
if the product quantity is = 1 it should be like this
the product name is Manual Selection Selection sorry for the name ๐
The tax should not be a product, but a tax_rate
Manual Selection Selection and Service Fee 10% are products
Correct
so for the VAT is it possible to base it on the service fee of 10%?
Yes
hmm how? is it doable in the dashboard?
wait
this one?
cs_test_b1r1u4i3ZVbGRvKofZiNP3rmLFxGBAw2UZtMxJz1Vut2ZfJXc5niZY4gTk
sorry for not responding right away.
i dont know how to based the vat on the service fee here.
yeah stripe checkout.
something like this. But dont mind the code its messy I just do some tests.
$chargeLink = \Stripe\Checkout\Session::create([
'success_url' => route('checkout.success'),
'cancel_url' => route('checkout.success'),
'line_items' => [
[
'price_data' => [
'currency' => 'usd',
'product_data' => [
'name' => $this->data->name,
],
'unit_amount_decimal' => $this->data->cash_commission * 100,
],
'quantity' => $this->data->min_contracts,
]],
'mode' => 'payment',
'metadata' => [
'creator_id' => $this->data->creator_id,
'sponsor_id' => $this->data->sponsor_id,
]
]);
$chargeLinkUrl = $chargeLink['url'];
return $chargeLinkUrl;
You can add the tax_rate to your line_item: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-tax_rates
i see. so i need to add it on the service fee product.
Yes
oh its tax rate i thought it tax_code.
should I create a new tax code in the dashboard for this?
You should create a new Tax Rate
in the dashboard?
i just created a new one. so is it okay to use the tax_rate id right?
Yes
okay wait. ๐
i see
is this the correct way of doing it right?
$chargeLink = \Stripe\Checkout\Session::create([
'success_url' => route('checkout.success'),
'cancel_url' => route('checkout.success'),
'line_items' => [
[
'price_data' => [
'currency' => 'usd',
'product_data' => [
'name' => $this->data->name,
],
'unit_amount_decimal' => 5000 * 100,
],
'quantity' => 1,
],
[
'price_data' => [
'currency' => 'usd',
'product_data' => [
'name' => 'Service Fee (10%)',
],
'unit_amount_decimal' => (5000 * 100) * .1, //sample
],
'tax_rates' => ['txr_1N1UB9IRvJMoEzujDl96uke4'],
'quantity' => 1,
],
],
'mode' => 'payment',
'metadata' => [
'creator_id' => $this->data->creator_id,
'sponsor_id' => $this->data->sponsor_id,
]
]);
๐ stepping in
hi @left creek
Looks like you only added tax_rates to one of the line items above
But you want it to apply to both, right?
no since it is only based on the service fee.
but is it feasible to do it something like this? I mean the additional charges are per quantity. sorry if this doest make sense to you ๐
i am new on using stripe ๐
you mean the service fee?
i see. so the service fee is also based on the number of products..
Well you would calculate the Service Fee yourself in your line_items
what do you mean?
You have control of how much you set the Service Fee to
If you want it to be 10% of the actual product amount then you calculate it dynamically based on that
Yep so you control this calculation. The Stripe API here just intakes whatever amount you calculate -- it doesn't accept a percentage so you need to handle this calculation
yep. thank you for the support. very much appreciated ๐ so fast