Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
payment_gateway_utransact.inc
1 <?php
17 require_once dirname(__FILE__).'/../../payment_gateway/payment_gateway.inc';
18 require_once dirname(__FILE__).'/utransact_processor.inc';
19 
31 {
32 
33 
39  private $_processor = null;
40 
41 
46  function __construct($assetid=0)
47  {
48  parent::__construct($assetid);
49 
50  }//end constructor
51 
52 
63  function _createAdditional(&$link)
64  {
65  if (!parent::_createAdditional($link)) return FALSE;
66 
67  return $this->_createBodycopy();
68 
69  }//end _createAdditional()
70 
71 
78  private function _loadProcessor()
79  {
80  // Create the UTransact processor for the gateway
81  $this->_processor = new UTransact_Processor(
82  $this->attr('username'),
83  $this->attr('password'),
84  $this->attr('bgas_webservice_url'),
85  $this->attr('transactions_webservice_url'),
86  $this->attr('services_webservice_url')
87  );
88 
89  return TRUE;
90  }//end _loadProcessor()
91 
92 
101  function _createBodycopy($default_content=NULL)
102  {
103  if (is_null($default_content)) {
104  $default_content = translate('default_bodycopy_content');
105  }
106 
107  $GLOBALS['SQ_SYSTEM']->am->includeAsset('bodycopy');
108  $bodycopy = new Bodycopy();
109  $copy_link = Array('asset' => &$this, 'link_type' => SQ_LINK_TYPE_2, 'is_dependant' => 1, 'is_exclusive' => 1);
110 
111  $bodycopy->setAttrValue('name', 'Display Format');
112  $args = Array('content' => $default_content);
113  if ($bodycopy->create($copy_link, $args)) {
114  $child_bodycopy = $GLOBALS['SQ_SYSTEM']->am->getLink($bodycopy->id, SQ_LINK_TYPE_2, 'bodycopy_div');
115  $GLOBALS['SQ_SYSTEM']->am->releaseLock($child_bodycopy['minorid'], 'attributes');
116  return TRUE;
117  }
118  return FALSE;
119 
120  }//end _createBodycopy()
121 
122 
130  function _getAllowedLinks()
131  {
132  $page_links = parent::_getAllowedLinks();
133  $page_links[SQ_LINK_TYPE_2]['bodycopy'] = Array('card' => 2, 'exclusive' => TRUE);
134  return $page_links;
135 
136  }//end _getAllowedLinks()
137 
138 
153  {
154  $keywords = parent::getAvailableKeywords();
155 
156  $keywords['credit_card_number'] = 'Credit Card Number';
157  $keywords['credit_card_expiry_year'] = 'Credit Card Expiry Year';
158  $keywords['credit_card_expiry_month'] = 'Credit Card Expiry Month';
159  $keywords['credit_card_name'] = 'Name on card';
160  $keywords['credit_card_ccv'] = 'Credit Card CCV field';
161  $keywords['credit_card_type_selector'] = 'Credit Card selector';
162 
163  $keywords['transaction_amount'] = 'Total transaction amount';
164  $keywords['transaction_gst'] = 'GST percent set at gateway (Not set for transaction)';
165 
166  $keywords['submit_button'] = 'Submit Button';
167  $keywords['cancel_button'] = 'Cancel Button';
168  $keywords['reset_button'] = 'Reset Button';
169 
170  $keywords['processing_error'] = 'Processing Error (empty if no error)';
171 
172  return $keywords;
173 
174  }//end getAvailableKeywords()
175 
176 
187  function onRequestKeywords(&$broadcaster, $vars=Array())
188  {
189  $keywords = $this->getAvailableKeywords();
190  $vars['keywords'] = array_merge($vars['keywords'], $keywords);
191 
192  }//end onRequestKeywords()
193 
194 
201  function printBody()
202  {
203  $amount = array_get_index($_SESSION,'SQ_ECOM_AMOUNT', 0);
204 
205  $card_info = array_get_index($_REQUEST, $this->getPrefix().'_card', FALSE);
206  $action = array_get_index($_REQUEST, $this->getPrefix().'_action', FALSE);
207 
208  if ($action == 'Cancel') {
209  unset($_SESSION['UTRANSACT_TRANSACTION_HANDLE']);
210  $this->returnToCaller('CANCEL');
211 
212  } else if (empty($amount)) {
213  unset($_SESSION['UTRANSACT_TRANSACTION_HANDLE']);
214  unset($_SESSION['SQ_ECOM_AMOUNT']);
215  unset($_SESSION['SQ_ECOM_GST']);
216 
217  $this->appendPendingOrderAuditLog(translate('ecom_payment_no_amount'));
218 
219  $this->returnToCaller('SUCCESS');
220 
221  } else if ($card_info) {
222  $this->appendPendingOrderAuditLog(translate('utransact_payment_attempted_gateway_contacted'));
223 
224  if ($this->processPayment($card_info)) {
225 
226  unset($_SESSION['UTRANSACT_TRANSACTION_HANDLE']);
227  unset($_SESSION['SQ_ECOM_AMOUNT']);
228  unset($_SESSION['SQ_ECOM_GST']);
229 
230  // Broadcast payment completed trigger event before return
231  if (isset($_SESSION['SQ_ECOM_PAYMENT_COMPLETED_BROADCASTER_ASSETID'])) {
232 
233  $broadcaster = $GLOBALS['SQ_SYSTEM']->am->getAsset($_SESSION['SQ_ECOM_PAYMENT_COMPLETED_BROADCASTER_ASSETID']);
234  if (!empty($broadcaster)) {
235 
236  //Put all returned variables in $_SESSION['SQ_ECOM_RESPONSE'] to $_POST array so that the listening trigger can use them
237  $response = array_get_index($_SESSION, 'SQ_ECOM_RESPONSE', FALSE);
238  if ($response) {
239  $_POST['transaction_reference'] = array_get_index($response, 'REFERENCE', '');
240  $_POST['transaction_time'] = array_get_index($response, 'TIME', '');
241  $_POST['transaction_status'] = array_get_index($response, 'STATUS', '');
242  $_POST['transaction_card_number'] = array_get_index($response, 'CARDNO', '');
243  $_POST['transaction_amount'] = array_get_index($response, 'AMOUNT', 0) + array_get_index($response, 'GST', 0);
244  $_POST['transaction_invoice'] = array_get_index($response, 'INVOICE_NUMBER', '');
245 
246  }
247  $GLOBALS['SQ_SYSTEM']->broadcastTriggerEvent('trigger_event_ecommerce_payment_completed', $broadcaster);
248  }
249  }
250 
251  $this->appendPendingOrderAuditLog(translate('ecom_payment_succeeded'));
252 
253  $this->returnToCaller('SUCCESS');
254 
255  } else {
256  $this->appendPendingOrderAuditLog(translate('utransact_payment_declined'));
257  }
258  }
259 
260  if (empty($this->_processor)) {
261  $this->_loadProcessor();
262  }
263 
264  if ($this->_processor) {
265 
266  // Get the transaction handle before getting the payment details
267  $transaction_handle = $this->_processor->getTransactionHandle();
268 
269  if (!$transaction_handle) {
270  $this->_setError('Cannot obtain the transaction handle from the payment gateway. Please submit the payment form again or contact the administrator');
271 
272  }
273 
274  // Save the handler in the session
275  $_SESSION['UTRANSACT_TRANSACTION_HANDLE'] = $transaction_handle;
276 
277  } else {
278  $this->_setError("Cannot load payment processor. Please contact the administrator.");
279  }
280 
281  $this->printBodycopy();
282 
283 
284  }//end printBody()
285 
286 
292  function printBodycopy()
293  {
294  $bodycopy = $this->getBodycopy();
295  if (is_null($bodycopy)) return;
296 
297  $keywords = $bodycopy->getKeywords();
298  $replacements = Array();
299  foreach ($keywords as $word) {
300  $replacements[$word] = $this->getKeywordReplacement($word);
301  }
302  $bodycopy->setKeywordReplacements($replacements);
303 
304  // OUTPUT HERE
305  $datapath = sq_web_path('data').'/asset_types/payment_gateway_utransact/files';
306  $card = $this->getPrefix().'_card';
307 
308  ?>
309  <script src="<?php echo $datapath; ?>/loader.js"></script>
310  <script>
311  var Loader = new Loader('<?php echo $card; ?>','#FFFFFF','Processing Transaction...','<?php echo $datapath; ?>/loader.gif');
312  Loader.print();
313  </script>
314  <form method="post" action="<?php echo $this->getURL(); ?>" onsubmit="Loader.show();">
315  <?php
316  $bodycopy->printBody();
317  echo '</form>';
318 
319  }//end printBodycopy()
320 
321 
328  function &getBodycopy()
329  {
330  $link = $GLOBALS['SQ_SYSTEM']->am->getLink($this->id, SQ_LINK_TYPE_2, 'bodycopy', TRUE, '', 'major');
331  if (empty($link)) return NULL;
332  $bodycopy = $GLOBALS['SQ_SYSTEM']->am->getAsset($link['minorid'], $link['minor_type_code']);
333  return $bodycopy;
334 
335  }//end getBodycopy()
336 
337 
346  function processPayment($card_info)
347  {
348  if (!$card_info) return FALSE;
349 
350  $amount = $_SESSION['SQ_ECOM_AMOUNT'];
351  if (empty($amount)) {
352  $this->_setError(translate('utransact_amount_not_specified'));
353  return FALSE;
354  }
355 
356  if (!$this->attr('username')) {
357  $this->_setError(translate("utransact_account_username_not_specified"));
358  }
359  if (!$this->attr('password')) {
360  $this->_setError(translate("utransact_account_password_not_specified"));
361  }
362  if (!$this->attr('bgas_webservice_url')) {
363  $this->_setError(translate("url_to_bgas_webservice_not_specified"));
364  }
365  if (!$this->attr('transactions_webservice_url')) {
366  $this->_setError(translate("url_to_transactions_webservice_not_specified"));
367  }
368  if (!$this->attr('services_webservice_url')) {
369  $this->_setError(translate("url_to_services_webservice_not_specified"));
370  }
371 
372  // If UTransact account details are not complete then we cannot proceed further
373  if ($this->isError()) {
374  return FALSE;
375  }
376 
377  if (empty($this->_processor)) {
378  $this->_loadProcessor();
379 
380  if (empty($this->_processor)) {
381  $this->_setError("Cannot load processor");
382  return FALSE;
383  }
384  }
385 
386  // Set unique reference number for this transaction
387  // NOTE:
388  // Merchand reference should be generated here instead of default_delivery_method.inc or elsewhere because
389  // UTransact gateway requires a unqiue transaction reference id for each transaction attempt
390  // For example, user can make multiple payment submission attempt untill card details finallygets accepted,
391  // and not sending unique reference for each attempt will casue "Duplicate transaction reference" exception error
392  $reference_no = md5(session_id().time());
393  $this->_processor->setTransactionReferenceNo($reference_no);
394 
395  $_SESSION['SQ_ECOM_REF_NO'] = $this->_processor->getTransactionReferenceNo();
396 
397  $pending_order_id = array_get_index($_SESSION['sq_local_cart_contents'], 'pending_order_id', NULL);
398  if (!$pending_order_id) {
399  $this->_setError("Order asset not found in session.");
400  return FALSE;
401  }
402  $pending_order = $GLOBALS['SQ_SYSTEM']->am->getAsset($pending_order_id);
403  $pending_order->setAttrValue('ecom_ref_no', $_SESSION['SQ_ECOM_REF_NO']);
404  $pending_order->appendAuditLog(translate('utransact_ecom_ref_num_recorded_before_processing'));
405 
406  // Set credit card number
407  if (!empty($card_info['number'])) {
408  $card_info['number'] = str_replace(Array(' ', "\t"), '', $card_info['number']);
409  $this->_processor->setCreditCard($card_info['number']);
410  } else {
411  $this->_setError(translate("utransact_card_number_not_specified"));
412  }
413 
414  // Set credit card holder's name
415  if (!empty($card_info['name'])) {
416  $this->_processor->setCardHolderName($card_info['name']);
417  } else {
418  $this->_setError(translate("utransact_card_name_not_specified"));
419  }
420 
421  // Set credit card expiry month and year
422  if ($this->_isValidMonth(array_get_index($card_info, 'month', '')) && $this->_isValidYear(array_get_index($card_info, 'year', ''))) {
423  $this->_processor->setCardExpiryMonth($card_info['month']);
424  $this->_processor->setCardExpiryYear($card_info['year']);
425  } else {
426  $this->_setError(translate("utransact_expiry_date_invalid"));
427  }
428 
429  // Set credit card CV2, if required
430  if($this->attr('display_ccv')){
431  if (!empty($card_info['ccv']) && $this->_isValidCV2($card_info['ccv'])) {
432  $this->_processor->setCreditCardCV2($card_info['ccv']);
433  } else {
434  $this->_setError(translate("utransact_card_cv2_invalid"));
435  }
436  }
437 
438  // Set merchant id, if specified
439  if ($this->attr('merchant_id') != '') {
440  $this->_processor->setMerchantId($this->attr('merchant_id'));
441  }
442 
443  // Set payment model, if specified
444  if ($this->attr('payment_model') != '') {
445  $this->_processor->setPaymentModel($this->attr('payment_model'));
446  }
447 
448  // Get the purchaser info
449  $purchaser_info = $this->_getPurchaserInfo();
450 
451  $this->_processor->setFirstName(isset($purchaser_info['firstname']) ? $purchaser_info['firstname'] : '');
452  $this->_processor->setSurname(isset($purchaser_info['surname']) ? $purchaser_info['surname'] : '');
453  $this->_processor->setEmail(isset($purchaser_info['email']) ? $purchaser_info['email'] : '');
454  $this->_processor->setAddressLine1(isset($purchaser_info['address1']) ? $purchaser_info['address1'] : '');
455  $this->_processor->setAddressLine2(isset($purchaser_info['address2']) ? $purchaser_info['address2'] : '');
456  $this->_processor->setSuburb(isset($purchaser_info['suburb']) ? $purchaser_info['suburb'] : '');
457  $this->_processor->setCity(isset($purchaser_info['city']) ? $purchaser_info['city'] : '');
458  $this->_processor->setPostcode(isset($purchaser_info['postcode']) ? $purchaser_info['postcode'] : '');
459 
460 
461  // Populate the line items from the cart in the session
462  $session_cart = isset($_SESSION['sq_local_cart_contents']['cart_contents']) ? $_SESSION['sq_local_cart_contents']['cart_contents'] : Array();
463 
464  if (empty($session_cart)) {
465  $this->_setError(translate("utransact_shopping_cart_empty"));
466  }
467 
468  foreach($session_cart as $product_assetid => $item) {
469  $item['additional_info'] = "IS DONATION: ".($item['is_donation'] ? 'YES' : 'NO');
470 
471  $item["application_username"] = isset($item["application_username"]) ? $item["application_username"] : '';
472  $item["description"] = isset($item["description"]) ? $item["description"] : '';
473  $item["financial_values"] = isset($item["financial_values"]) ? $item["financial_values"] : '';
474 
475  // If product refund type is set to 'Expiry', then set the expiry date to one week from now
476  $refund_expiry_date = ($item["refund_type"] === 'Expires') ? date("Y-m-d\TH:i:s", strtotime("+7 days")) : '';
477 
478  $this->_processor->addCartItem(
479  $item["application_username"],
480  $item["name"],
481  $item["description"],
482  $item["quantity"],
483  $item["refund_type"],
484  $refund_expiry_date,
485  $item["price"],
486  $item["product_code"],
487  $item["financial_code"],
488  $item["financial_values"],
489  $item["additional_info"]
490  );
491 
492  }
493 
494  // If theres some error in input, we cannot proceed with this transaction
495  if ($this->isError()) {
496  return FALSE;
497  }
498 
499  // Finally process transaction
500  $success = $this->_processor->process();
501 
502  // Get response
503  $response = $this->_processor->getResponse();
504 
505  $this->_setTransactionResult($success, $response, $card_info);
506 
507  return $success;
508 
509  }//end processPayment()
510 
511 
523  private function _setTransactionResult($success, $response, $card_info)
524  {
525  if (!$success) {
526  $this->_tmp['is_error'] = TRUE;
527  $this->_tmp['error_message'] = Array($response['MESSAGE']);
528  } else {
529  $status = $response['STATUS'];
530 
531  // preparing card number; should contain only 4 last digits
532  $cardno = '';
533  $cardlength = strlen($card_info['number']);
534  if ($cardlength < 16) {
535  for ($i = 0; $i < $cardlength - 4; $i++) {
536  $cardno .= '*';
537  }
538  $cardno .= substr($card_info['number'], $i);
539  } else {
540  $cardno = '****-****-****-'.substr($card_info['number'],12);
541  }
542 
543  $response['CARDNO'] = $cardno;
544  $response['TIME'] = array_get_index($response, 'DATE', date('r'));
545  $response['TRANSACTION'] = array_get_index($response, 'INVOICE_NUMBER', '');
546 
547  $_SESSION['SQ_ECOM_RESPONSE'] = $response;
548  }
549 
550  }//end _setTransactionResult()
551 
552 
559  private function _getPurchaserInfo()
560  {
561  $purchaser_data = isset($_SESSION['order_extra_information']) ? $_SESSION['order_extra_information'] : '';
562  if (empty($purchaser_data)) {
563  $this->_setError(translate("utransact_purchaser_info_not_in_session"));
564  return FALSE;
565  }
566 
567  $purchaser_data = unserialize($purchaser_data);
568 
569  // Fields in the checkout form ('1' means required and '0' means optional)
570  $checkout_fields = Array(
571  'firstname' => 1,
572  'surname' => 1,
573  'email' => 0,
574  'address1' => 1,
575  'address2' => 0,
576  'suburb' => 0,
577  'city' => 1,
578  'postcode' => 0,
579  );
580 
581  $purchaser_info = Array();
582  foreach($checkout_fields as $field => $required) {
583  $form_qid = trim($this->attr('map_'.$field.'_assetid'));
584 
585  // Extract the shadow part of the form question assetid
586  if (!preg_match('/^[0-9]+?:(.*)$/',$form_qid, $match) && $required) {
587  $this->_setError(translate("utransact_form_question_id_not_set", ucfirst($field)));
588  return FALSE;
589  }
590 
591  $shadow_qid = isset($match[1]) ? trim($match[1]) : 0;
592  $purchaser_info[$field] = isset($purchaser_data[$shadow_qid]) ? $purchaser_data[$shadow_qid] : '';
593 
594  if ($required && !$purchaser_info[$field]) {
595  $this->_setError(translate("utransact_form_question_id_not_set", ucfirst($field)));
596  return FALSE;
597  }
598 
599  }
600 
601  return $purchaser_info;
602 
603  }//end _getPurchaserInfo()
604 
605 
614  private function _isValidMonth($month)
615  {
616  $month_of_year = Array('JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC');
617  return (in_array(strtoupper($month), $month_of_year));
618 
619  }//end _isValidMonth()
620 
621 
630  private function _isValidYear($year)
631  {
632  return preg_match('/^\d{4}$/', $year);
633 
634  }//end _isValidYear()
635 
636 
645  private function _isValidCV2($cv2)
646  {
647  return preg_match('/^\d{3,4}$/', $cv2);
648 
649  }//end _isValidCV2()
650 
651 
660  private function _setError($err_message)
661  {
662  $this->_tmp['is_error'] = TRUE;
663  $this->_tmp['error_message'][] = $err_message;
664 
665  }//end _setError()
666 
667 
674  public function isError()
675  {
676  return array_get_index($this->_tmp, 'is_error', FALSE);
677 
678  }//end isError()
679 
680 
687  public function clearErrors()
688  {
689  $this->_tmp['error_message'] = Array();
690  $this->_tmp['is_error'] = FALSE;
691 
692  }//end clearErrors()
693 
694 
703  function returnToCaller($state='SUCCESS')
704  {
705  $back_url = NULL;
706 
707  if ($state == 'SUCCESS') {
708  $back_url = array_get_index($_SESSION, 'SQ_ECOM_SUCCESS_URL');
709  unset($_SESSION['SQ_ECOM_SUCCESS_URL']);
710 
711  } else if ($state == 'CANCEL') {
712  $back_url = array_get_index($_SESSION, 'SQ_ECOM_CANCEL_URL');
713  unset($_SESSION['SQ_ECOM_CANCEL_URL']);
714  }
715 
716  if (is_null($back_url)) {
717  trigger_error('Unknown caller reference');
718  } else {
719  header('Location: '.$back_url);
720  exit;
721  }
722 
723  }//end returnToCaller()
724 
725 
732  public function getErrorMessage()
733  {
734  $err_message = '';
735  $errors = array_get_index($this->_tmp, 'error_message', Array());
736 
737  foreach ($errors as $error) {
738  $err_message .= "<li>$error </li>";
739  }
740 
741  return '<ul>'.$err_message.'</ul>';
742 
743  }//end getErrorMessage()
744 
745 
754  public function getTransactionGstRate($from_gateway=FALSE)
755  {
756  if (!$from_gateway && isset($_SESSION['SQ_ECOM_GST'])) {
757  return $_SESSION['SQ_ECOM_GST'];
758  }
759 
760  if (empty($this->_processor)) {
761  $this->_loadProcessor();
762 
763  if (empty($this->_processor)) {
764  $this->_setError("Cannot load processor");
765  return FALSE;
766  }
767  }
768 
769  // Get the gst tax rate value from the payment gateway and put it into the session
770  $_SESSION['SQ_ECOM_GST'] = $this->_processor->getTransactionGstRate();
771 
772  return $_SESSION['SQ_ECOM_GST'];
773  }
774 
775 
783  {
784 
785  $prefix = $this->getPrefix();
786  $card = $prefix.'_card';
787 
788  $card_number = '<input name="'.$card.'[number]" autocomplete="off" />';
789 
790  return $card_number;
791 
792  }//end getCreditCardNumberKeywordReplacement()
793 
794 
802  {
803  $card = $this->getPrefix().'_card';
804  $string = '<input name="'.$card.'[name]" autocomplete="off" />';
805  return $string;
806 
807  }//end getCreditCardNameKeywordReplacement()
808 
809 
817  {
818  if (!$this->attr('display_ccv')) return '';
819 
820  $card = $this->getPrefix().'_card';
821  $string = 'CV2 <input name="'.$card.'[ccv]" size="4" autocomplete="off" />';
822  return $string;
823 
824  }//end getCreditCardCcvKeywordReplacement()
825 
826 
834  {
835  if (empty($this->_processor)) {
836  $this->_loadProcessor();
837 
838  if (empty($this->_processor)) {
839  $this->_setError("Cannot load processor");
840  return FALSE;
841  }
842  }
843 
844  $card = $this->getPrefix().'_card';
845 
846  $card_types = $this->_processor->getCardTypes();
847 
848  ob_start();
849  echo '<select name="'.$card.'[type]">';
850  foreach ($card_types as $type) {
851  echo '<option value="'.$type.'">'.$type.'</option>';
852  }
853 
854  echo '</select>';
855  return ob_get_clean();
856 
857  }//end getCreditCardTypeSelectorKeywordReplacement()
858 
859 
867  {
868  // Total amount from session shouldn't include tax
869  // GST is calculated and added by gateway when processing the transaction
870 
871  return array_get_index($_SESSION,'SQ_ECOM_AMOUNT', 0);
872 
873  }//end getTransactionAmountKeywordReplacement()
874 
875 
883  {
884  $gst_rate = $this->getTransactionGstRate();
885  return $gst_rate ? ($gst_rate*100) : 'GST NOT SET!';
886 
887  }//end getTransactionGSTKeywordReplacement()
888 
889 
897  {
898 
899  $card = $this->getPrefix().'_card';
900 
901  $string = '<input name="'.$card.'[year]" size="2" autocomplete="off" />';
902  return $string;
903 
904  }//end getCreditCardExpiryYearKeywordReplacement()
905 
906 
914  {
915 
916  $card = $this->getPrefix().'_card';
917 
918  $string = '<input name="'.$card.'[month]" size="2" autocomplete="off" />';
919  return $string;
920 
921  }//end getCreditCardExpiryMonthKeywordReplacement()
922 
923 
931  {
932  if ($this->isError()) {
933  return '<span class="payment-gateway-transaction-error">'.$this->getErrorMessage().'</span>';
934  }
935 
936  return '';
937 
938  }//end getProcessingErrorKeywordReplacement()
939 
940 
948  {
949  $button_text = $this->attr('submit_text');
950  if (empty($button_text)) $button_text = 'Submit';
951  return '<input type="submit" value="'.$button_text.'" />';
952 
953  }//end getSubmitButtonKeywordReplacement()
954 
955 
963  {
964  $button_text = $this->attr('reset_text');
965  if (empty($button_text)) $button_text = 'Reset';
966  return '<input type="reset" value="'.$button_text.'" />';
967 
968  }//end getResetButtonKeywordReplacement()
969 
970 
978  {
979  $button_text = $this->attr('cancel_text');
980  if (empty($button_text)) $button_text = 'Cancel';
981  return '<input type="submit" name="'.$this->getPrefix().'_action" value="'.$button_text.'" />';
982 
983  }//end getCancelButtonKeywordReplacement()
984 
985 
993  {
994  if (empty($this->_processor)) {
995  $this->_loadProcessor();
996  }
997 
998  if ($this->_processor) {
999  return $this->_processor->getTransactionHandle();
1000  } else {
1001  return FALSE;
1002  }
1003 
1004  }//end getNewTransactionHandle()
1005 
1006 }//end class
1007 
1008 ?>