#Vince

1 messages ยท Page 1 of 1 (latest)

kindred parcelBOT
rose walrus
#

๐Ÿ‘‹ happy to help

#

the Service fee is not really a tax right?

barren cobalt
#

hello tarzan i hope you can help me ๐Ÿ˜„

#

they are additional charges.

#

I am new to stripe so bear with me ๐Ÿ˜…

rose walrus
#

you can't consider additional charges as part of Tax

barren cobalt
#

it would be something like

#

hmm i see

rose walrus
#

is this a subscription? or a one-off invoice?

barren cobalt
#

its a one time charge.

#

is it possible to show that in the checkout page? I am using your checkout link

rose walrus
#

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%

kindred parcelBOT
barren cobalt
#

ohh so its a product?

#

i mean I need to add it as a product? not a fee?

wintry hazel
#

Hi! I'm taking over my colleague. Please, give me a moment to catch up.

wintry hazel
barren cobalt
#

Wait.

barren cobalt
wintry hazel
#

What are you refering to by "it"?

barren cobalt
#

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 ๐Ÿ˜…

wintry hazel
#

The tax should not be a product, but a tax_rate

#

Manual Selection Selection and Service Fee 10% are products

barren cobalt
#

so the VAT is the only one that is not a product?

#

sorry i am confused ๐Ÿ˜„

wintry hazel
#

Correct

barren cobalt
#

so for the VAT is it possible to base it on the service fee of 10%?

wintry hazel
#

Yes

barren cobalt
#

hmm how? is it doable in the dashboard?

wintry hazel
#

Could you please share a Checkout Session ID?

#

Are you with me?

barren cobalt
#

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.

wintry hazel
#

Are you using Stripe Checkout?

#

How do you create it?

barren cobalt
#

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;
wintry hazel
barren cobalt
#

i see. so i need to add it on the service fee product.

wintry hazel
#

Yes

barren cobalt
#

oh its tax rate i thought it tax_code.

#

should I create a new tax code in the dashboard for this?

wintry hazel
#

You should create a new Tax Rate

barren cobalt
#

in the dashboard?

#

i just created a new one. so is it okay to use the tax_rate id right?

wintry hazel
#

Yes

kindred parcelBOT
barren cobalt
#

okay wait. ๐Ÿ™‚

#

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,
            ]
        ]);
left creek
#

๐Ÿ‘‹ stepping in

barren cobalt
#

hi @left creek

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?

barren cobalt
#

no since it is only based on the service fee.

left creek
#

Oh

#

Okay then yeah the above looks right

#

I'd test it out

barren cobalt
#

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 ๐Ÿ˜„

left creek
#

Sure

#

You just set quantity 3 for the first line item

barren cobalt
#

i see. so the service fee is also based on the number of products..

left creek
#

Well you would calculate the Service Fee yourself in your line_items

left creek
#

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

barren cobalt
#

its basically 10% per product quantity.

#

also for the vat too.

left creek
#

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

barren cobalt
#

yep. thank you for the support. very much appreciated ๐Ÿ™‚ so fast