我已经下载了代码并从“创建演示” https://github.com/VinceG/USPS-php-api ”下载了代码并为 USPS-php-api 创建了演示。
我收到这样的错误“Array () bool(true) Error: No URL set!”
如果您有任何解决方案,请告诉我。
我使用了以下代码。
<?php
require_once('../USPSAddressVerify.php');
$verify = new USPSAddressVerify('xxxxxxxxxxxx'); // I have used correct username
$address = new USPSAddress;
$address->setFirmName('Apartment');
$address->setApt('100');
$address->setAddress('9200 Milliken Ave');
$address->setCity('Rancho Cucomonga');
$address->setState('CA');
$address->setZip5(91730);
$address->setZip4('');
$verify->addAddress($address);
print_r($verify->verify());
print_r($verify->getArrayResponse());
var_dump($verify->isError());
if($verify->isSuccess()) {
echo 'Done';
} else {
echo 'Error: ' . $verify->getErrorMessage();
}