mero / correios
与Correios Web服务集成
0.1.3
2017-06-04 04:27 UTC
Requires
- php: >=5.4.9
- ext-soap: *
Requires (Dev)
- phpunit/phpunit: ~4.4
- satooshi/php-coveralls: ~0.6.1
This package is auto-updated.
Last update: 2024-09-17 05:46:59 UTC
README
与Correios Web服务的集成。
需求
- PHP 5.4或更高版本
- SOAP扩展
使用composer安装
- 打开您的项目目录;
- 运行
composer require mero/correios
以将Mero Correios
添加到您的项目供应商。
客户端方法
用法
声明一个Mero\Correios\Client
对象实例,并使用客户端中的可用方法。
示例
<?php $correios = new \Mero\Correios\Client(); $address = $correios->findAddressByZipCode('22640102'); // Return Address object related to '22640-102' zip-code. echo $address->getAddress(); // Return the address 'Avenida das Américas' echo $address->getNeighborhood(); // Return the neighborhood 'Barra da Tijuca' echo $address->getCity(); // Return the city 'Rio de Janeiro' echo $address->getState(); // Return the state 'RJ' echo $address->getZipCode(); // Return the address '22640102'