protected function _getConsumerInformation() { $consumerInformation = parent::_getConsumerInformation(); $dob = $this->getCustomerDob(); if (empty($consumerInformation)) { //if consumerInformation has been disabled we have to send at least mandatory invoice fields $billingAddress = $this->getOrder()->getBillingAddress(); $consumerInformation['consumerBillingFirstName'] = $billingAddress->getFirstname(); $consumerInformation['consumerBillingLastName'] = $billingAddress->getLastname(); $consumerInformation['consumerBillingAddress1'] = $billingAddress->getStreet1(); $consumerInformation['consumerBillingCity'] = $billingAddress->getCity(); $consumerInformation['consumerBillingCountry'] = $billingAddress->getCountry(); $consumerInformation['consumerBillingZipCode'] = $billingAddress->getPostcode(); $consumerInformation['consumerEmail'] = $this->getOrder()->getCustomerEmail(); $consumerInformation['consumerBirthDate'] = $dob->format('Y-m-d'); } else { $consumerInformation['consumerBirthDate'] = $dob->format('Y-m-d'); } return $consumerInformation; }
protected function _getConsumerInformation() { $consumerInformation = parent::_getConsumerInformation(); $billingAddress = $this->getOrder()->getBillingAddress(); if (empty($consumerInformation)) { //if consumerInformation has been disabled we have to send at least mandatory invoice fields $consumerInformation['consumerBillingFirstname'] = $billingAddress->getFirstname(); $consumerInformation['consumerBillingLastname'] = $billingAddress->getLastname(); $consumerInformation['consumerBillingAddress1'] = $billingAddress->getStreet1(); $consumerInformation['consumerBillingCity'] = $billingAddress->getCity(); $consumerInformation['consumerBillingCountry'] = $billingAddress->getCountry(); $consumerInformation['consumerBillingZipCode'] = $billingAddress->getPostcode(); $consumerInformation['consumerEmail'] = $this->getOrder()->getCustomerEmail(); } $consumerInformation['companyName'] = $billingAddress->getCompany(); if (strlen($billingAddress->getData('vat_id'))) { $consumerInformation['companyVatId'] = $billingAddress->getData('vat_id'); } if (strlen($this->getCompanyTradeRegistrationNumber())) { $consumerInformation['companyTradeRegistryNumber'] = $this->getCompanyTradeRegistrationNumber(); } if (isset($consumerInformation['consumerBirthDate'])) { unset($consumerInformation['consumerBirthDate']); } return $consumerInformation; }