Add Tax/VAT to Cashier Subscription Hi all,
In my user model I use the BillableTrait but no where in there does it show how to add Tax/VAT.
In my billing class I have.
$user->subscription('proovide-sub')->create($token, ['email' => $user->email, 'tax_percent' => '20.0']);
But this doesn't pass the email through nor does it pass the tax_percent even though I reviewed Stripe docs.
Anyone know if this correct or am I missing something?
Anyone know how to do this?
I would say because with the above method you create a new customer which is passed to a subscription.
The tax_percent is only available if you create a new subscription.
no im wrong .. mh thats a good question :)
try
$user->subscription('proovide-sub')->create($token, ['email' => $user->email, 'tax_percent' => 20.00]);
Yes it is a good question the $email gets passed but nothing else.
maybe with my updated answer ?
Yes just trying that now thanks,
That doesn't work either, but looking at the buildPayload method
protected function buildPayload()
{
$payload = [
'plan' => $this->plan, 'prorate' => $this->prorate,
'quantity' => $this->quantity, 'trial_end' => $this->getTrialEndForUpdate(),
];
if ($this->coupon) $payload['coupon'] = $this->coupon;
return $payload;
}
There's no mention of tax_percent
Ok.
This
$user->subscription('proovide-sub')->create($token,
['tax_percent' => 20.0,
'email' => $user->email,
'description' => 'Adds a description'],
null);
Adds a description but still nothing on the tax
For a quick work around I added 'tax_percent' => $this->tax_percent to the buildPayload method then added a protected property protected $tax_percent = 20.0;
And this work around is working ?
Yes, not ideal, but least it's a work around if you know how to do a PR (as I don't) feel free to use this.
You can see it adds it. But surely a PR with what we've talked about should solve this issue to get Taylor to sort it out.
@lstables I had to do the same exact thing. My question to you is, did you figure out how to show the tax as a line item in the PDF? Cheers.
Please sign in or create an account to participate in this conversation.