<ToAddress2>6060 PRIMACY PKWY</ToAddress2> <ToCity>MEMPHIS</ToCity> <ToState>TN</ToState> <ToZip5>38119</ToZip5> <ToZip4>5718</ToZip4> <WeightInOunces>2</WeightInOunces> <ServiceType>Priority</ServiceType> <POZipCode>20260</POZipCode> <ImageType>TIF</ImageType> <LabelDate>07/08/2004</LabelDate> <CustomerRefNo>A45-3928</CustomerRefNo> <AddressServiceRequested>TRUE</AddressServiceRequested> </DeliveryConfirmationV3.0Request> EOT; # Delete previous existing test labels cw_rm_dir_files($app_main_dir . "/var/tmp/usps_test_labels/"); $labels = 0; $error = array(); $_log = ''; foreach ($usps_methods as $method => $data) { foreach ($data['xml_requests'] as $xml_id => $xml_data) { $_log .= "************************************************************************************************\n\n"; $_log .= "[{$method}]\n\n"; $_log .= "[REQUEST {$xml_id}]:\n\n" . $xml_data['xml_request'] . "\n\n"; $request = $server . "?API=" . $data['api'] . "&XML=" . urlencode($xml_data['xml_request']); $_log .= "[SEND REQUEST TO URL]:\n\n" . $request . "\n\n"; # Sending secure GET request to USPS (for first-type image) list($header, $return) = cw_https_request("GET", $request); $_log .= "[RESPONSE]:\n\n" . $header . "\n\n" . $return . "\n\n"; # Parcing first USPS response $response = cw_usps_parce_result($return, $data['xml_head'], $xml_data['file_type']);
function cw_rm_dir($path) { cw_rm_dir_files($path); @rmdir($path); }