You are here

function _uc_authorize_cim_xml_shipto in Ubercart 6.2

Same name and namespace in other branches
  1. 8.4 payment/uc_authorizenet/uc_authorizenet.module \_uc_authorize_cim_xml_shipto()
  2. 5 payment/uc_authorizenet/uc_authorizenet.module \_uc_authorize_cim_xml_shipto()
  3. 7.3 payment/uc_authorizenet/uc_authorizenet.module \_uc_authorize_cim_xml_shipto()

Map an order's shipping information to an array for later XML conversion.

1 call to _uc_authorize_cim_xml_shipto()
_uc_authorizenet_cim_profile_create_request in payment/uc_authorizenet/uc_authorizenet.module
Helper to create the CIM profile creation request.

File

payment/uc_authorizenet/uc_authorizenet.module, line 1148
Process payments using Authorize.net. Supports AIM and ARB.

Code

function _uc_authorize_cim_xml_shipto($order) {
  $delivery_country = uc_get_country_data(array(
    'country_id' => $order->delivery_country,
  ));
  return array(
    'firstName' => substr($order->delivery_first_name, 0, 50),
    'lastName' => substr($order->delivery_last_name, 0, 50),
    'company' => substr($order->delivery_company, 0, 50),
    'address' => substr($order->delivery_street1, 0, 60),
    'city' => substr($order->delivery_city, 0, 40),
    'state' => substr(uc_get_zone_code($order->delivery_zone), 0, 2),
    'zip' => substr($order->delivery_postal_code, 0, 20),
    'country' => !$delivery_country ? '' : $delivery_country[0]['country_iso_code_2'],
  );
}