Correios Php’s Docs¶
Table of Contents:¶
Installation¶
At the command line:
composer require "eduardokum/correios-php"
Or, Put in your composer.json file:
{
"eduardokum/correios-php": "~0.1"
}
Configuration¶
Testing¶
To create a configuration, just instantiate the object or simply pass null to the classes.
$config = new Testing();
Production¶
To create a configuration, just instantiate the object and pass on your correct information
$config = new Production();
$sender = new Sender();
$sender->setLogo('/path/to/logo')
->setName('Company')
->setStreet('Street')
->setNumber('Number')
->setComplement('Complement')
->setDistrict('District')
->setCep('000000000')
->setCity('City')
->setState('ST')
->setPhone('1199999999')
->setMail('mail@company.com');
$config->setCNPJ('00000000000000')
->setUser('user')
->setPassword('pass')
->setAdministrativeCode('12345678')
->setContract('1234567890')
->setPostCard('1234567890')
->setServiceCode('12345')
->setDirection('99')
->setSender($sender);
Or, Simply:
$config = new Production::create([
'cnpj' => '00000000000000',
'user' => 'user',
'password' => 'pass',
'administrativeCode' => '12345678',
'contract' => '1234567890',
'postCard' => '1234567890',
'serviceCode' => '12345',
'direction' => '99',
'sender' => Sender::create([
'logo' => '',
'name' => 'Company',
'street' => 'Street',
'number' => 'Number',
'complement' => 'Complement',
'district' => 'District',
'cep' => '000000000',
'city' => 'City',
'state' => 'ST',
'phone' => '1199999999',
'mail' => 'mail@company.com',
])
]);
Usage¶
Entities¶
Usage¶
- Calculo
- Used to fetch prices and deadlines for delivery of goods.
- Rastreio
- Used to fetch information from goods already shipped.
- Sigep
- Used to request tags, close pre-post objects, fetch cep’s information, fetch customer information and post card.
- Logistica
- Used to authorize return of goods.
Renderers¶
License¶
Correios Php is free software distributed under the terms of the MIT license.
Contributing¶
Support follows PSR-1
and PSR-4
PHP coding standards. Additionally the source code follows the PSR-2
code style and the builds check it.
Please report any issue you find in the issues page.
Pull requests are always welcome.
Support¶
The easiest way to get help is to open an issue on Github.
The mailing list at https://groups.google.com/forum/#!forum/correios-php is also available for support.