UBLUploadResponse
extends ANAFResponse
in package
Represents the response structure for @see \EdituraEDU\ANAF\ANAFAPIClient::UploadEFactura()
Table of Contents
Properties
- $IndexIncarcare : string|null
- $LastError : Throwable|null
- $rawResponse : string|null
- $ResponseTimestamp : int|null
Methods
- CreateError() : UBLUploadResponse
- HasError() : bool
- IsSuccess() : bool
- Parse() : void
- CommonParseJSON() : stdClass|array<string|int, mixed>|null
- InternalCreateError() : void
- Utility method for implementers to create an error
- convertToTimestamp() : int
- Convert date string to timestamp
- isErrorResponse() : bool
- Used to check if API response is a specific type of error. Can be indicative of a bad request/invalid input data
- isJson() : bool
- Used to check if API response is JSON Answers that are JSON are errors
- parseJSON() : void
- Parse JSON error
- parseXML() : void
- Parse response XML
Properties
$IndexIncarcare
public
string|null
$IndexIncarcare
= null
$LastError
public
Throwable|null
$LastError
= null
$rawResponse
public
string|null
$rawResponse
= null
$ResponseTimestamp
public
int|null
$ResponseTimestamp
= null
Methods
CreateError()
public
static CreateError(Throwable $error) : UBLUploadResponse
Parameters
- $error : Throwable
Return values
UBLUploadResponseHasError()
public
HasError() : bool
Return values
boolIsSuccess()
public
IsSuccess() : bool
Return values
boolParse()
public
Parse() : void
CommonParseJSON()
protected
CommonParseJSON(string|null $response) : stdClass|array<string|int, mixed>|null
Parameters
- $response : string|null
Return values
stdClass|array<string|int, mixed>|nullInternalCreateError()
Utility method for implementers to create an error
protected
InternalCreateError(string $message[, int $code = ANAFException::UNKNOWN_ERROR ][, Throwable|null $previous = null ]) : void
Parameters
- $message : string
- $code : int = ANAFException::UNKNOWN_ERROR
- $previous : Throwable|null = null
convertToTimestamp()
Convert date string to timestamp
private
convertToTimestamp(string $dateStr, string $format) : int
Parameters
- $dateStr : string
- $format : string
Return values
intisErrorResponse()
Used to check if API response is a specific type of error. Can be indicative of a bad request/invalid input data
private
isErrorResponse(string $response) : bool
Parameters
- $response : string
Return values
boolisJson()
Used to check if API response is JSON Answers that are JSON are errors
private
isJson(string $string) : bool
Parameters
- $string : string
Return values
boolparseJSON()
Parse JSON error
private
parseJSON(string $jsonString) : void
Parameters
- $jsonString : string
parseXML()
Parse response XML
private
parseXML(string $xmlString) : void
Parameters
- $xmlString : string