Skip to content
Learnomy

Tax (Flat Rate)

Learnomy can add one flat tax rate on top of every paid checkout, for basic compliance. It applies to both Stripe and PayPal. You turn it on, set a percentage, and name it (Tax, VAT, GST). The tax shows on the order summary and is charged on top of the course or plan price.

What you can do

  • Add a single percentage tax to paid Stripe and PayPal purchases with one toggle, so the same course costs the same whichever gateway your customer picks.
  • Set the rate to any value from 0 to 100 percent, with two-decimal precision (for example 20 or 7.5).
  • Name the tax whatever your region calls it -- Tax, VAT, GST -- and that label shows on the order summary.
  • Show the tax as its own line on the checkout order summary, with the total updating as the buyer applies a coupon.
  • Charge the tax on top of the price (exclusive), not carved out of it.
  • Leave per-region rates, exemptions, and tax reporting to the WooCommerce gateway, which brings its own tax engine, when a single flat rate is not enough.

Tax (Flat Rate) first view

How to use it

Step 1 -- open the Tax card

Go to Learnomy Settings > Settings, open the Payments section, and find the Tax card.

Step 2 -- turn on tax collection

Switch on Collect tax (labelled "Add a flat tax rate to paid checkouts"). When it is on, the tax shows on the order summary and on the secure card form, and is charged on top of the price. Both Stripe and PayPal charge it, on one-time purchases and on subscriptions.

Step 3 -- set the rate

In Tax rate (%), enter a single percentage applied to every paid purchase, for example 20 for 20%. The field accepts values from 0 to 100 in steps of 0.01.

Step 4 -- name the tax

In Tax label, enter what to call the tax on the order summary, for example Tax, VAT, or GST. If you leave it blank it falls back to "Tax."

Step 5 -- save and check the checkout

Save the section, then open a paid course checkout. The order summary shows a tax line with your label and rate, and the total is the price plus tax. If the buyer applies a coupon, the tax recalculates on the discounted price and the total updates.

Settings and options

The Tax card lives in the Payments section of Learnomy Settings > Settings.

Field What it is
Collect tax Master toggle. Stored as tax_enabled in learnomy_settings. When off, no tax line is shown and no tax is charged.
Tax rate (%) A single percentage applied to every paid purchase. Stored as tax_rate. Clamped to the 0-100 range.
Tax label The name shown on the order summary next to the rate. Stored as tax_label. Falls back to "Tax" when blank.

How the tax behaves at checkout:

  • Order summary -- when tax is on, a tax line shows the label, the rate in brackets, and the amount. The total is price minus any coupon, plus tax.
  • Exclusive -- the rate is added on top of the price, not extracted from it.
  • Stripe -- the tax is added to the amount Stripe charges. For subscriptions, Learnomy attaches a Stripe TaxRate so the tax is itemised on Stripe's own invoices.
  • PayPal -- the tax is added to the amount PayPal charges. On a one-time purchase it is sent as its own line in the amount breakdown, so the buyer sees it on PayPal's own review screen instead of a silently larger total. On a subscription it is applied to the billing plan. If you have also set a tax rate inside the PayPal billing plan itself, the Learnomy rate replaces it rather than stacking on top.
  • WooCommerce -- when WooCommerce is your gateway it uses its own tax engine, so this flat rate does not apply there. Use it for per-region rates, exemptions, and reporting.

For developers

Settings keys (all under the learnomy_settings option):

  • tax_enabled -- bool, the master toggle.
  • tax_rate -- float percentage in [0, 100].
  • tax_label -- string shown on the order summary.

Both gateways resolve the rate through the same two helpers in includes/functions.php, so a gateway can never drift out of step with the setting:

  • \Learnomy\tax_rate() -- the rate as a percentage in [0, 100]. Returns 0 when tax is off.
  • \Learnomy\tax_amount( float $subtotal ) -- the tax owed on a subtotal at that rate, exclusive, rounded to 2dp.

Stripe adapter (Learnomy\Adapters\Stripe_Adapter):

  • Tax on one-time PaymentIntents is added to the charged amount, and the tax amount rides along in the PaymentIntent metadata key learnomy_tax so the webhook can record it without re-reading settings.
  • For subscriptions, a Stripe TaxRate is resolved and cached per mode and rate in the learnomy_stripe_taxrate_{mode}_{rate} option, and applied as the subscription's default tax rate so Stripe itemises the tax on renewals.

PayPal adapter (Learnomy\Adapters\PayPal_Adapter):

  • One-time payments send an amount breakdown on the purchase unit (item_total plus tax_total), which PayPal requires to sum exactly to the order total. That is what itemises the tax on PayPal's review screen.
  • Subscriptions apply the rate via plan_overrides.taxes.percentage on the subscription, on top of the billing plan.

Related setting:

  • commission_tax_in_base (in learnomy_settings) controls whether collected tax is included in the commission split base. Leave it off so tax a gateway collects is set aside before the split.

Related