jerfeson/correios
Composer 安装命令:
composer require jerfeson/correios
包简介
A library that facilitates integration with Brazilian postal services
README 文档
README
This library facilitates the integration with the Correios delivery services of Brazil on php
Functionalities
Installation
- Using composer
$ composer require jerfeson/correios
How to use
Consult address by zip code
use Jerfeson\Correios; require 'vendor/autoload.php'; $correios = new Correios(); $repsonse = $correios->address()->find("73100‑020"); /** result [ 'zipcode' => '01001-000', 'street' => 'Praça da Sé', 'complement' => [ 'lado ímpar', ], 'district' => 'Sé', 'city' => 'São Paulo', 'uf' => 'SP', ] **/
Calculate Prices and Deadlines
Calculate prices and terms of delivery services (Sedex, PAC and etc), with support for multiple objects in the same query.
use Jerfeson\Correios; require 'vendor/autoload.php'; $correios = new Correios(); $response = $correios->freight() ->origin('01001-000') ->destination('73100‑020') ->services(FreightType::SEDEX, FreightType::PAC) ->item(16, 16, 16, .3, 1)->calculate(); /** result [ 0 => [ 'name' => 'Sedex', 'code' => '4014', 'price' => 35.1, 'deadline' => 4, 'error' => [], ], 1 => [ 'name' => 'PAC', 'code' => '4510', 'price' => 24.8, 'deadline' => 8, 'error' =>[], ], ] */
How to test
$ composer test
Roadmap
- CodeCoverage
License
jerfeson/correios is release under the MIT license.
Thanks
This project is based on the project in flyingluscas/correios-php feel free to contribute to this and the other project.
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-18