Exemplo n.º 1
0
 /**
  * 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> &#36;{$amount}</p>");
         $form->newButton('submit', 'Pay with Credit Card');
     } else {
         $form = parent::paymentForm($applicant, $amount);
     }
     return $form;
 }
Exemplo n.º 2
0
 /**
  * Credit card payment form
  * Different form for administrators
  */
 public function paymentForm(\Jazzee\Entity\Applicant $applicant, $amount)
 {
     $form = new \Foundation\Form();
     if (\is_a($this->_controller, 'ApplyPageController')) {
         $form->newHiddenElement('ucla_ref_no', uniqid(rand()));
         $form->newHiddenElement('amount1', $amount);
         $form->newHiddenElement('itemcode1', $this->_paymentType->getVar('itemCode'));
         $form->newHiddenElement('desc1', $this->_paymentType->getVar('itemDescription'));
         $form->newHiddenElement('ref1type1', $this->_paymentType->getVar('reftypeApplicantId'));
         $form->newHiddenElement('ref1val1', $applicant->getId());
         $form->newHiddenElement('ref2type1', $this->_paymentType->getVar('reftypeForwardUrl'));
         $form->newHiddenElement('ref2val1', $this->_controller->getServerPath() . $this->_controller->getActionPath());
         $form->newHiddenElement('signouturl', $this->_controller->absolutePath('transaction/' . \urlencode(get_class($this))));
         if ($this->_controller->getConfig()->getStatus() == 'PRODUCTION') {
             $form->setAction(self::CASHNET_URL . $this->_paymentType->getVar('liveSiteName'));
         } else {
             $form->setAction(self::CASHNET_URL . $this->_paymentType->getVar('devSiteName'));
         }
         $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> &#36;{$amount}</p>");
         $form->newButton('submit', 'Pay with Credit Card');
     } else {
         $field = $form->newField();
         $field->setLegend($this->_paymentType->getName());
         $field->setInstructions("<p>Credit card details should be enterd directly at the cashnet website and then the transaction ID entered here.</p>");
         $element = $field->newElement('TextInput', 'transactionId');
         $element->setLabel('Transaction ID');
         $element->addValidator(new \Foundation\Form\Validator\NotEmpty($element));
         //we pass the amount back as a hidden element so PaymentPage will have it again
         $form->newHiddenElement('amount', $amount);
         $form->newButton('submit', 'Lookup Transaction');
     }
     return $form;
 }
Exemplo n.º 3
0
 public function paymentForm(\Jazzee\Entity\Applicant $applicant, $amount)
 {
     $form = new \Foundation\Form();
     $form->setAction($this->_controller->getActionPath());
     $form->newHiddenElement('amount', $amount);
     $field = $form->newField();
     $field->setLegend($this->_paymentType->getName());
     $field = $form->newField();
     $instructions = "<p><strong>Application Fee:</strong> &#36;{$amount}</p>";
     $instructions .= '<p><strong>Make Checks Payable to:</strong> ' . $this->_paymentType->getVar('payable') . '</p>';
     if ($this->_paymentType->getVar('address')) {
         $instructions .= '<p><h4>Mail Check to:</h4>' . nl2br($this->_paymentType->getVar('address')) . '</p>';
     }
     if ($this->_paymentType->getVar('coupon')) {
         $instructions .= '<p><h4>Include the following information with your payment:</h4> ' . nl2br($this->_paymentType->getVar('coupon')) . '</p>';
     }
     $search = array('_Applicant_Name_', '_Applicant_ID_', '_Program_Name_', '_Program_ID_');
     $replace = array();
     $replace[] = $applicant->getFirstName() . ' ' . $applicant->getLastName();
     $replace[] = $applicant->getId();
     $replace[] = $applicant->getApplication()->getProgram()->getName();
     $replace[] = $applicant->getApplication()->getProgram()->getId();
     $instructions = str_ireplace($search, $replace, $instructions);
     $instructions .= '<p>Click the Pay By Check button to pay your fee by check.  Your account will be temporarily credited and you can complete your application.  Your application will not be reviewed until your check is recieved.</p>';
     $field->setInstructions($instructions);
     $form->newButton('submit', 'Pay By Check');
     return $form;
 }
Exemplo n.º 4
0
 /**
  * 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> &#36;{$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;
 }
Exemplo n.º 5
0
 /**
  * Get application pages
  * @param \Jazzee\Entity\Applicant $applicant
  */
 protected function getPages(\Jazzee\Entity\Applicant $applicant)
 {
     $pages = array('pages' => array(), 'allowAddAnswer' => $this->checkIsAllowed($this->controllerName, 'addAnswer'), 'allowEditAnswer' => $this->checkIsAllowed($this->controllerName, 'editAnswer'), 'allowDeleteAnswer' => $this->checkIsAllowed($this->controllerName, 'deleteAnswer'));
     $applicationPages = $this->_em->getRepository('\\Jazzee\\Entity\\ApplicationPage')->findBy(array('application' => $applicant->getApplication()->getId(), 'kind' => \Jazzee\Entity\ApplicationPage::APPLICATION), array('weight' => 'asc'));
     foreach ($applicationPages as $applicationPage) {
         if ($applicationPage->getJazzeePage()->showReviewPage()) {
             $params = array($applicant->getId(), $applicationPage->getPage()->getId());
             $content = $this->getActionOutput('refreshPage', $params);
             $content = str_replace(array("\n", "\r"), '', $content);
             $pages['pages'][] = array('id' => $applicationPage->getPage()->getId(), 'content' => $content);
         }
     }
     return $pages;
 }
Exemplo n.º 6
0
 /**
  * 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);
 }