1
我已經下載代碼&從「https://github.com/VinceG/USPS-php-api」爲USPS-php-api創建演示。錯誤 - USPS地址驗證PHP API
我有錯誤這樣的「陣列()布爾(真)錯誤:沒有URL集!」
請讓我知道如果您有任何解決方案。
我已經使用下面的代碼。
<?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();
}
什麼是在USPSAddressVerify.php中設置的網址? – 2013-04-29 05:04:47
請注意作者在GitHub上的公開問題,其中應該發佈解決方案:https://github.com/VinceG/USPS-php-api/issues/5 – Matt 2013-04-29 05:10:11
我能夠通過註釋掉#行來重新創建錯誤# ''$ opts [CURLOPT_URL] = self :: $ testMode? self :: TEST_API_URL:self :: LIVE_API_URL;'USPSBase.php'中。確保你正在設置'$ opts [CURLOPT_URL]'。 – Sean 2013-04-29 06:06:43