Pop\Payment\Adapter\PayLeap::buildExtData PHP Метод

buildExtData() защищенный Метод

Build the ExtData XML string
protected buildExtData ( ) : string
Результат string
    protected function buildExtData()
    {
        $ext = null;
        if (null !== $this->transaction['TaxAmt']) {
            $ext .= '<TaxAmt>' . $this->transaction['TaxAmt'] . '</TaxAmt>';
        }
        if (null !== $this->transaction['CustomerID']) {
            $ext .= '<CustomerID>' . $this->transaction['CustomerID'] . '</CustomerID>';
        }
        if (null !== $this->transaction['PONum']) {
            $ext .= '<PONum>' . $this->transaction['PONum'] . '</PONum>';
        }
        if (null !== $this->transaction['FNameOnCard'] || null !== $this->transaction['LNameOnCard'] || null !== $this->transaction['Street'] || null !== $this->transaction['City'] || null !== $this->transaction['State'] || null !== $this->transaction['Zip'] || null !== $this->transaction['Country'] || null !== $this->transaction['Email'] || null !== $this->transaction['Phone'] || null !== $this->transaction['Fax']) {
            $ext .= '<Invoice><BillTo>';
            if (null !== $this->transaction['CustomerID']) {
                $ext .= '<CustomerID>' . $this->transaction['CustomerID'] . '</CustomerID>';
            }
            if (null !== $this->transaction['FNameOnCard'] || null !== $this->transaction['LNameOnCard']) {
                $ext .= '<Name>' . $this->transaction['FNameOnCard'] . ' ' . $this->transaction['LNameOnCard'] . '</Name>';
            }
            $ext .= '<Address>';
            $ext .= '<Street>' . $this->transaction['Street'] . '</Street>';
            $ext .= '<City>' . $this->transaction['City'] . '</City>';
            $ext .= '<State>' . $this->transaction['State'] . '</State>';
            $ext .= '<Zip>' . $this->transaction['Zip'] . '</Zip>';
            $ext .= '<Country>' . $this->transaction['Country'] . '</Country>';
            $ext .= '</Address>';
            if (null !== $this->transaction['Email']) {
                $ext .= '<Email>' . $this->transaction['Email'] . '</Email>';
            }
            if (null !== $this->transaction['Phone']) {
                $ext .= '<Phone>' . $this->transaction['Phone'] . '</Phone>';
            }
            if (null !== $this->transaction['Fax']) {
                $ext .= '<Fax>' . $this->transaction['Fax'] . '</Fax>';
            }
            if (null !== $this->transaction['PONum']) {
                $ext .= '<PONum>' . $this->transaction['PONum'] . '</PONum>';
            }
            $ext .= '</BillTo></Invoice>';
        }
        return $ext;
    }