Search code examples
phpstripe-paymentsstripe-tax

Apply a Tax rate to a Stripe Payment Intent


Is it possible to add tax rate automatically for each payment intent?

I have fixed tax which is 19% and it is under some id, like: txr_9uuad8a9sud89...

I create the Payment Intent like this:

$intent = \Stripe\PaymentIntent::create([
            'payment_method' => $paymentMethods["data"][0]["id"],
            'amount' => 11111,
            'currency' => 'eur',
            'customer' => $user->stripe_id,
            'confirmation_method' => 'automatic',
            'confirm' => true,
        ]);

But cannot find a way how to automatically apply tax for this payment.

Any help?


Solution

  • Tax rates can only be applied to Invoices or Subscriptions. To include tax on individual payments you'd have to calculate it yourself and add it to the amount of the PaymentIntent.