/** * Build PayerInfo for Payer * * @param $quote * @return PayerInfo */ protected function buildPayerInfo($quote) { $payerInfo = new PayerInfo(); $address = $quote->getBillingAddress(); if ($address->getFirstname()) { $payerInfo->setFirstName($address->getFirstname()); } if ($address->getMiddlename()) { $payerInfo->setMiddleName($address->getMiddlename()); } if ($address->getLastname()) { $payerInfo->setLastName($address->getLastname()); } $billingAddress = $this->buildBillingAddress($quote); if ($billingAddress) { $payerInfo->setBillingAddress($billingAddress); } return $payerInfo; }