Download the PHP package lsr/abra-flexi without Composer

On this page you can find all versions of the php package lsr/abra-flexi. 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 abra-flexi

LSR ABRA Flexi

lsr/abra-flexi provides typed invoice and price-list adapters over spojenet/flexibee, with guarded HTTP transport, sanitized diagnostics, and optional Nette DI registration.

The package issues invoices, looks them up by an application-supplied external ID, downloads their PDFs, and reads catalogue prices. It does not depend on an application's App\ namespace or require LSR Core.

Requirements

Currency scope: all monetary integers represent hundredths of the configured company's domestic currency. For example, 12100 means 121.00 CZK when currencyCode is CZK. The adapter does not perform foreign-currency conversion or infer currencies' decimal precision. Request and returned invoice currencies must match the configuration. The application owns currency eligibility and tax policy.

Installation

Install the released package from Packagist:

No sibling checkout or custom Composer repository is required. For local package development, use a temporary Composer path repository with symlinking and dev-main; remove that override and reinstall the released version before deployment.

Nette DI

Register the extension and a logger in application-owned NEON:

Replace the example connection settings, supply credentials through the application's parameter/secret integration, and explicitly enable access. Keep the service reference @logger unquoted. If the application already has a logger, reference that service instead of registering another. Omitting logger requires an unambiguous autowired Psr\Log\LoggerInterface.

The extension registers AbraFlexiConfiguration, AbraFlexiClientFactory, AbraFlexiInvoiceGateway, and AbraFlexiPriceListGateway under the chosen extension prefix. Inject the gateways by type into application services.

See the configuration schema. Defaults are:

Option Default Meaning
enabled false Explicitly enable provider access.
apiUrl, company, username, password Empty strings Required connection settings. apiUrl must use HTTPS.
currencyCode CZK Configured domestic currency; three uppercase letters.
timeout 30 Positive request timeout in seconds.
verifyTls true Verify the peer certificate and hostname. Keep enabled in production.
pdfReportName null Optional provider report name.
pdfLanguage null Optional cs, sk, en, or de.
traceCurl false Opt in to bounded, allowlisted cURL diagnostics.
logger null Autowire a PSR-3 logger unless a service is selected explicitly.

The package does not read environment variables itself. Username and password support dynamic Nette parameters; register them as dynamic with Nette's ParametersExtension before compilation if secrets must be supplied at container instantiation rather than embedded in the compiled container.

Direct construction

Without a Nette container, construct the gateways directly. The environment variable names below are an application convention, not package configuration keys:

Missing credentials or invalid connection settings do not enable access. Gateway instances hold mutable SDK clients for one fixed company: reuse them sequentially, not concurrently, and do not share them across tenants.

Price-list lookup

Using the $priceList gateway above:

The result is a PriceListItem, or null when a fresh HTTP 200, 204, or 404 response establishes an empty or missing record. It exposes the code, name, currency, gross and net price amounts (priceAmountMinor and netPriceAmountMinor), and provider price/VAT type codes. Lookup trims surrounding whitespace and accepts an optional code: prefix. The remaining code must contain 1–64 printable bytes and is sent as an encoded literal selector, not filter syntax.

Invalid lookup input raises InvalidArgumentException; unavailable configuration or SDK failures raise RuntimeException; incomplete or malformed price data raises UnexpectedValueException. Other HTTP statuses or a missing response status remain failures even when the response body is empty. Price-list errors do not use the invoice failure enum. SDK exception messages and previous-exception chains are not forwarded.

Issue an invoice

The following request represents one item with a gross price of 121.00 CZK, net 100.00 CZK, and VAT 21.00 CZK. The document and VAT type codes are illustrative: choose codes and tax treatment valid for the company. The application must durably assign the external ID before submitting a write.

Null optional codes and dates are omitted so the ABRA document defaults apply. For complete billing details, pass an IssueInvoiceRecipient; recipientName is only an explicit name fallback when no recipient is supplied. The package checks the country-code shape, not customer or country eligibility.

The next call writes to ABRA. Run it only from an application-owned operation that has persisted the identity and applies its own concurrency and recovery policy:

The returned IssuedInvoice includes internal and external IDs, document number, type, series, dates, currency, and net/VAT/gross totals. Issuance verifies the returned identity, currency, totals, and explicitly requested type, series, and relevant dates.

Request invariants

Lookup, PDFs, and recovery

Use the same durable external ID for subsequent operations:

Lookup returns IssuedInvoice|null. PDF download returns InvoicePdf with bytes and mediaType; it verifies the invoice identity and a %PDF- prefix. It does not perform full PDF parsing, write a file, calculate a storage hash, or deliver the document. Storage, access control, and delivery remain application responsibilities.

A failed PDF transport does not leave the gateway in PDF mode: the prior SDK format is restored, or the unusable client is discarded. Cleanup preserves the original sanitized download failure.

Invoice operations throw InvoiceGatewayException. Inspect its failure enum rather than matching message text:

Failure Application response
ConfigurationDisabled Enable access or correct connection/PDF configuration.
Retryable Schedule another attempt under application policy; the package performs no retries.
AmbiguousWrite A write may have succeeded. Reconcile using the same external ID before any further write.
RejectedRequest Correct invalid request data or a provider rejection.
IdentityConflict Investigate an identity, requested-data mismatch, or missing invoice during PDF retrieval. Do not overwrite blindly.
InvalidResponse Investigate malformed/incompatible provider data. After issuance, reconcile rather than assuming no write occurred.

When the SDK write/readback call fails, only a rejection observed on the write itself is definitive. A failed readback, including HTTP 404 after an accepted HTTP 201 write, produces AmbiguousWrite.

issue() does not perform a lookup-first deduplication check, and the package does not guarantee exactly-once execution. Persist request intent and identity, serialize competing operations in the application, and compare recovered invoices against the expected accounting snapshot. A failed or temporarily empty lookup after an ambiguous write is not proof that creating another invoice is safe. Do not generate a new identity merely because a request timed out. PDF failures likewise do not justify reissuing an invoice.

Transport and logging

Purchase identities and roles, customer/country eligibility, order-number derivation, accounting snapshots, lifecycle transitions, retry scheduling, persistence, PDF storage, and customer delivery belong to the consuming application. In an extraction from an existing application, retain its durable identity scheme instead of adopting the example ID above.

Development

From a package checkout:

Use composer cs:fix to apply formatting. GitHub Actions CI runs the checks on PHP 8.4 and 8.5 on Ubuntu 24.04 for pushes, pull requests, and manual dispatches. The test suite includes local TLS/redirect, real SDK request, sanitized diagnostic, and Nette DI checks; it does not contact a production ABRA service.

License

Licensed under the MIT License.


All versions of abra-flexi with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
php-64bit Version *
ext-curl Version *
ext-json Version *
lib-curl Version >=7.85
guzzlehttp/psr7 Version ^2.7
nette/di Version ^3.2
nette/schema Version ^1.3
psr/http-message Version ^1.1|^2.0
psr/log Version ^3.0
spojenet/flexibee Version ^3.7
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 lsr/abra-flexi contains the following files

Loading the files please wait ...