Closed carlosten closed 4 years ago
We'll need some more info on how the tax rate and subscription set up as well as some code to reproduce the problem.
Plan in € 10€ monthly charge No trial
Creating payment method:
public function create(Request $request)
{
$user = Auth::user();
$paymentMethod = $request->stripePaymentMethod;
$user->createOrGetStripeCustomer();
$user->addPaymentMethod($paymentMethod);
Creating subscription:
$product_stripe_id = $request->product_stripe_id;
$plan_stripe_id = $request->plan_stripe_id;
$days = now()->diffInDays($user->trial_ends_at);
try {
$subscription = $user->newSubscription($product_stripe_id, $plan_stripe_id)->trialDays($days)->create($paymentMethod, [
'email' => $user->email,
]);
} catch (IncompletePayment $exception) {
return redirect()->route(
'cashier.payment', [$exception->payment->id, 'redirect' => route('account')]
);
}
}
To get the invoices:
$user = Auth::user();
$invoices = $user->invoices();
In template:
<td><a href="/user/invoice/{{ $invoice->id }}">Download</a></td>
public function taxRates()
{
return ["txr_1F***j"];
}
This is how the Stripe invoice looks, with the taxes shown. The problem is only in the invoice generated by Cashier.
Thanks for the info. I probably won't have time to look into this until next week at the earliest.
Managed to reproduce this. Will look into it.
Sent in a PR for this: https://github.com/laravel/cashier/pull/876
Fixed on master
Description:
Created a subscription with the new taxRates() and the pdf invoice generated by Cashier is not showing any tax percentage. The subscription is correctly created in Stripe (with the proper Tax Rates).
Steps To Reproduce:
Generate a PDF invoice using Cashier
Expected:
The generated invoice includes the taxes percentage.
Result:
Remarks:
In cashier/src/InvoiceLineItem.php line 135, $this->item->tax_rates is empty when generating the invoice.
To generate the expected invoice I changed this property with $this->item->tax_amounts.