/** * Add additional functionality for Billpay to document template * * @param \Template $objTemplate * @param IsotopeProductCollection $objCollection * @param IsotopeDocument $objDocument */ public function addToDocumentTemplate(\Template $objTemplate, IsotopeProductCollection $objCollection, IsotopeDocument $objDocument) { $objTemplate->billpay = false; /** @type Order $objCollection */ if ($objCollection instanceof Order && $objCollection->hasPayment() && $objCollection->getPaymentMethod() instanceof BillpayWithSaferpay) { $arrPayment = deserialize($objCollection->payment_data); if (!empty($arrPayment) && is_array($arrPayment) && is_array($arrPayment['POSTSALE'])) { $doc = new \DOMDocument(); $doc->loadXML(end($arrPayment['POSTSALE'])); $this->objXML = $doc->getElementsByTagName('IDP')->item(0)->attributes; $objTemplate->billpay = true; $objTemplate->billpay_accountholder = $this->getPostValue('POB_ACCOUNTHOLDER'); $objTemplate->billpay_accountnumber = $this->getPostValue('POB_ACCOUNTNUMBER'); $objTemplate->billpay_bankcode = $this->getPostValue('POB_BANKCODE'); $objTemplate->billpay_bankname = $this->getPostValue('POB_BANKNAME'); $objTemplate->billpay_payernote = $this->getPostValue('POB_PAYERNOTE'); } } }