....
function UPSRequest($postdata,$type){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://wwwcie.ups.com/ups.app/xml/$type");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
function ValidateUSAAddress($zip) {
$xml="<?xml version='1.0'?>";
$xml.="<AccessRequest>";
$xml.="<AccessLicenseNumber>".$this->LicenceNumber."</AccessLicenseNumber>";
$xml.="<UserId>".$this->UserID."</UserId><Password>".$this->Password."</Password></AccessRequest>";
$xml.="<?xml version='1.0'?><AddressValidationRequest xml:lang='en-US'><Request>";
$xml.="<TransactionReference><CustomerContext>Maryam Dennis-Customer Data</CustomerContext>";
$xml.="<XpciVersion>1.0001</XpciVersion></TransactionReference><RequestAction>AV</RequestAction></Request>";
$xml.="<Address>";
$xml.="<PostalCode>$zip</PostalCode></Address>";
$xml.="</AddressValidationRequest>";
$result=$this->UPSRequest($xml,"AV");
....
I used CURL-functions for UPS address validation.
But now I can't use this function in the script.
(It connected with the hosting features).
Can I use address validation via HTTPS UPS protocol
without CURL?
Can you write some rows of code as an example?
If it is not very complicated for you, of course.