mero/correios

与Correios Web服务集成

0.1.3 2017-06-04 04:27 UTC

This package is auto-updated.

Last update: 2024-09-17 05:46:59 UTC


README

SensioLabsInsight Build Status Coverage Status Latest Stable Version Total Downloads License

Correios Web服务的集成。

需求

  • PHP 5.4或更高版本
  • SOAP扩展

使用composer安装

  1. 打开您的项目目录;
  2. 运行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'