Laravel Cashier Stripe apply taxes depends on user location
I have setup cashier and subscription but having issue to charge user taxes depends of their state location. For example if user enter billing address from Ontario, Canada he will be charge one tax, if user enter Alberta, Canada another tax will apply. I have enter this code in User model to apply taxes but its not working
public function taxRates() { $stripe = new StripeClient(env('STRIPE_SECRET')); $taxRates = []; $taxes = $stripe->taxRates->all(); foreach ($taxes->data as $tax){ if(($tax->jurisdiction == $this->state) && ($tax->active == true)){ $taxRates[] = $tax->id; } } return $taxRates; }
Please or to participate in this conversation.