paybox Class Reference

List of all members.

Public Member Functions

 paybox ()
 update_status ()
 javascript_validation ()
 selection ()
 pre_confirmation_check ()
 confirmation ()
 process_button ()
 before_process ()
 after_process ()
 get_error ()
 check ()
 install ()
 remove ()
 keys ()

Public Attributes

 $code
 $title
 $description
 $enabled

Detailed Description

Definition at line 13 of file paybox.php.


Constructor & Destructor Documentation

paybox::paybox  ) 
 

Definition at line 17 of file paybox.php.

References $order, description, sort_order, and update_status().

00017                       {
00018       global $order;
00019 
00020       $this->code = 'paybox';
00021       $this->title = MODULE_PAYMENT_PAYBOX_TEXT_TITLE;
00022       $this->description = MODULE_PAYMENT_PAYBOX_TEXT_DESCRIPTION;
00023       $this->sort_order = MODULE_PAYMENT_PAYBOX_SORT_ORDER;
00024       $this->enabled = ((MODULE_PAYMENT_PAYBOX_STATUS == 'True') ? true : false);
00025 
00026       if ((int)MODULE_PAYMENT_PAYBOX_ORDER_STATUS_ID > 0) {
00027         $this->order_status = MODULE_PAYMENT_PAYBOX_ORDER_STATUS_ID;
00028       }
00029 
00030       if (is_object($order)) $this->update_status();
00031 
00032       $this->form_action_url = MODULE_PAYMENT_PAYBOX_CGI;
00033     }


Member Function Documentation

paybox::after_process  ) 
 

Definition at line 112 of file paybox.php.

00112                              {
00113       return false;
00114     }

paybox::before_process  ) 
 

Definition at line 95 of file paybox.php.

References $HTTP_POST_VARS, tep_href_link(), tep_redirect(), and tep_session_name().

00095                               {
00096       global $HTTP_POST_VARS;
00097 
00098       if ($HTTP_POST_VARS['valid'] == 'true') {
00099         if ($remote_host = getenv('REMOTE_HOST')) {
00100           if ($remote_host != 'paybox.com') {
00101             $remote_host = gethostbyaddr($remote_host);
00102           }
00103           if ($remote_host != 'paybox.com') {
00104             tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, tep_session_name() . '=' . $HTTP_POST_VARS[tep_session_name()] . '&payment_error=' . $this->code, 'SSL', false, false));
00105           }
00106         } else {
00107           tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, tep_session_name() . '=' . $HTTP_POST_VARS[tep_session_name()] . '&payment_error=' . $this->code, 'SSL', false, false));
00108         }
00109       }
00110     }

paybox::check  ) 
 

Definition at line 129 of file paybox.php.

References $check_query, tep_db_num_rows(), and tep_db_query().

Referenced by update_status().

00129                      {
00130       if (!isset($this->_check)) {
00131         $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYBOX_STATUS'");
00132         $this->_check = tep_db_num_rows($check_query);
00133       }
00134       return $this->_check;
00135     }

paybox::confirmation  ) 
 

Definition at line 71 of file paybox.php.

00071                             {
00072       return false;
00073     }

paybox::get_error  ) 
 

Definition at line 116 of file paybox.php.

References $error, and $HTTP_GET_VARS.

00116                          {
00117       global $HTTP_GET_VARS;
00118 
00119       if (isset($HTTP_GET_VARS['message']) && (strlen($HTTP_GET_VARS['message']) > 0)) {
00120         $error = stripslashes(urldecode($HTTP_GET_VARS['message']));
00121       } else {
00122         $error = MODULE_PAYMENT_PAYBOX_TEXT_ERROR_MESSAGE;
00123       }
00124 
00125       return array('title' => MODULE_PAYMENT_PAYBOX_TEXT_ERROR,
00126                    'error' => $error);
00127     }

paybox::install  ) 
 

Definition at line 137 of file paybox.php.

References tep_db_query().

00137                        {
00138       tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Paybox Module', 'MODULE_PAYMENT_PAYBOX_STATUS', 'True', 'Activer ce module Paybox ?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
00139       tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Paybox IBS_SITE', 'MODULE_PAYMENT_PAYBOX_IBS_SITE', '1999888', 'IBS_SITE fournit par Paybox', '6', '2', now())");
00140       tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Paybox IBS_RANG', 'MODULE_PAYMENT_PAYBOX_IBS_RANG', '99', 'IBS_RANG fournit par Paybox', '6', '3', now())");
00141       tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Paybox CGI Path', 'MODULE_PAYMENT_PAYBOX_CGI', 'http://www.maboutique.biz/cgi-bin/paybox.cgi', 'Chemin de votre module CGI fournit par Paybox', '6', '4', now())");
00142       tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Paybox Sort order of display.', 'MODULE_PAYMENT_PAYBOX_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
00143       tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Paybox Payment Zone', 'MODULE_PAYMENT_PAYBOX_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
00144       tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Paybox Set Order Status', 'MODULE_PAYMENT_PAYBOX_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
00145     }

paybox::javascript_validation  ) 
 

Definition at line 58 of file paybox.php.

00058                                      {
00059       return false;
00060     }

paybox::keys  ) 
 

Definition at line 151 of file paybox.php.

00151                     {
00152       return array('MODULE_PAYMENT_PAYBOX_STATUS', 'MODULE_PAYMENT_PAYBOX_IBS_SITE', 'MODULE_PAYMENT_PAYBOX_IBS_RANG', 'MODULE_PAYMENT_PAYBOX_CGI', 'MODULE_PAYMENT_PAYBOX_ZONE', 'MODULE_PAYMENT_PAYBOX_ORDER_STATUS_ID', 'MODULE_PAYMENT_PAYBOX_SORT_ORDER');
00153     }

paybox::pre_confirmation_check  ) 
 

Definition at line 67 of file paybox.php.

00067                                       {
00068       return false;
00069     }

paybox::process_button  ) 
 

Definition at line 75 of file paybox.php.

References $order, tep_draw_hidden_field(), tep_href_link(), tep_session_id(), and tep_session_name().

00075                               {
00076       global $order;
00077 
00078       $process_button_string = tep_draw_hidden_field('IBS_MODE', '1') .
00079                                tep_draw_hidden_field('IBS_SITE', '1999888') .
00080                                tep_draw_hidden_field('IBS_RANG', '99') .
00081                                tep_draw_hidden_field('IBS_TOTAL', $order->info['total'] * 100) .
00082                                tep_draw_hidden_field('IBS_DEVISE', '978') .
00083                                tep_draw_hidden_field('IBS_CMD', $order->customer['email_address'] . '|' . $order->info['total']) .
00084                                tep_draw_hidden_field('IBS_PORTEUR', $order->customer['email_address']) .
00085                                tep_draw_hidden_field('IBS_RETOUR', 'IBS_TOTAL:M;IBS_CMD:R;auto:A;trans:T') .
00086         tep_draw_hidden_field('IBS_ANNULE', tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code, 'NONSSL', true)) .
00087         tep_draw_hidden_field('IBS_REFUSE', tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code, 'NONSSL', true)) .
00088                                tep_draw_hidden_field('IBS_EFFECTUE', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false)) .
00089                                tep_draw_hidden_field(tep_session_name(), tep_session_id()) .
00090                                tep_draw_hidden_field('options', 'test_status=' . $test_status . ',dups=false,cb_post=true,cb_flds=' . tep_session_name());
00091 
00092       return $process_button_string;
00093     }

paybox::remove  ) 
 

Definition at line 147 of file paybox.php.

References tep_db_query().

00147                       {
00148       tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
00149     }

paybox::selection  ) 
 

Definition at line 62 of file paybox.php.

00062                          {
00063       return array('id' => $this->code,
00064                    'module' => $this->title);
00065     }

paybox::update_status  ) 
 

Definition at line 36 of file paybox.php.

References $check_query, $order, check(), tep_db_fetch_array(), and tep_db_query().

Referenced by paybox().

00036                              {
00037       global $order;
00038 
00039       if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PAYBOX_ZONE > 0) ) {
00040         $check_flag = false;
00041         $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYBOX_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
00042         while ($check = tep_db_fetch_array($check_query)) {
00043           if ($check['zone_id'] < 1) {
00044             $check_flag = true;
00045             break;
00046           } elseif ($check['zone_id'] == $order->billing['zone_id']) {
00047             $check_flag = true;
00048             break;
00049           }
00050         }
00051 
00052         if ($check_flag == false) {
00053           $this->enabled = false;
00054         }
00055       }
00056     }


Member Data Documentation

paybox::$code
 

Definition at line 14 of file paybox.php.

paybox::$description
 

Definition at line 14 of file paybox.php.

paybox::$enabled
 

Definition at line 14 of file paybox.php.

paybox::$title
 

Definition at line 14 of file paybox.php.


The documentation for this class was generated from the following file:
Generated on Fri Mar 17 14:56:27 2006 for CRE Loaded 6.2 Pro by  doxygen 1.4.4