getService('klaviyops.prestashop_services.context'); /** @var CustomerService $customerService */ $customerService = $module->getService('klaviyops.prestashop_services.customer'); /** @var CustomerEventService $customerEventService */ $customerEventService = $module->getService('klaviyops.klaviyo_service.customer_event_service'); if ($normalizedCustomer === null) { $normalizedContext = $contextService->normalize([ 'id_shop' => $id_shop, ]); $normalizedCustomer = $customerService->normalize( $customer, $normalizedContext ); } return array_merge( self::removeSensitiveKeys($customer, self::SENSITIVE_KEYS), array('addresses' => array_values($customer->getSimpleAddresses())), $customerEventService->buildPayloadForWebservice($normalizedCustomer) ); } }