#King Of Web Devs-Taxes

1 messages ยท Page 1 of 1 (latest)

lean cosmos
#

๐Ÿ‘‹ happy to help

knotty pelican
#

hi tarzan

#

i am using laravel stripe

#

but i need a way to manually apply VAT on a checkout instance

#

this auto tax thing is abysmal

lean cosmos
knotty pelican
#

do i need to set that tax rate on each individual product (line item) or can i set it globally for that checkout instance?

lean cosmos
#

are you creating Checkout for subscriptions or one-off payments?

knotty pelican
#

one off payments

#

subscriptions is fine as that pulls the taxrate via cashier

#

this is the code currently

lean cosmos
#

in one-offs you have to pass the tax by line item unfortunately

knotty pelican
#

if($currency == 'GBP'){
return $user
->allowPromotionCodes()
->checkout($OneTime, [
'automatic_tax' => [
'enabled' => true,
],
'success_url' => route('upgrade-checkout-complete') . '?session_id={CHECKOUT_SESSION_ID}',
'cancel_url' => route('upgrade-product-select'),
]);
} else {
return $user
->allowPromotionCodes()
->checkout($OneTime, [
'automatic_tax' => [
'enabled' => false,
],
'success_url' => route('upgrade-checkout-complete') . '?session_id={CHECKOUT_SESSION_ID}',
'cancel_url' => route('upgrade-product-select'),
]);
}

#

so i need to pass the tax with each product?

lean cosmos
#

yes ๐Ÿ™‚

knotty pelican
#

thanks