You are here

function uc_ups_void_shipment_request in Ubercart 5

Same name and namespace in other branches
  1. 8.4 shipping/uc_ups/uc_ups.module \uc_ups_void_shipment_request()
  2. 6.2 shipping/uc_ups/uc_ups.module \uc_ups_void_shipment_request()
  3. 7.3 shipping/uc_ups/uc_ups.module \uc_ups_void_shipment_request()
1 call to uc_ups_void_shipment_request()
uc_ups_void_shipment in shipping/uc_ups/uc_ups.module

File

shipping/uc_ups/uc_ups.module, line 1424
Shipping quote module that interfaces with www.ups.com to get rates for small package shipments.

Code

function uc_ups_void_shipment_request($shipment_number, $tracking_numbers = array()) {
  $schema = uc_ups_access_request();
  $schema .= '<?xml version="1.0"?>';
  $schema .= '<VoidShipmentRequest>';
  $schema .= '<Request>';
  $schema .= '<RequestAction>Void</RequestAction>';
  $schema .= '<TransactionReference>';
  $schema .= '<CustomerContext>';
  $schema .= t('Void shipment @ship_number and tracking numbers @track_list', array(
    '@ship_number' => $shipment_number,
    '@track_list' => implode(', ', $tracking_numbers),
  ));
  $schema .= '</CustomerContext>';
  $schema .= '<XpciVersion>1.0</XpciVersion>';
  $schema .= '</TransactionReference>';
  $schema .= '</Request>';
  $schema .= '<ExpandedVoidShipment>';
  $schema .= '<ShipmentIdentificationNumber>' . $shipment_number . '</ShipmentIdentificationNumber>';
  foreach ($tracking_numbers as $number) {
    $schema .= '<TrackingNumber>' . $number . '</TrackingNumber>';
  }
  $schema .= '</ExpandedVoidShipment>';
  $schema .= '</VoidShipmentRequest>';
  return $schema;
}