Kód: Vybrať všetko
class VUBPay {
var $code, $title, $description, $enabled;
function VUBPay() {
$this->code = 'VUBPay';
$this->title = MODULE_PAYMENT_VUB_TEXT_TITLE;
$this->description = MODULE_PAYMENT_VUB_TEXT_DESCRIPTION;
$this->email_footer = MODULE_PAYMENT_VUB_TEXT_EMAIL_FOOTER;
$this->enabled = MODULE_PAYMENT_VUB_STATUS;
}
// !Javascript form validation
// Check the user input submited on checkout_payment.php with javascript (client-side).
// Examples: validate credit card number, make sure required fields are filled in
function javascript_validation() {
}
// !Form fields for user input
// Output any required information in form fields
// Examples: ask for extra fields (credit card number), display extra information
function selection() {
return array('id' => $this->code,
'module' => $this->title);
}
// Pre confirmation checks (ie, check if credit card information is right before sending the info to
// the payment server
function pre_confirmation_check() {
return false;
}
// !Functions to execute before displaying the checkout confirmation page
// Note: Set the variable $checkout_form_action to set the form action value
// Examples: validate (server-side with PHP) extra fields, redirect to online payment services (eg, PayPal)
function confirmation() {
}
// !Functions to execute before finishing the form
// Examples: add extra hidden fields to the form
function process_button() {
global $checkout_form_action, $_POST, $order;
$AMT = str_replace(".",",",number_format($order->info['total'], 2));
$variab = tep_db_num_rows(tep_db_query("select orders_id from " . TABLE_ORDERS))+1;
$variab .= date ("dmy");
$url = 'https://www.vub.sk/ibank/e-platby.asp';
//$url = 'http://localhost/rozne/'; // test url
$process_string = $url . '?' . $AMT . '=' . $variab .
'=' . MODULE_PAYMENT_VUB_SHOP_ID; // ID obchodnika
if (MODULE_PAYMENT_VUB_SS>'')
$process_string .= '=' . MODULE_PAYMENT_VUB_SS;
$process_button_string = MODULE_PAYMENT_VUB_TEXT_VARNING . '<br />' . $process_string . "
<SCRIPT LANGUAGE=javascript>
function checkCheckBox()
{
window.open('".$process_string."',null,\"scrollbars=1,resizable=1,location=0,menubar=0,status=1,toolbar=0\",true);
}
</SCRIPT>";
return $process_button_string;
}
// !Functions to execute before processing the order
// Examples: retreive result from online payment services
function before_process() {
return false;
}
// !Functions to execute after processing the order
function after_process() {
echo 'V novom okne VÚB internetových platieb uhraďte platbu. V opačnom prípade Vaša objednávka nebude akceptovaná';
return false;
}
// !If an error occurs with the process, output error messages here
function output_error() {
return false;
}
// !Check if module is installed (Administration Tool)_
// TABLES: configuration
function check() {
if (!isset($this->check)) {
$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_VUB_STATUS'");
$this->check = tep_db_num_rows($check_query);
}
return $this->check;
}
// !Install the module (Administration Tool)_
// TABLES: configuration
function install() {
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Allow VUBPay Payments', 'MODULE_PAYMENT_VUB_STATUS', '1', 'Do you want to accept VUBPay payments?', '6', '6', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('ID obchodu', 'MODULE_PAYMENT_VUB_SHOP_ID', 'obch1', 'ID obchodu - prideluje VUB banka', '6', '2', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Specificky symbol', 'MODULE_PAYMENT_VUB_SS', '308', 'Specificky symbol - nepovinny parameter.', '6', '2', now())");
}
// !Remove the module (Administration Tool)_
// TABLES: configuration
function remove() {
tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_VUB_STATUS'");
tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_VUB_SHOP_ID'");
tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_VUB_SS'");
}
// !Retreive the modules configuration keys (Administration Tool)_
// Check the user input submited on checkout_payment.php with javascript (client-side).
function keys() {
$keys = array( 'MODULE_PAYMENT_VUB_SHOP_ID', 'MODULE_PAYMENT_VUB_SS');
return $keys;
}
}
?>Kód: Vybrať všetko
<SCRIPT LANGUAGE=javascript>
function _openSignOn()
{
window.open('https://www.vub.sk/ibank/e-platby.
asp?120,50=426=obch1',null,"scrollbars=1,resizable=1,location=0,menubar=0,status=1,toolbar=0",true);
}
</SCRIPT>dík