You are here

function _uc_recurring_uc_authorizenet_cim_paymentprofile_update_request in UC Recurring Payments and Subscriptions 7.2

Same name and namespace in other branches
  1. 6.2 includes/uc_recurring.uc_authorizenet.inc \_uc_recurring_uc_authorizenet_cim_paymentprofile_update_request()

TODO: This function needs to be moved to the uc_authorizenet module and renamed to: _uc_authorizenet_cim_paymentprofile_update_request($order, $ref_id)

1 call to _uc_recurring_uc_authorizenet_cim_paymentprofile_update_request()
_uc_recurring_uc_authorizenet_cim_update_paymentprofile in includes/uc_recurring.uc_authorizenet.inc
TODO: This function needs to be moved to the uc_authorizenet module and renamed to: uc_authorizenet_cim_update_paymentprofile($order, $ref_id)

File

includes/uc_recurring.uc_authorizenet.inc, line 307
Uc recurring implementation for the test gateway module.

Code

function _uc_recurring_uc_authorizenet_cim_paymentprofile_update_request($order, $ref_id) {
  $profile = _uc_authorizenet_cim_profile_get($order, $ref_id);
  if ($profile['resultCode'] == 'Error') {
    return $profile;
  }
  else {
    $request = array(
      'refId' => substr($order->order_id . '-' . REQUEST_TIME, 0, 20),
      'customerProfileId' => $profile['customerProfileId'],
      'paymentProfile' => array(
        'billTo' => _uc_authorize_cim_xml_billto($order),
        'payment' => array(
          'creditCard' => array(
            'cardNumber' => $order->payment_details['cc_number'],
            'expirationDate' => $order->payment_details['cc_exp_year'] . '-' . str_pad($order->payment_details['cc_exp_month'], 2, '0', STR_PAD_LEFT),
          ),
        ),
        'customerPaymentProfileId' => $profile['customerPaymentProfileId'],
      ),
    );
    return $request;
  }
}