This article is for an older version of the plugin
If you're looking for the latest version of the documentation, click here

Complying with tax rules other than flat rate

Create your custom tax implementation if you need to comply with complex tax rules.


WP Full Stripe supports charging tax on top of subscription payments since v3.12.0 .

You can use the following tax calculation strategies:

  • No tax
  • Flat rate
  • Custom rate

When selecting “Custom rate”, you have to provide your own calculator implementation for the tax rate to be used.

You can implement a tax rate calculator as a Wordpress filter. The implementation can take into consideration form data like billing address, custom fields, etc.

How to set up a custom tax rate filter

Setting up a custom tax rate filter is comprises the following steps:

  1. Configure the tax related options on the “Finance” tab of the form:
    • Tax rate: Custom rate
    • Collect billing address: Yes
    • Default Billing Country: Select the country you’ll issue the invoices from.
      (The selected country is passed as the “From country” parameter to the filter, see below) WP Full Stripe - Subscription settings for custom tax rate
  2. Add your filter code to the functions.php file of the active Wordpress theme. This ensures the code will not be overwritten when WP Full Stripe is updated. Still, you have to reinsert the code when the theme is updated.

Function signature of custom tax rate filters

Your custom tax rate filter must conform to the following function signature:

Please note that you have to add your filter in WordPress, otherwise it will not be called:

Example implementation: EU VAT rate filter

The following example takes into account the supplier’s and the buyer’s country to determine the tax rate for e-goods. We are emphasizing e-goods because tax rules are different for e-goods and physical goods in the European Union.

The example calculates the tax rate based on the following table: WP Full Stripe - VAT rules in the European Union

The implementation uses two custom fields for company name and EU VAT ID. It considers the entered data as a business if either the company name or the VAT ID is filled in. The code can be refined by adding real-time verification for EU VAT IDs.

Here is how the two custom fields are set up on the subscription form: WP Full Stripe - Custom field configuration for the EU VAT filter example

Here is the example EU VAT filter code:


This custom tax filter example is provided as is, only for the purpose of demonstrating the possibilities of custom tax filters that can be written for WP Full Stripe. You are granted the permission to use it, modify it, and redistribute it as you wish. Neither Mammothology nor Infinea Consulting Ltd can be held accountable for any inconsistencies, omissions, or bugs in the example code.

Still not finding the solution?

Our support team is happy to help you.

Contact support

Feature requests are always welcome!
We consider each feature request carefully, and examine how it fits the roadmap for the plugin.