2017 © Pedro Peláez
 

library laravel-afip-wrapper

Afip Web Service wrapper for Laravel

image

hazzo/laravel-afip-wrapper

Afip Web Service wrapper for Laravel

  • Friday, August 18, 2017
  • by hazzo
  • Repository
  • 0 Watchers
  • 0 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 4 Versions
  • 29 % Grown

The README.md

Laravel AFIP Web Service Wrapper

AFIP technical documentation for their Web Service AFIP Web Service, (*1)

Installation

Type in your terminal:, (*2)

composer require hazzo/LaravelAfipWrapper

Register AfipWrapper by adding it to the service providers on the app.php., (*3)

'providers' => array(
        ...
        hazzo\LaravelAfipWrapper\Providers\AfipWsServiceProvider::class
    )

Let's add the facade in the bottom of the same file in aliases., (*4)

'aliases' => array(
        ...
        'AfipWS' => hazzo\LaravelAfipWrapper\Facades\AfipWs::class,
    )

Publish the package configuration file., (*5)

php artisan vendor:publish --provider="hazzo\laravel-afip-wrapper\Providers\AfipWsServiceProvider" --tag="config"

Configuration

Config file options:, (*6)

Option Default Values
afipTempFolder '' (Automatically the package will choose /temp as folder in root directory) Any string. Ex.: storage_path('app/afip')
afipEnvironment '' (Automatically the package will choose DEV environment) Two options DEV or PROD, for homologation and production endpoints for AFIP Web Service.

Usage samples

Generate token and sign to get auth data and perform later actions., (*7)

Options array for method generateLTR (LoginTicketRequest):, (*8)

  • cuit: Cuit of user that is going to use the web service
  • cn: commonName field of user that is going to use the web service
  • id: 32 bit digit that together with genTime will be used by the web service to identify the request
  • privateKey: Path where the private key generated by the AFIP site is stored
  • pemCert: Path where the CSR Certificate used to generate the private key is stored
  • genTime: Generation time of the authentication. Must be ISO8601 formatted. If not given the pacakge will set it to today
  • expTime: Expiration time of the authentication. Must be ISO8601 formatted. If not given the pacakge will set it to today + 24hs. The max tolerance for expiration is 24hs from the generation time.
use hazzo\LaravelAfipWrapper\AfipWs;

   $afipWs = new AfipWs();

   $options = [
       'cuit' => '2020200200',
       'cn' => 'test',
       'id' => 1,
       'privateKey' => './AfipPrivateKey.key',
       'pemCert' => './MyPEMKey.crt'
   ];

   $ltr = $afipWs->generateLTR($options);
   $afipWs->generateTRA($ltr);

   var_dump($afipWs->token);
   var_dump($afipWs->sign);
   var_dump($afipWs->cuit);

The Versions

18/08 2017

dev-dev

dev-dev

Afip Web Service wrapper for Laravel

  Sources   Download

MIT

The Requires

 

by Guido Eduardo Ceraso

laravel package afip afipws afip web service

17/08 2017

dev-master

9999999-dev

Afip Web Service wrapper for Laravel

  Sources   Download

MIT

The Requires

 

by Guido Eduardo Ceraso

laravel package afip afipws afip web service

17/08 2017

v1.0.0-beta2

1.0.0.0-beta2

Afip Web Service wrapper for Laravel

  Sources   Download

MIT

The Requires

 

by Guido Eduardo Ceraso

laravel package afip afipws afip web service

13/08 2017

v1.0.0-beta1

1.0.0.0-beta1

Afip Web Service wrapper for Laravel

  Sources   Download

MIT

The Requires

 

by Guido Eduardo Ceraso

laravel package afip afipws afip web service