AeatClient
in package
Class to communicate with the AEAT web service endpoint for VERI*FACTU
Table of Contents
Methods
- __construct() : mixed
- Class constructor
- send() : PromiseInterface<string|int, AeatResponse>
- Send invoicing records
- setCertificate() : $this
- Set certificate
- setEntitySeal() : $this
- Set entity seal
- setProduction() : $this
- Set production environment
- setRepresentative() : $this
- Set representative
Methods
__construct()
Class constructor
public
__construct(ComputerSystem $system, FiscalIdentifier $taxpayer[, Client|null $httpClient = null ]) : mixed
Parameters
- $system : ComputerSystem
-
Computer system details
- $taxpayer : FiscalIdentifier
-
Taxpayer details (party that issues the invoices)
- $httpClient : Client|null = null
-
Custom HTTP client, leave empty to create a new one
send()
Send invoicing records
public
send(array<string|int, RegistrationRecord|CancellationRecord> $records) : PromiseInterface<string|int, AeatResponse>
Parameters
- $records : array<string|int, RegistrationRecord|CancellationRecord>
-
Invoicing records
Tags
Return values
PromiseInterface<string|int, AeatResponse> —Response from service
setCertificate()
Set certificate
public
setCertificate(string $certificatePath[, string|null $certificatePassword = null ]) : $this
NOTE: The certificate path must have the ".p12" extension to be recognized as a PFX bundle.
Parameters
- $certificatePath : string
-
Path to encrypted PEM certificate or PKCS#12 (PFX) bundle
- $certificatePassword : string|null = null
-
Certificate password or
nullfor none
Return values
$this —This instance
setEntitySeal()
Set entity seal
public
setEntitySeal(bool $entitySeal) : $this
Parameters
- $entitySeal : bool
-
Pass
truefor entity seal certificate,falsefor regular certificate
Return values
$this —This instance
setProduction()
Set production environment
public
setProduction(bool $production) : $this
Parameters
- $production : bool
-
Pass
truefor production,falsefor testing
Return values
$this —This instance
setRepresentative()
Set representative
public
setRepresentative(FiscalIdentifier|null $representative) : $this
NOTE: Requires the represented fiscal entity to fill the "GENERALLEY58" form at AEAT.
Parameters
- $representative : FiscalIdentifier|null
-
Representative details (party that sends the invoices)
Return values
$this —This instance