You are here

function _uc_recurring_cybersource_billto_obj in UC Recurring Payments and Subscriptions 6.2

Same name and namespace in other branches
  1. 7.2 includes/uc_recurring.uc_cybersource.inc \_uc_recurring_cybersource_billto_obj()

Create a billTo SOAP object from an order

Parameters

$order Order object:

2 calls to _uc_recurring_cybersource_billto_obj()
_uc_recurring_cybersource_create_profile in includes/uc_recurring.uc_cybersource.inc
Set up a CyberSource customer profile
_uc_recurring_uc_cybersource_update_paymentprofile in includes/uc_recurring.uc_cybersource.inc
Update the payment profile

File

includes/uc_recurring.uc_cybersource.inc, line 442
Uc recurring implementation for the CyberSource module.

Code

function _uc_recurring_cybersource_billto_obj($order) {
  $billing_country = uc_get_country_data(array(
    'country_id' => $order->billing_country,
  ));
  $billTo = new stdClass();
  $billTo->firstName = $order->billing_first_name;
  $billTo->lastName = $order->billing_last_name;
  $billTo->street1 = $order->billing_street1;
  if ($order->billing_street2) {
    $billTo->street2 = $order->billing_street2;
  }
  $billTo->city = $order->billing_city;
  $billTo->state = uc_get_zone_code($order->billing_zone);
  $billTo->postalCode = $order->billing_postal_code;
  $billTo->country = $billing_country[0]['country_iso_code_2'];
  if ($order->billing_phone) {
    $billTo->phoneNumber = $order->billing_phone;
  }
  $billTo->email = $order->primary_email;
  $billTo->customerID = $order->uid;
  return $billTo;
}