Documentation

Tools
in package

Table of Contents

Properties

$ambiente  : string
ambiente
$config  : stdClass
config class
$contingency  : Contingency
contingency class
$lastRequest  : string
last soap request
$lastResponse  : string
last soap response
$pathschemes  : string
Path to schemes folder
$pathwsfiles  : string
Path to storage folder
$soap  : SoapInterface
soap class
$tpAmb  : int
Environment
$verAplic  : string
Application version
$algorithm  : int
Sign algorithm from OPENSSL
$availableVersions  : array<string|int, mixed>
$canonical  : array<string|int, mixed>
Canonical conversion options
$certificate  : Certificate
certificate class
$modelo  : int
Model of CTe 57 or 67
$objHeader  : SOAPHeader
$soapnamespaces  : array<string|int, mixed>
$timezone  : string
$urlAction  : string
$urlcUF  : string
urlcUF
$urlHeader  : string
$urlMethod  : string
$urlNamespace  : string
$urlOperation  : string
$urlPortal  : string
urlPortal Instância do WebService
$urlService  : string
urlService
$urlVersion  : string
urlVersion
$versao  : string
Version of layout

Methods

__construct()  : mixed
Constructor load configurations, load Digital Certificate, map all paths, set timezone and and instanciate Contingency::class
canonicalOptions()  : array<string|int, mixed>
Set option for canonical transformation see C14n
getAcronym()  : string
Recover state acronym from cUF number
getcUF()  : int
Recover cUF number from state acronym
getModalXML()  : string|bool
loadSoapClass()  : void
Load Soap Class Soap Class may be \NFePHP\Common\Soap\SoapNative or \NFePHP\Common\Soap\SoapCurl
model()  : int
Set or get model of document CTe = 57 or CTeOS = 67
setEnvironment()  : void
Alter environment from "homologacao" to "producao" and vice-versa
setEnvironmentTimeZone()  : void
Sets environment time zone
setSignAlgorithm()  : void
Set OPENSSL Algorithm using OPENSSL constants
setVerAplic()  : mixed
Set application version
signCTe()  : string
Sign CTe
validKeyByUF()  : string
Validate cUF from the key content and returns the state acronym
version()  : string
Set or get parameter layout version
addQRCode()  : string
Add QRCode Tag to signed XML from a NFCe
checkContingencyForWebServices()  : mixed
Verifies the existence of the service
checkSoap()  : mixed
Verify if SOAP class is loaded, if not, force load SoapCurl
correctCTeForContingencyMode()  : string
getXmlUrlPath()  : string
Recover path to xml data base with list of soap services
isValid()  : bool
Performs xml validation with its respective XSD structure definition document NOTE: if dont exists the XSD file will return true
sendRequest()  : string
Send request message to webservice
servico()  : void
Assembles all the necessary parameters for soap communication
setEnvironmentHttpVersion()  : void
set version in http

Properties

$ambiente

ambiente

public string $ambiente = 'homologacao'

$config

config class

public stdClass $config

$lastRequest

last soap request

public string $lastRequest = ''

$lastResponse

last soap response

public string $lastResponse = ''

$pathschemes

Path to schemes folder

public string $pathschemes = ''

$pathwsfiles

Path to storage folder

public string $pathwsfiles = ''

$soap

soap class

public SoapInterface $soap

$tpAmb

Environment

public int $tpAmb = 2

$verAplic

Application version

public string $verAplic = ''

$algorithm

Sign algorithm from OPENSSL

protected int $algorithm = OPENSSL_ALGO_SHA1

$availableVersions

protected array<string|int, mixed> $availableVersions = ['4.00' => 'PL_CTe_400']

$canonical

Canonical conversion options

protected array<string|int, mixed> $canonical = [true, false, null, null]

$certificate

certificate class

protected Certificate $certificate

$modelo

Model of CTe 57 or 67

protected int $modelo = 57

$objHeader

protected SOAPHeader $objHeader

$soapnamespaces

protected array<string|int, mixed> $soapnamespaces = ['xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance", 'xmlns:xsd' => "http://www.w3.org/2001/XMLSchema", 'xmlns:soap' => "http://www.w3.org/2003/05/soap-envelope"]

$timezone

protected string $timezone

$urlAction

protected string $urlAction = ''

$urlcUF

urlcUF

protected string $urlcUF = ''

$urlHeader

protected string $urlHeader = ''

$urlMethod

protected string $urlMethod = ''

$urlNamespace

protected string $urlNamespace = ''

$urlOperation

protected string $urlOperation = ''

$urlPortal

urlPortal Instância do WebService

protected string $urlPortal = 'http://www.portalfiscal.inf.br/cte'

$urlService

urlService

protected string $urlService = ''

$urlVersion

urlVersion

protected string $urlVersion = ''

$versao

Version of layout

protected string $versao = '4.00'

Methods

__construct()

Constructor load configurations, load Digital Certificate, map all paths, set timezone and and instanciate Contingency::class

public __construct(string $configJson, Certificate $certificate) : mixed
Parameters
$configJson : string

content of config in json format

$certificate : Certificate

canonicalOptions()

Set option for canonical transformation see C14n

public canonicalOptions([array<string|int, mixed> $opt = [true, false, null, null] ]) : array<string|int, mixed>
Parameters
$opt : array<string|int, mixed> = [true, false, null, null]
Return values
array<string|int, mixed>

getAcronym()

Recover state acronym from cUF number

public getAcronym(int $cUF) : string
Parameters
$cUF : int
Return values
string

acronym sigla

getcUF()

Recover cUF number from state acronym

public getcUF(string $acronym) : int
Parameters
$acronym : string

Sigla do estado

Return values
int

number cUF

getModalXML()

public getModalXML(mixed $dom, mixed $modal) : string|bool
Parameters
$dom : mixed
$modal : mixed
Tags
todo

Retorna o xml do modal especifico

Return values
string|bool

loadSoapClass()

Load Soap Class Soap Class may be \NFePHP\Common\Soap\SoapNative or \NFePHP\Common\Soap\SoapCurl

public loadSoapClass(SoapInterface $soap) : void
Parameters
$soap : SoapInterface

model()

Set or get model of document CTe = 57 or CTeOS = 67

public model([int $model = null ]) : int
Parameters
$model : int = null
Return values
int

modelo class parameter

setEnvironment()

Alter environment from "homologacao" to "producao" and vice-versa

public setEnvironment([int $tpAmb = 2 ]) : void
Parameters
$tpAmb : int = 2

setEnvironmentTimeZone()

Sets environment time zone

public setEnvironmentTimeZone(string $acronym) : void
Parameters
$acronym : string

(ou seja a sigla do estado)

setSignAlgorithm()

Set OPENSSL Algorithm using OPENSSL constants

public setSignAlgorithm([int $algorithm = OPENSSL_ALGO_SHA1 ]) : void
Parameters
$algorithm : int = OPENSSL_ALGO_SHA1

setVerAplic()

Set application version

public setVerAplic(string $ver) : mixed
Parameters
$ver : string

signCTe()

Sign CTe

public signCTe(string $xml) : string
Parameters
$xml : string

CTe xml content

Tags
throws
RuntimeException
Return values
string

singed CTe xml

validKeyByUF()

Validate cUF from the key content and returns the state acronym

public validKeyByUF(string $chave) : string
Parameters
$chave : string
Tags
throws
InvalidArgumentException
Return values
string

version()

Set or get parameter layout version

public version([string $version = '' ]) : string
Parameters
$version : string = ''
Tags
throws
InvalidArgumentException
Return values
string

addQRCode()

Add QRCode Tag to signed XML from a NFCe

protected addQRCode(DOMDocument $dom) : string
Parameters
$dom : DOMDocument
Return values
string

checkContingencyForWebServices()

Verifies the existence of the service

protected checkContingencyForWebServices(string $service) : mixed
Parameters
$service : string
Tags
throws
RuntimeException

checkSoap()

Verify if SOAP class is loaded, if not, force load SoapCurl

protected checkSoap() : mixed

correctCTeForContingencyMode()

protected correctCTeForContingencyMode(string $xml) : string
Parameters
$xml : string

CTe xml content

Tags
todo

Corret CTe fields when in contingency mode is set

Return values
string

getXmlUrlPath()

Recover path to xml data base with list of soap services

protected getXmlUrlPath() : string
Return values
string

isValid()

Performs xml validation with its respective XSD structure definition document NOTE: if dont exists the XSD file will return true

protected isValid(string $version, string $body, string $method) : bool
Parameters
$version : string

layout version

$body : string
$method : string
Return values
bool

sendRequest()

Send request message to webservice

protected sendRequest(string $request[, array<string|int, mixed> $parameters = [] ]) : string
Parameters
$request : string
$parameters : array<string|int, mixed> = []
Return values
string

servico()

Assembles all the necessary parameters for soap communication

protected servico(string $service, string $uf, string $tpAmb[, bool $ignoreContingency = false ]) : void
Parameters
$service : string
$uf : string
$tpAmb : string
$ignoreContingency : bool = false

setEnvironmentHttpVersion()

set version in http

private setEnvironmentHttpVersion() : void

        
On this page

Search results