modules/acm/src/APIHelper.php
public function cleanCustomerData(array $customer) {
    if (isset($customer['customer_id'])) {
      $customer['customer_id'] = (string) $customer['customer_id'];
    }

    if (isset($customer['addresses'])) {
      // When deleting an address need to re-index array.
      $customer['addresses'] = array_values($customer['addresses']);
      foreach ($customer['addresses'] as $delta => $address) {
        $address = (array) $address;
        $customer['addresses'][$delta] = $this->cleanCustomerAddress($address);
      }
    }

    return $customer;
  }
public function cleanCustomerData(array $customer) {
    if (isset($customer['customer_id'])) {
      $customer['customer_id'] = (string) $customer['customer_id'];
    }

    if (isset($customer['addresses'])) {
      // When deleting an address need to re-index array.
      $customer['addresses'] = array_values($customer['addresses']);
      foreach ($customer['addresses'] as $delta => $address) {
        $address = (array) $address;
        $customer['addresses'][$delta] = $this->cleanCustomerAddress($address);
      }
    }

    return $customer;
  }
public function cleanCustomerData ( array $ customer ) { if ( isset ( $ customer [ 'customer_id' ] ) ) { $ customer [ 'customer_id' ] = ( string ) $ customer [ 'customer_id' ] ; } if ( isset ( $ customer [ 'addresses' ] ) ) { // When deleting an address need to re-index array. $ customer [ 'addresses' ] = array_values ( $ customer [ 'addresses' ] ) ; foreach ( $ customer [ 'addresses' ] as $ delta => $ address ) { $ address = ( array ) $ address ; $ customer [ 'addresses' ] [ $ delta ] = $ this -> cleanCustomerAddress ( $ address ) ; } } return $ customer ; }
Clean customer data before sending to API.

@param array $customer
Customer data.

@return array
Cleaned customer data.
Clean customer data before sending to API .