/** * Return payment receiver. * * @param $paymentReceiverOption * @param $itemId * * @return null|string */ protected function getPaymentReceiver($paymentReceiverOption, $itemId) { if ($this->params->get('paypal_sandbox', 1)) { return strtolower(trim($this->params->get('paypal_sandbox_business_name'))); } else { if (strcmp('site_owner', $paymentReceiverOption) === 0) { // Site owner return strtolower(trim($this->params->get('paypal_business_name'))); } else { if (!JComponentHelper::isEnabled('com_crowdfundingfinance')) { return null; } else { $payout = new Crowdfundingfinance\Payout(JFactory::getDbo()); $payout->load(array('project_id' => $itemId)); if (!$payout->getPaypalEmail()) { return null; } return strtolower(trim($payout->getPaypalEmail())); } } } }