/** * Display a form which posts to authorize.net's server */ public function paymentForm(\Jazzee\Entity\Applicant $applicant, $amount) { if (\is_a($this->_controller, 'ApplyPageController')) { $time = time(); $fpSequence = $applicant->getId() . $time; $form = new \Foundation\Form(); $form->newHiddenElement('x_show_form', 'PAYMENT_FORM'); $form->newHiddenElement('x_amount', $amount); $form->newHiddenElement('x_test_request', $this->_controller->getConfig()->getStatus() == 'PRODUCTION' ? 0 : 1); $form->newHiddenElement('x_fp_sequence', $fpSequence); $form->newHiddenElement('x_fp_hash', \AuthorizeNetSIM_Form::getFingerprint($this->_paymentType->getVar('gatewayId'), $this->_paymentType->getVar('gatewayKey'), $amount, $fpSequence, $time)); $form->newHiddenElement('x_fp_timestamp', $time); $form->newHiddenElement('x_relay_response', "TRUE"); $form->newHiddenElement('x_relay_url', $this->_controller->getServerPath() . $this->_controller->getActionPath() . '/../../../../../transaction/' . \urlencode(get_class($this))); $form->newHiddenElement('x_cancel_url', $this->_controller->getServerPath() . $this->_controller->getActionPath()); $form->newHiddenElement('redirect_url', $this->_controller->getServerPath() . $this->_controller->getActionPath()); $form->newHiddenElement('x_login', $this->_paymentType->getVar('gatewayId')); $form->newHiddenElement('x_cust_id', $applicant->getId()); $form->newHiddenElement('x_customer_ip', $_SERVER['REMOTE_ADDR']); $form->newHiddenElement('x_email', $applicant->getEmail()); $form->newHiddenElement('x_email_customer', 0); $form->newHiddenElement('x_description', $this->_paymentType->getVar('description')); $form->setAction($this->_paymentType->getVar('testAccount') ? \AuthorizeNetDPM::SANDBOX_URL : \AuthorizeNetDPM::LIVE_URL); $field = $form->newField(); $field->setLegend($this->_paymentType->getName()); $field->setInstructions("<p>Clicking the 'Pay with Credit Card' button will redirect you to a secure payment page. Once you have completed your transaction you will be returned to the application.<strong>Application Fee:</strong> ${$amount}</p>"); $form->newButton('submit', 'Pay with Credit Card'); } else { $form = parent::paymentForm($applicant, $amount); } return $form; }
/** * Display a form which posts to authorize.net's server */ public function paymentForm(\Jazzee\Entity\Applicant $applicant, $amount) { if (\is_a($this->_controller, 'ApplyPageController')) { $time = time(); $fpSequence = $applicant->getId() . $time; $form = new \Foundation\Form(); $form->newHiddenElement('x_amount', $amount); $form->newHiddenElement('x_test_request', $this->_controller->getConfig()->getStatus() == 'PRODUCTION' ? 0 : 1); $form->newHiddenElement('x_fp_sequence', $fpSequence); $form->newHiddenElement('x_fp_hash', \AuthorizeNetDPM::getFingerprint($this->_paymentType->getVar('gatewayId'), $this->_paymentType->getVar('gatewayKey'), $amount, $fpSequence, $time)); $form->newHiddenElement('x_fp_timestamp', $time); $form->newHiddenElement('x_relay_response', "TRUE"); $form->newHiddenElement('x_relay_url', $this->_controller->getServerPath() . $this->_controller->getActionPath() . '/../../../../../transaction/' . \urlencode(get_class($this))); $form->newHiddenElement('redirect_url', $this->_controller->getServerPath() . $this->_controller->getActionPath()); $form->newHiddenElement('x_login', $this->_paymentType->getVar('gatewayId')); $form->newHiddenElement('x_cust_id', $applicant->getId()); $form->newHiddenElement('x_customer_ip', $_SERVER['REMOTE_ADDR']); $form->newHiddenElement('x_email', $applicant->getEmail()); $form->newHiddenElement('x_email_customer', 0); $form->newHiddenElement('x_description', $this->_paymentType->getVar('description')); $form->setAction($this->_paymentType->getVar('testAccount') ? \AuthorizeNetDPM::SANDBOX_URL : \AuthorizeNetDPM::LIVE_URL); $field = $form->newField(); $field->setLegend($this->_paymentType->getName()); $field->setInstructions("<p><strong>Application Fee:</strong> ${$amount}</p>"); $element = $field->newElement('TextInput', 'x_card_num'); $element->setLabel('Credit Card Number'); $element->addValidator(new \Foundation\Form\Validator\NotEmpty($element)); $element = $field->newElement('TextInput', 'x_exp_date'); $element->setLabel('Expiration Date'); $element->setFormat('mm/yy eg ' . date('m/y')); $element->addValidator(new \Foundation\Form\Validator\NotEmpty($element)); $element = $field->newElement('TextInput', 'x_card_code'); $element->setLabel('CCV'); $element->addValidator(new \Foundation\Form\Validator\NotEmpty($element)); $element = $field->newElement('TextInput', 'x_zip'); $element->setLabel('Billing Postal Code'); $element->setInstructions('US Credit Cards which do not provide a postal code will be rejected.'); $form->newButton('submit', 'Pay with Credit Card'); } else { $form = parent::paymentForm($applicant, $amount); } return $form; }
/** * PDF a full single applicant * @param \Jazzee\Entity\Applicant $applicant * @return string the PDF buffer suitable for display */ public function pdf(\Jazzee\Entity\Applicant $applicant) { $this->setFont('p'); $this->pdf->set_info("Title", $this->pdf->convert_to_unicode('utf8', $applicant->getFullName(), '') . ' Application'); $this->addText($applicant->getFullName() . "\n", 'h1'); $this->addText('Email Address: ' . $applicant->getEmail() . "\n", 'p'); $this->write(); foreach ($applicant->getApplication()->getApplicationPages(\Jazzee\Entity\ApplicationPage::APPLICATION) as $page) { if ($page->getJazzeePage() instanceof \Jazzee\Interfaces\PdfPage) { $page->getJazzeePage()->setApplicant($applicant); $page->getJazzeePage()->setController($this->_controller); $page->getJazzeePage()->renderPdfSection($this); } } $this->write(); $this->pdf->end_page_ext(""); $this->attachPdfs(); $this->pdf->end_document(""); return $this->pdf->get_buffer(); }
/** * PDF a full single applicant * @param \Jazzee\Entity\Applicant $applicant * @return string the PDF buffer suitable for display */ public function pdf(\Jazzee\Entity\Applicant $applicant) { $this->pdf->set_info("Title", $this->pdf->convert_to_unicode('utf8', $applicant->getFullName(), '') . ' Application'); $this->addText($applicant->getFullName() . "\n", 'h1'); $this->addText('Email Address: ' . $applicant->getEmail() . "\n", 'p'); if ($applicant->isLocked()) { switch ($applicant->getDecision()->status()) { case 'finalDeny': $status = 'Denied'; break; case 'finalAdmit': $status = 'Admited'; break; case 'acceptOffer': $status = 'Accepted'; break; case 'declineOffer': $status = 'Declined'; break; default: $status = 'No Decision'; } } else { $status = 'Not Locked'; } $this->addText("Admission Status: {$status}\n", 'p'); $this->write(); foreach ($applicant->getApplication()->getApplicationPages(\Jazzee\Entity\ApplicationPage::APPLICATION) as $page) { if ($page->getJazzeePage() instanceof \Jazzee\Interfaces\PdfPage) { $page->getJazzeePage()->setApplicant($applicant); $page->getJazzeePage()->setController($this->_controller); $page->getJazzeePage()->renderPdfSection($this); } } $this->write(); $this->pdf->end_page_ext(""); foreach ($applicant->getAttachments() as $attachment) { $this->addPdf($attachment->getAttachment()); } $this->attachPdfs(); $this->pdf->end_document(""); return $this->pdf->get_buffer(); }
/** * PDF a full single applicant * @param \Jazzee\Entity\Applicant $applicant * @return string the PDF buffer suitable for display */ public function pdf(\Jazzee\Entity\Applicant $applicant) { $elements = array('applicant' => array(), 'pages' => array()); $elements['applicant']['firstName'] = $applicant->getFirstName(); $elements['applicant']['lastName'] = $applicant->getLastName(); $elements['applicant']['middleName'] = $applicant->getMiddleName(); $elements['applicant']['fullName'] = $applicant->getFullName(); $elements['applicant']['suffix'] = $applicant->getSuffix(); $elements['applicant']['email'] = $applicant->getEmail(); $elements['applicant']['id'] = $applicant->getId(); $elements['applicant']['externalid'] = $applicant->getExternalId(); if ($applicant->isLocked()) { switch ($applicant->getDecision()->status()) { case 'finalDeny': $status = 'Denied'; break; case 'finalAdmit': $status = 'Admited'; break; case 'acceptOffer': $status = 'Accepted'; break; case 'declineOffer': $status = 'Declined'; break; default: $status = 'No Decision'; } } else { $status = 'Not Locked'; } $elements['applicant']['status'] = $status; foreach ($applicant->getApplication()->getApplicationPages() as $applicationPage) { if ($applicationPage->getJazzeePage() instanceof \Jazzee\Interfaces\PdfPage) { $applicationPage->getJazzeePage()->setApplicant($applicant); $applicationPage->getJazzeePage()->setController($this->_controller); $elements['pages'][$applicationPage->getPage()->getId()] = $applicationPage->getJazzeePage()->getPdfTemplateValues(); } } return $this->generatePDF($elements); }