$card_exp_month = COM_applyFilter($_POST['card_exp_month']); $card_exp_year = COM_applyFilter($_POST['card_exp_year']); $card_type = COM_applyFilter($_POST['card_type']); $issue_number = COM_applyFilter($_POST['issue_number']); $start_month = COM_applyFilter($_POST['start_month']); $start_year = COM_applyFilter($_POST['start_year']); $error = add_credit_card($_USER['uid'], $first_name, $middle_name, $last_name, $company, $address_line1, $address_line2, $city, $state, $zip, $country, $card_number, $card_exp_month, $card_exp_year, $card_type, $issue_number, $start_month, $start_year, isset($_POST['default']) ? true : false); } else { if (isset($_POST['delete_credit_card']) || isset($_GET['delete'])) { $error = delete_credit_card($_GET['id'], 'index.php?op=credit_cards'); } else { $error = ""; } } } draw_credit_card($error); echo "<SCRIPT type=\"text/javascript\">initCountry();</SCRIPT>"; //Needed for State/Country # #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^DRAW_CREDIT_CARD^^^^^^^^^^^^ # Displays credit card information with error message #________________________________________________________________________________________________ function draw_credit_card($error) { global $_TABLES, $_USER, $_CONF, $LANG_ECOM; $current_id = 0; //Get accepted Credit card types $card_options = ""; $cards_res = DB_query("SELECT ecom_payment_type FROM {$_TABLES['ecom_payment_type']} WHERE ecom_payment_form = 'credit_card'"); while ($cards_row = DB_fetchArray($cards_res)) { $card_options .= "<option value=\"" . $cards_row['ecom_payment_type'] . "\">" . $cards_row['ecom_payment_type'] . "</option>";
$server_res = DB_query("SELECT ecom_payment_processor_live_server FROM {$_TABLES['ecom_payment_processor']} WHERE ecom_payment_processor_id = 1"); $server_row = DB_fetchArray($server_res); $T->set_var('error', $_GET['error']); if ($server_row['ecom_payment_processor_live_server']) { $T->set_var('action', 'https://orderpage.ic3.com/hop/CheckOrderData.do'); } else { $T->set_var('action', 'https://orderpagetest.ic3.com/hop/ProcessOrder.do'); } #Signiture to Cybersource directly. total, currency, description. $T->parse('output', 'cybersource'); echo $T->finish($T->get_var('output')); InsertSignature3("{$total}", "usd", "sale"); $T->set_file(array('cybersource_credit_card' => 'cybersource_credit_card.thtml', 'cybersource_credit_card' => 'cybersource_credit_card.thtml', 'cybersource_post_insert' => 'cybersource_post_insert.thtml')); //Descide which payment form to use Credit Card, or Bank Account. if ($row['ecom_payment_form'] == "credit_card") { $current_card_id = draw_credit_card($row, &$T); if ($_SESSION['uid'] != 0) { $T->set_var('label', "Other Credit Cards"); draw_other_credit_cards($current_card_id, $row['ecom_payment_type'], $T); $T->parse('cybersource_credit_card', 'cybersource_credit_card'); } } else { $current_bank_id = draw_check($row); $T->set_file('text', 'cybersource_other_payment_top.thtml'); $T->set_var('label', "Additional Bank Accounts"); echo $T->parse('output', 'text'); draw_other_bank($current_bank_id, $row['ecom_payment_type']); } $T->set_var('msg_191', $LANG_ECOM[191]); $T->set_var('msg_192', $LANG_ECOM[192]); $T->set_var('credit_card', $row['ecom_payment_form'] == "credit_card" ? true : false);