# How to: Subscriptions Payment Invoice to include Tax breakdown

**URL:** https://meta.discourse.org/t/how-to-subscriptions-payment-invoice-to-include-tax-breakdown/268727
**Category:** Support
**Tags:** subscriptions
**Created:** [June 17, 2023, 11:33am UTC](https://meta.discourse.org/t/how-to-subscriptions-payment-invoice-to-include-tax-breakdown/268727 "2023-06-17T11:33:15Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![marc2](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@marc2](https://meta.discourse.org/u/marc2)
#### Post date: [June 17, 2023, 11:33am UTC](https://meta.discourse.org/t/how-to-subscriptions-payment-invoice-to-include-tax-breakdown/268727/1 "2023-06-17T11:33:15Z")

</div>

I’ve set up a membership subscription, and it works fine. However in Stripe, I’ve activated the “Include tax in price” option where it will use the currency to determine if tax is included or excluded.

When testing, the invoice that is sent to my customer does not include this tax breakdown. This is a showstopper. Is it possible to configure things so the invoice sent from stripe includes the tax breakdown?

Thanks

---

<div class="post-metadata">

### Author: ![marc2](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@marc2](https://meta.discourse.org/u/marc2)
#### Post date: [June 17, 2023, 2:13pm UTC](https://meta.discourse.org/t/how-to-subscriptions-payment-invoice-to-include-tax-breakdown/268727/2 "2023-06-17T14:13:26Z")

</div>

As a temporary fix to get it working, I’ve added the flag [Stripe API Reference - Invoices](https://stripe.com/docs/api/subscriptions/create#create_subscription-automatic_tax) to app/controllers/discourse\_subscriptions/subscribe\_controller.rb

Added:  
**automatic\_tax: { enabled: true}**

see below:

```plaintext
          transaction =
            ::Stripe::Subscription.create(
              customer: customer[:id],
              items: [{ price: params[:plan] }],
              metadata: metadata_user,
              trial_period_days: trial_days,
              promotion_code: promo_code_id,
              automatic_tax: { enabled: true}
            )

```

I believe I can run with this fix for a while, and then when it is eventually added as a feature, I can swap it back to the original. I need to consider this before I go live to make sure it isn’t going to be a big pain later.

Any thoughts on why this is a bad idea if I need it working before it is an official feature?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 17, 2023, 5:12pm UTC](https://meta.discourse.org/t/how-to-subscriptions-payment-invoice-to-include-tax-breakdown/268727/3 "2023-06-17T17:12:21Z")

</div>

> [@marc2](#):
>
> Any thoughts on why this is a bad idea if I need it working before it is an official feature?

Seems OK to me.

You can make a PR to add the feature to the plugin.

Until/unless that’s accepted, you can use a template to modify the code in the plugin inside the container after it’s been cloned. But a better idea might be to just clone the plugin.

---

<div class="post-metadata">

### Author: ![anderer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/anderer/32/310458_2.png) [@anderer](https://meta.discourse.org/u/anderer)
#### Post date: [June 18, 2023, 9:20am UTC](https://meta.discourse.org/t/how-to-subscriptions-payment-invoice-to-include-tax-breakdown/268727/4 "2023-06-18T09:20:02Z")

</div>

There is already a feature request - without solution yet

> [@Automatic\_tax.enabled for Discourse Subscription plugin](https://meta.discourse.org/t/automatic-tax-enabled-for-discourse-subscription-plugin/254606):
>
> Hello all, I use the Stripe Discourse Sub plugin an got my first subscriber. yeah slight_smile Unfortunatly the bill for this subscriber was without tax information, but which is necessary. I had contact to the stripe support and they said: I have looked at your Stripe Tax settings, Stripe Tax is configured correctly and automatic tax calculation is enabled. However, “automatic\_tax.enabled” is set to “false” (response text: line 6&7) and thus automatic tax calculation is not applied. Wh…

---

<div class="post-metadata">

### Author: ![SteveRueck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steverueck/32/248901_2.png) [@SteveRueck](https://meta.discourse.org/u/SteveRueck)
#### Post date: [June 18, 2023, 9:46am UTC](https://meta.discourse.org/t/how-to-subscriptions-payment-invoice-to-include-tax-breakdown/268727/5 "2023-06-18T09:46:46Z")

</div>

If I understand this correctly, I am not able to use this solution if I have a hosted instance of Discourse running, right?

---

<div class="post-metadata">

### Author: ![marc2](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@marc2](https://meta.discourse.org/u/marc2)
#### Post date: [June 18, 2023, 2:19pm UTC](https://meta.discourse.org/t/how-to-subscriptions-payment-invoice-to-include-tax-breakdown/268727/6 "2023-06-18T14:19:20Z")

</div>

Hi Steve, I’m a total newbie to Discourse, but if you can install plugins from any GitHub repository by updating the app.yml file and running /var/discourse/launcher rebuild app, then it should work.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [June 18, 2023, 2:42pm UTC](https://meta.discourse.org/t/how-to-subscriptions-payment-invoice-to-include-tax-breakdown/268727/7 "2023-06-18T14:42:53Z")

</div>

Hosted instances of discourse don’t typically give users ssh access, not can they edit the yml files. That’s all taken care of by their host and the plugins they have access to are set as part of the hosting package they pay for.

---

<div class="post-metadata">

### Author: ![SteveRueck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steverueck/32/248901_2.png) [@SteveRueck](https://meta.discourse.org/u/SteveRueck)
#### Post date: [June 18, 2023, 3:12pm UTC](https://meta.discourse.org/t/how-to-subscriptions-payment-invoice-to-include-tax-breakdown/268727/8 "2023-06-18T15:12:58Z")

</div>

> [@Stephen](#):
>
> Hosted instances of discourse don’t typically give users ssh access

Correct. I’ve hosted my instance by Discourse itself and I can only use the “official” plugins and on them, I am not able to change some code (except for CSS on some).

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 19, 2023, 9:44am UTC](https://meta.discourse.org/t/how-to-subscriptions-payment-invoice-to-include-tax-breakdown/268727/9 "2023-06-19T09:44:07Z")

</div>

> [@SteveRueck](#):
>
> I am not able to change some code (except for CSS on some).

You can’t change plugins, but much more then css can be changed in a theme component. You can change pretty much anything in the ember front end.

The current discussed here is on the rails side, however.

---

<div class="post-metadata">

### Author: ![SteveRueck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steverueck/32/248901_2.png) [@SteveRueck](https://meta.discourse.org/u/SteveRueck)
#### Post date: [June 19, 2023, 9:56am UTC](https://meta.discourse.org/t/how-to-subscriptions-payment-invoice-to-include-tax-breakdown/268727/10 "2023-06-19T09:56:02Z")

</div>

> [@pfaffman](#):
>
> You can’t change plugins

That’s what I meant.
