Download the PHP package georgesks/facter-sdk-php without Composer

On this page you can find all versions of the php package georgesks/facter-sdk-php. 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 facter-sdk-php

Facter SDK para PHP

Packagist PHP

SDK oficial en PHP para el API Externo de Facter: timbra CFDI 4.0 (Ingreso, Egreso y Pagos 2.0), administra emisores, consulta tu saldo de timbres y recibe webhooks — todo con la infraestructura de timbrado de Facter.

📚 Documentación interactiva del API: https://v2.facter.com.mx/developers

El SDK se genera desde la especificación OpenAPI oficial. No contiene lógica de negocio ni secretos: es un cliente HTTP tipado sobre el contrato público.


Instalación

Requisitos: PHP 7.4+ u 8.x, extensiones ext-json y ext-curl. Guzzle se instala como dependencia.


Ambientes

El ambiente es el host. Una API key de Demo solo funciona contra demo.facter.com.mx; una de Producción solo contra v2.facter.com.mx. No son intercambiables. Empieza siempre en Demo (timbra contra el sandbox del SAT, sin cobro real).

Ambiente Host Cobro
Environment::DEMO demo.facter.com.mx No (sandbox)
Environment::LIVE v2.facter.com.mx Sí (consume timbres)

Inicio rápido

La estructura completa del cfdi (el JSON canónico CFDI 4.0) está documentada, con ejemplos verificados, en el portal: https://v2.facter.com.mx/developers.


Idempotencia (timbrar = dinero)

Timbrar consume un timbre. El API exige Idempotency-Key en los mutadores para garantizar consumo exactamente una vez. El SDK te da claves seguras:

Regla: una clave por intento lógico. Si reintentas el mismo CFDI tras un timeout, reusa la misma clave — el API hace replay de la respuesta original en vez de timbrar otra vez.


Reintentos automáticos (respetan Retry-After)

Monta el middleware incluido para reintentar de forma segura 429 RATE_LIMITED, 409 IDEMPOTENCY_IN_FLIGHT y errores de red, respetando el header Retry-After:

Nunca reintenta errores de negocio (402 sin saldo, 422 validación) — reintentar no cambiaría el resultado.


Validar sin timbrar (dry-run)

Verifica estructura, aritmética y catálogos SAT sin consumir timbre ni requerir idempotencia:


Webhooks: verifica la firma

Facter firma cada webhook con HMAC-SHA256. Siempre verifica antes de confiar en el payload:


Manejo de errores

Toda respuesta de error sigue el envoltorio estándar del API. Las excepciones son Facter\Sdk\ApiException:


Operaciones disponibles

Recurso Clase Operaciones
CFDIs CFDIsApi Timbrar, validar, listar, consultar, XML, PDF
Cancelaciones CancelacionesApi Solicitar y consultar cancelación SAT
Emisores EmisoresApi Alta, listar, detalle, subir CSD
Timbres TimbresApi Saldo del pool, reporte de consumo

Los webhooks se configuran desde la aplicación web de Facter (Mi cuenta → Webhooks), no por el SDK/API. Lo que el SDK te da es la verificación de firma de las entregas — ver Webhooks: verifica la firma.

Referencia método por método en docs/ y en el portal https://v2.facter.com.mx/developers.


Versionado y soporte

Licencia

MIT.


All versions of facter-sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
ext-curl Version *
ext-json Version *
ext-mbstring Version *
guzzlehttp/guzzle Version ^7.3
guzzlehttp/psr7 Version ^1.7 || ^2.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 georgesks/facter-sdk-php contains the following files

Loading the files please wait ...