Download the PHP package ejosterberg/opensalestax-drupal-commerce without Composer

On this page you can find all versions of the php package ejosterberg/opensalestax-drupal-commerce. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package opensalestax-drupal-commerce

OpenSalesTax for Drupal Commerce

v0.1.1. Live-validated against Drupal 11 + Drupal Commerce 3.3.5 on PHP 8.4 (\$100 / MN ZIP 55401 → 6 per-jurisdiction adjustments totalling \$9.03). Passes 56 unit tests on PHP 8.2–8.4; PHPStan level max clean; composer audit clean. CI green on main.

A free, self-hostable Drupal Commerce 3.x tax type plugin that swaps manual tax-rate tables for destination-based US sales tax via the OpenSalesTax engine. No per-transaction fees, no SaaS lock-in — merchants run both Drupal Commerce and OpenSalesTax on their own infrastructure.

Tax calculations are provided as-is for convenience. The merchant is solely responsible for tax-collection accuracy and remittance to the appropriate jurisdictions. Verify against your state Department of Revenue before remitting.

What this module does

What this module does NOT do

Compatibility matrix

Drupal core Drupal Commerce PHP Status
10.3+ 3.x 8.1+ tested
11.0+ 3.x 8.1+ should work

The module hard-pins calculation-only behavior — no schema changes, no service overrides. It coexists with Drupal Commerce's built-in flat-rate tax types and applies first when its applies() gate matches.

Install

The Composer install transparently pulls in the ejosterberg/opensalestax PHP SDK.

Configure

Visit Commerce → Configuration → OpenSalesTax (/admin/commerce/config/opensalestax).

Field Default Purpose
Engine API URL (empty) Base URL of your OpenSalesTax engine, e.g. https://ost.example.com. Empty = module inert.
API Key (optional) (empty) X-API-Key header value if your engine requires authentication. Stored as a config string; blank-field-on-save preserves the existing key.
Restrict to public IPs (SSRF defense) ON Reject any engine URL whose host resolves to a private, loopback, link-local, CGNAT, or multicast IP. Turn OFF only when the engine is on the same private network as Drupal (e.g. http://10.x.x.x:8080).
Cache TTL (seconds) 86400 (24h) How long to cache engine responses per (zip5, line-signature). Minimum 3600.
Engine HTTP timeout (seconds) 10 Maximum wait for the engine before falling back.
Fail hard on engine error OFF When ON, an unreachable engine blocks checkout. When OFF (default), the failure is logged and checkout proceeds with no tax line.

Then add OpenSalesTax (Destination-Based US Sales Tax) as the Tax Type on each store via Commerce → Configuration → Taxes.

How it works

  1. At checkout, Drupal Commerce's tax pipeline iterates over enabled tax types and calls applies($order) on each.
  2. Our plugin's applies() short-circuits to FALSE on non-US, non-USD, missing ZIP, or missing shipping profile.
  3. When applies() returns TRUE, Drupal Commerce calls apply($order). We normalize the order into (country, currency, zip5, line_items[]), look up the cache, and on miss call the engine via the PHP SDK.
  4. For each tax line returned, we write a per-jurisdiction Drupal\commerce_order\Adjustment of type tax with the jurisdiction's name as label and opensalestax:<jurisdiction> as source ID.
  5. Drupal Commerce's totals pipeline picks the adjustments up and renders them.

If anything goes wrong (engine down, timeout, bad payload), and Fail hard on engine error is OFF (default), the failure is logged via Drupal's opensalestax logger channel and no adjustments are written — checkout proceeds without tax. The merchant then resolves the engine outage at their own pace without customer-visible breakage.

Logging

All engine interactions log structured metadata (zip5, http_status, error message) via Drupal's opensalestax logger channel. Customer addresses and full payloads are never logged. The API key is read from config in memory only at request time and never written to logs.

Development

CI runs the same three checks plus a DCO sign-off check on PRs.

See CONTRIBUTING.md for branch model, DCO sign-off, and the quality gate.

Security

See SECURITY.md for responsible-disclosure guidance and docs/SECURITY-REVIEW.md for the threat model with mitigation status.

Related projects

License

Dual-licensed under your choice of Apache-2.0 OR LICENSE for the dual-declaration. Drupal contrib code lives under GPL-2.0-or-later; this dual license keeps the module eligible for future Drupal.org listing while preserving Apache-2.0 compatibility for downstream redistribution.

DCO sign-off

Every commit signed off with -s. CI rejects unsigned commits. See CONTRIBUTING.md.


All versions of opensalestax-drupal-commerce with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ejosterberg/opensalestax Version ^0.1
psr/log Version ^1.0 || ^2.0 || ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ejosterberg/opensalestax-drupal-commerce contains the following files

Loading the files please wait ...