You are here

function _uc_authorizenet_cim_payment_profile_get in Ubercart 8.4

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

Gets a CIM payment profile stored at auth.net.

File

payment/uc_authorizenet/uc_authorizenet.module, line 183
Processes payments using Authorize.net. Supports AIM and ARB.

Code

function _uc_authorizenet_cim_payment_profile_get(OrderInterface $order, $profile_id, $payment_profile_id) {
  $server = variable_get('uc_authnet_cim_mode', 'disabled');
  $request = [
    'customerProfileId' => $profile_id,
  ];

  // Request a profile from auth.net.
  $xml = _uc_authorizenet_xml_api_wrapper('getCustomerPaymentProfileRequest', _uc_authorizenet_array_to_xml($request));

  // Parse the response.
  $response = _uc_authorizenet_cim_parse_response(uc_authorizenet_xml_api($server, $xml));
  return $response['resultCode'] == 'Error' ? FALSE : $response;
}