Download the PHP package ejosterberg/opensalestax-sylius without Composer

On this page you can find all versions of the php package ejosterberg/opensalestax-sylius. 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-sylius

opensalestax-sylius

Sylius bundle that replaces Sylius's built-in tax calculation with destination-based US sales tax computed by a self-hosted OpenSalesTax engine.

CI

Free, self-hostable, no per-transaction fees, no SaaS lock-in. The merchant runs both Sylius and the OpenSalesTax engine on their own infrastructure.

Status

v0.1.0-alpha.1 — initial release. Single-line tax calculation through a Sylius TaxCalculationStrategy, USD/US gating, fail-soft engine error handling, optional per-state nexus filter.

Install

Register the bundle in config/bundles.php:

Add a config file at config/packages/opensalestax_sylius.yaml:

Then in Sylius admin (Configuration → Channels → <your channel> → Tax Calculation Strategy), select OpenSalesTax. Place a test order shipping to a US ZIP — destination-based tax appears on the order.

How it works

  1. Sylius invokes OstaxTaxationStrategy::applyTaxes() once per order during checkout recalculation.
  2. The strategy reads the destination ZIP / state / currency / country off the order's shipping address.
  3. For each OrderItemUnit, it asks OstaxCalculator for the tax amount. The calculator gates on USD-only, US-only, nexus-state filter, then calls the OST engine via POST /v1/calculate.
  4. Per-unit tax is added as an adjustment of type tax labeled OpenSalesTax.

Cache: each (zip, category, cents) tuple is memoized in Symfony's cache.app PSR-6 pool for cache_ttl_seconds (default 1 hour).

Behavior matrix

Order shape What happens
USD, US ship-to, valid 5-digit ZIP, in-nexus Engine called; tax adjustment added
Non-USD currency 0.0 tax — Sylius's other strategies / built-in TaxRate rows handle it
Non-US ship-to country 0.0 tax (constitution §5)
Missing or invalid ZIP 0.0 tax
nexus_states set + ship-to state not on list 0.0 tax
Engine unreachable, fail_hard: false (default) 0.0 tax + warning logged
Engine unreachable, fail_hard: true Throws — surfaces as a Sylius checkout error

What this bundle does NOT do

Configuration reference

Key Type Default Description
engine_url string (required) Base URL of the OST engine. Must be http:// or https://.
api_key string|null null Optional API key (sent as X-API-Key header).
timeout_seconds float 5.0 Per-request timeout.
fail_hard bool false When true, engine errors throw and surface as Sylius errors. Default: fail-soft (return 0, log warning).
default_category enum general OST category sent for line items with no per-product mapping. One of general, clothing, groceries, prescription_drugs, prepared_food, digital_goods.
nexus_states string[] [] Allowlist of US state codes (e.g. ['MN', 'WI']). Empty = collect everywhere.
cache_ttl_seconds int 3600 Cache TTL for engine results. 0 disables caching.

Compatibility

Sylius OST engine This bundle
^1.13 v0.14+ (v1 API) 0.1.x

License

Dual-licensed under your choice of:

See LICENSE for the SPDX declaration. The dual licensing exists to keep the OpenSalesTax portfolio's licensing footprint consistent across ecosystems.

Contributing

See CONTRIBUTING.md. DCO sign-off required on every commit.

Disclaimer

This bundle calculates US sales tax. It does not file returns, remit collected tax, or validate exemption certificates against state DOR systems. The merchant remains responsible for filing and remittance.


All versions of opensalestax-sylius with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-json Version *
ejosterberg/opensalestax Version ^0.3.0
psr/cache Version ^2.0 || ^3.0
psr/log Version ^2.0 || ^3.0
symfony/config Version ^6.4 || ^7.0
symfony/dependency-injection Version ^6.4 || ^7.0
symfony/http-kernel Version ^6.4 || ^7.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-sylius contains the following files

Loading the files please wait ...