Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

theUnforgiven's avatar

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?

0 likes
12 replies
christopher's avatar

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]);
theUnforgiven's avatar

Yes it is a good question the $email gets passed but nothing else.

theUnforgiven's avatar

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

theUnforgiven's avatar

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

theUnforgiven's avatar

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;

theUnforgiven's avatar

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.

theUnforgiven's avatar

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.

WKMG's avatar

@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 or to participate in this conversation.