Download the PHP package matiz-studio-creative/sri-toolkit without Composer

On this page you can find all versions of the php package matiz-studio-creative/sri-toolkit. 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 sri-toolkit

SRI Toolkit

Latest Version on Packagist Total Downloads

PHP toolkit for Ecuador SRI electronic documents. It helps generate access keys, build XML documents, sign them with XAdES-BES using PKCS#12 certificates, and send signed XML to the SRI reception and authorization web services.

Documentation

Full documentation is available at sri-toolkit.matizstudiocreative.com.

Features

Requirements

The CI suite currently runs against PHP 8.2, 8.3, 8.4 and 8.5.

Installation

Supported Documents

Access key generation exposes the six SRI electronic document codes from the official offline technical sheet:

Code Document Access key
01 Invoice DocumentType::Invoice
03 Purchase settlement DocumentType::PurchaseSettlement
04 Credit note DocumentType::CreditNote
05 Debit note DocumentType::DebitNote
06 Remission guide DocumentType::RemissionGuide
07 Withholding receipt DocumentType::RetentionVoucher

XML generation currently supports:

Code Document Enum XML version
01 Invoice XmlDocumentType::Invoice 2.1.0
03 Purchase settlement XmlDocumentType::PurchaseSettlement 1.1.0
04 Credit note XmlDocumentType::CreditNote 1.1.0
05 Debit note XmlDocumentType::DebitNote 1.0.0
06 Delivery guide XmlDocumentType::DeliveryGuide 1.1.0
07 Withholding receipt XmlDocumentType::WithholdingReceipt 2.0.0

Catalogs

Common document codes are available through a runtime-overridable catalog registry based on the official offline technical sheet v2.26 and the ICE annex.

PHP reserves list as a declared method name, so CatalogRegistry also exposes entries('payment-methods') for static-analysis-friendly code. The magic $catalogRegistry->list(...) call is supported for compatibility with the TypeScript API shape.

Common Document Codes

Identification types (customer.identification_type, subject.identification_type, carriers):

Code Type
04 Taxpayer ID
05 National ID
06 Passport
07 Final consumer
08 Foreign ID

VAT (percentage_code when tax code is 2):

Code Rate Notes
0 0% VAT 0%
2 12% Historical
3 14% Historical
4 15% Common current rate
5 5% Added by official sheet v2.26
6 0% Not subject to tax
7 0% VAT exempt
8 variable Differentiated VAT
10 13% Added by official sheet v2.26

Payment methods:

Code Description
01 No financial system used
15 Debt compensation
16 Debit card
17 Electronic money
18 Prepaid card
19 Credit card
20 Other financial system method
21 Title endorsement

VAT withholding (code: '2', withholding_code):

Code Rate
9 10%
10 20%
1 30%
11 50%
2 70%
3 100%
7 0%, zero withholding
8 0%, withholding does not apply

Full catalog: use $catalogRegistry->list('vat-withholding').

Quick Start

Generate an Access Key

If numericCode is omitted, the package generates a random 8-digit numeric code.

Generate XML

The payload shape depends on the selected document type. Invalid or incomplete payloads throw XML generation exceptions.

Sign XML

The XML root must contain the expected SRI document id:

The signer uses the SRI-compatible XMLDSig/XAdES-BES structure implemented by this package.

Send to SRI

The sender uses the official SRI WSDL URLs for testing and production based on SenderConfig.

Development

Install dependencies:

Run tests:

Run the full quality suite:

Useful commands:

The documentation site is built with VitePress:

Security

This package handles private keys, certificate passwords, signed XML and taxpayer data. Store certificates outside the repository and web root, keep passwords in a secret manager or protected environment variable, and avoid logging signed XML or SOAP traces in production.

See security guidance in the documentation.

License

This package is open-sourced software licensed under the MIT license.


All versions of sri-toolkit with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-dom Version *
ext-libxml Version *
ext-openssl Version *
ext-soap Version *
aws/aws-sdk-php Version ^3.381
ramsey/uuid Version ^4.9
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 matiz-studio-creative/sri-toolkit contains the following files

Loading the files please wait ...