function payment_payvision($config)
 {
     parent::payment($config);
     add_member_field('payvision_cardid', '', 'hidden');
     add_member_field('payvision_cardguid', '', 'hidden');
     if ($this->config['testing']) {
         $this->paurl = "https://testprocessor.payvisionservices.com";
     } else {
         $this->paurl = "https://testprocessor.payvisionservices.com";
     }
 }
Example #2
0
 public function doPay($filter)
 {
     if (!$filter['pay_app_id']) {
         throw new \LogicException(app::get('systrade')->_("请选择支付方式!"));
         return false;
     }
     //检测该支付单是否被支付
     //检测该支付单中的订单是否有异常
     $payments = $this->checkTradeData($filter['payment_id']);
     if (!$payments) {
         throw new \LogicException(app::get('systrade')->_("支付失败"));
         return false;
     }
     $payments['pay_app_id'] = $filter['pay_app_id'];
     $payments['return_url'] = $filter['return_url'];
     //更新支付单的支付方式
     //请求第三方支付接口
     $updateResult = payment::update($payments);
     if (!$updateResult) {
         throw new \LogicException(app::get('systrade')->_("支付信息更新失败"));
         return false;
     }
     $objPayment = kernel::single('ectools_pay');
     $result = $objPayment->generate($payments);
     if (!$result) {
         throw new \LogicException(app::get('systrade')->_("支付失败"));
         return false;
     }
     return true;
 }
 public function postCreate()
 {
     $payment = new payment();
     $payment->name = Input::get('name');
     $payment->acc_holder = Input::get('acc_holder');
     $payment->acc_no = Input::get('acc_no');
     $payment->acc_type = Input::get('acc_type');
     $payment->status = Input::get('status');
     $logo = Input::file('logo');
     $filename = date('m-d-Y-H_i_s') . "-" . $logo->getClientOriginalName();
     $path = public_path('img/payment/' . $filename);
     Image::make($logo->getRealPath())->resize(150, null, function ($constraint) {
         $constraint->aspectRatio();
     })->save($path);
     $payment->logo = 'img/payment/' . $filename;
     $payment->save();
     return redirect('admin/payments')->with('flash_message', 'payment created');
 }
Example #4
0
 function requestMerchant()
 {
     $payment = new payment();
     $datenow = date("d/m/Y h:m:s");
     $modifiedDate = str_replace(" ", "%20", $datenow);
     $payment->url = $this->paymentConfig->Url;
     $postFields = "";
     $postFields .= "&login="******"&pass="******"&ttype=" . $_POST['TType'];
     $postFields .= "&prodid=" . $_POST['product'];
     $postFields .= "&amt=" . $_POST['amount'];
     $postFields .= "&txncurr=" . $this->paymentConfig->TxnCurr;
     $postFields .= "&txnscamt=" . $this->paymentConfig->TxnScAmt;
     $postFields .= "&clientcode=" . urlencode(base64_encode($_POST['clientcode']));
     $postFields .= "&txnid=" . rand(0, 999999);
     $postFields .= "&date=" . $modifiedDate;
     $postFields .= "&custacc=" . $_POST['AccountNo'];
     $postFields .= "&ru=" . $_POST['ru'];
     $postFields .= "&udf1=" . str_replace(" ", "%20", $_POST['udf1']);
     $postFields .= "&udf2=" . $_POST['udf2'];
     $postFields .= "&udf3=" . $_POST['udf3'];
     $postFields .= "&udf4=" . str_replace(" ", "%20", $_POST['udf4']);
     // Not required for merchant
     //$postFields .= "&bankid=".$_POST['bankid'];
     $sendUrl = $payment->url . "?" . substr($postFields, 1) . "\n";
     $this->writeLog($sendUrl);
     $returnData = $payment->sendInfo($postFields);
     $this->writeLog($returnData . "\n");
     $xmlObjArray = $this->xmltoarray($returnData);
     $url = $xmlObjArray['url'];
     $postFields = "";
     $postFields .= "&ttype=" . $_POST['TType'];
     $postFields .= "&tempTxnId=" . $xmlObjArray['tempTxnId'];
     $postFields .= "&token=" . $xmlObjArray['token'];
     $postFields .= "&txnStage=1";
     $url = $payment->url . "?" . $postFields;
     $this->writeLog($url . "\n");
     header("Location: " . $url);
 }
Example #5
0
 function configure($key)
 {
     switch ($key) {
         case 'MODULE_PAYMENT_NOVA_XML_TESTMODE':
             $temp = array(array('id' => 'Test', 'text' => TEXT_TEST), array('id' => 'Production', 'text' => TEXT_PRODUCTION));
             return html_pull_down_menu(strtolower($key), $temp, constant($key));
         case 'MODULE_PAYMENT_NOVA_XML_AUTHORIZATION_TYPE':
             $temp = array(array('id' => 'Authorize', 'text' => TEXT_AUTHORIZE), array('id' => 'Authorize/Capture', 'text' => TEXT_CAPTURE));
             return html_pull_down_menu(strtolower($key), $temp, constant($key));
         default:
             return parent::configure($key);
     }
 }
Example #6
0
 function configure($key)
 {
     switch ($key) {
         case 'MODULE_PAYMENT_PAYPAL_NVP_TESTMODE':
             $temp = array(array('id' => 'sandbox', 'text' => TEXT_TEST), array('id' => 'live', 'text' => TEXT_PRODUCTION));
             return html_pull_down_menu(strtolower($key), $temp, constant($key));
         case 'MODULE_PAYMENT_PAYPAL_NVP_AUTHORIZATION_TYPE':
             $temp = array(array('id' => 'Authorization', 'text' => TEXT_AUTHORIZE), array('id' => 'Sale', 'text' => TEXT_CAPTURE));
             return html_pull_down_menu(strtolower($key), $temp, constant($key));
         default:
             return parent::configure($key);
     }
 }
Example #7
0
 function configure($key)
 {
     switch ($key) {
         case 'MODULE_PAYMENT_LINKPOINT_API_TRANSACTION_MODE_RESPONSE':
             $temp = array(array('id' => 'LIVE: Production', 'text' => TEXT_PRODUCTION), array('id' => 'TESTING: Successful', 'text' => TEXT_TEST_SUCCESS), array('id' => 'TESTING: Decline', 'text' => TEXT_TEST_FAIL));
             return html_pull_down_menu(strtolower($key), $temp, constant($key));
         case 'MODULE_PAYMENT_LINKPOINT_API_AUTHORIZATION_MODE':
             $temp = array(array('id' => 'Authorize Only', 'text' => TEXT_AUTHORIZE), array('id' => 'Immediate Charge/Capture', 'text' => TEXT_CAPTURE));
             return html_pull_down_menu(strtolower($key), $temp, constant($key));
         case 'MODULE_PAYMENT_LINKPOINT_API_FRAUD_ALERT':
         case 'MODULE_PAYMENT_LINKPOINT_API_STORE_DATA':
             $temp = array(array('id' => '0', 'text' => TEXT_NO), array('id' => '1', 'text' => TEXT_YES));
             return html_pull_down_menu(strtolower($key), $temp, constant($key));
         case 'MODULE_PAYMENT_LINKPOINT_API_TRANSACTION_MODE':
             $temp = array(array('id' => 'Production', 'text' => TEXT_PRODUCTION), array('id' => 'DevelopersTest', 'text' => TEXT_DEV_TEST));
             return html_pull_down_menu(strtolower($key), $temp, constant($key));
         case 'MODULE_PAYMENT_LINKPOINT_API_DEBUG':
             $temp = array(array('id' => 'Off', 'text' => TEXT_OFF), array('id' => 'Failure Alerts Only', 'text' => TEXT_FAIL_ALERTS), array('id' => 'Log File', 'text' => TEXT_LOG_FILE), array('id' => 'Log and Email', 'text' => TEXT_LOG_EMAIL));
             return html_pull_down_menu(strtolower($key), $temp, constant($key));
         default:
             return parent::configure($key);
     }
 }
Example #8
0
    if ($check_address->fields['total'] != '1') {
        $_SESSION['billto'] = $_SESSION['customer_default_address_id'];
        $_SESSION['payment'] = '';
    }
}
require DIR_WS_CLASSES . 'order.php';
$order = new order();
// Load the selected shipping module(needed to calculate tax correctly)
require DIR_WS_CLASSES . 'shipping.php';
$shipping_modules = new shipping($_SESSION['shipping']);
require DIR_WS_CLASSES . 'order_total.php';
$order_total_modules = new order_total();
$order_total_modules->collect_posts();
$order_total_modules->pre_confirmation_check();
//  $_SESSION['comments'] = '';
$comments = $_SESSION['comments'];
$showTotal = $_SESSION['cart']->show_total();
$total_weight = $_SESSION['cart']->show_weight();
$total_count = $_SESSION['cart']->count_contents();
// load all enabled payment modules
require DIR_WS_CLASSES . 'payment.php';
$payment_modules = new payment();
$flagOnSubmit = sizeof($payment_modules->selection());
require DIR_WS_MODULES . zen_get_module_directory('require_languages.php');
if (isset($_GET['payment_error']) && is_object(${$_GET['payment_error']}) && ($error = ${$_GET['payment_error']}->get_error())) {
    $messageStack->add('checkout_payment', $error['error'], 'error');
}
$breadcrumb->add(NAVBAR_TITLE_1, zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
$breadcrumb->add(NAVBAR_TITLE_2);
// This should be last line of the script:
$zco_notifier->notify('NOTIFY_HEADER_END_CHECKOUT_PAYMENT');
Example #9
0
<?php

/*
 * Скрипт для приёма и отправки запросов
 * by Semen4ik 
 * Skype: Semenov1215
 * to RuBukkit.ORG
 */
session_start();
include "config.php";
require_once "payment.class.php";
$pay = new payment();
if (isset($_REQUEST['amount']) && isset($_REQUEST['payment'])) {
    header("Location: " . $pay->pay_form($_REQUEST['amount'], $pay->config['user_param'], $_REQUEST['payment']));
} else {
    if (isset($_REQUEST['method']) && isset($_REQUEST['params'])) {
        switch (strtolower($_REQUEST['method'])) {
            case "check":
                echo $pay->up_sign($_REQUEST['params']);
                break;
            case "pay":
                echo $pay->up_sign($_REQUEST['params']);
                $pay->pay($_REQUEST['params']['sum'], $_REQUEST['params']['account']);
                break;
            default:
                $pay->up_json_reply("error", $_REQUEST['params']);
                break;
        }
        exit;
    } else {
        if (isset($_GET['reply'])) {
Example #10
0
}
$_SESSION['payment_attempt']++;
$zco_notifier->notify('NOTIFY_CHECKOUT_SLAMMING_ALERT');
if ($_SESSION['payment_attempt'] > 3) {
    $zco_notifier->notify('NOTIFY_CHECKOUT_SLAMMING_LOCKOUT');
    $_SESSION['cart']->reset(TRUE);
    zen_session_destroy();
    zen_redirect(zen_href_link(FILENAME_TIME_OUT));
}
// END CC SLAM PREVENTION
if (!isset($credit_covers)) {
    $credit_covers = FALSE;
}
// load selected payment module
require DIR_WS_CLASSES . 'payment.php';
$payment_modules = new payment($_SESSION['payment']);
// load the selected shipping module
require DIR_WS_CLASSES . 'shipping.php';
$shipping_modules = new shipping($_SESSION['shipping']);
require DIR_WS_CLASSES . 'order.php';
$order = new order();
// prevent 0-entry orders from being generated/spoofed
if (sizeof($order->products) < 1) {
    zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
}
require DIR_WS_CLASSES . 'order_total.php';
$order_total_modules = new order_total();
$zco_notifier->notify('NOTIFY_CHECKOUT_PROCESS_BEFORE_ORDER_TOTALS_PRE_CONFIRMATION_CHECK');
if (strpos($GLOBALS[$_SESSION['payment']]->code, 'paypal') !== 0) {
    $order_totals = $order_total_modules->pre_confirmation_check();
}
Example #11
0
 public function __construct()
 {
     parent::__construct();
     $this->payment_fields = implode(':', array($_POST['bill_primary_name']));
 }
require_once DIR_WS_CLASSES . 'order.php';
$order = new order();
require_once DIR_WS_CLASSES . 'order_total.php';
// GV Code ICW ADDED FOR CREDIT CLASS SYSTEM
$order_total_modules = new order_total();
// GV Code ICW ADDED FOR CREDIT CLASS SYSTEM
$total_weight = $_SESSION['cart']->show_weight();
//  $total_count = $_SESSION['cart']->count_contents();
$total_count = $_SESSION['cart']->count_contents_virtual();
// GV Code ICW ADDED FOR CREDIT CLASS SYSTEM
if ($order->billing['country']['iso_code_2'] != EMPTY_STRING) {
    $_SESSION['delivery_zone'] = $order->billing['country']['iso_code_2'];
}
// load all enabled payment modules
require_once DIR_WS_CLASSES . 'payment.php';
$payment_modules = new payment();
$breadcrumb->add(NAVBAR_TITLE_1_CHECKOUT_PAYMENT, olc_href_link(FILENAME_CHECKOUT_SHIPPING, EMPTY_STRING, SSL));
$breadcrumb->add(NAVBAR_TITLE_2_CHECKOUT_PAYMENT, olc_href_link(FILENAME_CHECKOUT_PAYMENT, EMPTY_STRING, SSL));
//W. Kaiser - AJAX
$checkout_payment_text = 'checkout_payment';
$smarty->assign('FORM_ACTION', olc_draw_form($checkout_payment_text, olc_href_link(FILENAME_CHECKOUT_CONFIRMATION, EMPTY_STRING, SSL), 'post', 'onsubmit="return check_form_payment(\'' . $checkout_payment_text . '\');"'));
//W. Kaiser - AJAX
//---PayPal WPP Modification START ---//--
if (!$ec_enabled || $_GET['ec_cancel'] || !($_SESSION['paypal_ec_payer_id'] || $_SESSION['paypal_ec_payer_info'])) {
    //---PayPal WPP Modification END ---//--
    $smarty->assign('ADDRESS_LABEL', olc_address_label($_SESSION['customer_id'], $_SESSION['billto'], true, BLANK, HTML_BR));
    $smarty->assign('BUTTON_ADDRESS', HTML_A_START . olc_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, EMPTY_STRING, SSL) . '">' . olc_image_button('button_change_address.gif', IMAGE_BUTTON_CHANGE_ADDRESS) . HTML_A_END);
    $smarty->assign('BUTTON_CONTINUE', olc_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE));
    require DIR_WS_INCLUDES . 'header.php';
    if (isset($_GET['payment_error']) && is_object(${$_GET['payment_error']}) && ($error = ${$_GET['payment_error']}->get_error())) {
        $smarty->assign('error', '<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxNotice">
        if ($_POST['conditions'] == false) {
            $_SESSION['navigation']->remove_current_page();
            $_SESSION['navigation']->remove_last_page();

            $_SESSION['error_message'] = $aLang['error_conditions_not_accepted'];
            MyOOS_CoreApi::redirect(oos_href_link($aPages['checkout_payment'], '', 'SSL', true, false));
        }
    }


    // load the selected payment module
    require 'includes/classes/class_payment.php';

    if ($credit_covers) $_SESSION['payment'] = '';

    $oPaymentModules = new payment($_SESSION['payment']);
    require 'includes/classes/class_order_total.php';

    require 'includes/classes/class_order.php';
    $oOrder = new order;


    if ( (isset($_SESSION['shipping'])) && ($_SESSION['shipping']['id'] == 'free_free')) {
        if ( ($oOrder->info['total'] - $oOrder->info['shipping_cost']) < MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER ) {
            MyOOS_CoreApi::redirect(oos_href_link($aPages['checkout_shipping'], '', 'SSL'));
        }
    }

    $oPaymentModules->update_status();
    $oOrderTotalModules = new order_total;
    $oOrderTotalModules->collect_posts();
Example #14
0
 function server_callback()
 {
     $payment_name = is_array($payment_name = IReq::get('payment_name')) ? IFilter::act($payment_name[0]) : IFilter::act(IReq::get('payment_name'));
     //初始化参数
     $money = null;
     $message = null;
     $tradeno = null;
     //获取支付payment的id值
     $pObj = new IModel('payment as a,pay_plugin as b');
     $paymentRow = $pObj->getObj('b.file_path = "' . $payment_name . '" and a.plugin_id = b.id', 'a.id');
     //载入支付接口文件
     $paymentObj = new Payment();
     $payObj = $paymentObj->loadMethod($payment_name);
     if (!is_object($payObj)) {
         echo 'fail';
         exit;
     }
     //执行接口回调函数
     $return = $payObj->serverCallback(array_merge($_POST, $_GET), $paymentRow['id'], $money, $message, $tradeno);
     //判断返回状态
     if ($return == 1) {
         if (stripos($tradeno, 'recharge_') !== false) {
             $tradenoArray = explode('_', $tradeno);
             $recharge_no = isset($tradenoArray[1]) ? $tradenoArray[1] : 0;
             if (payment::updateRecharge($recharge_no)) {
                 echo 'success';
                 exit;
             } else {
                 echo 'fail';
             }
         } else {
             if (payment::updateOrder($tradeno)) {
                 echo 'success';
                 exit;
             } else {
                 echo 'fail';
             }
         }
     } else {
         echo 'fail';
     }
 }
// get all available shipping quotes
$quotes = $shipping_modules->quote();
// if no shipping method has been selected, automatically select the cheapest method.
// if the modules status was changed when none were available, to save on implementing
// a javascript force-selection method, also automatically select the cheapest shipping
// method if more than one module is now enabled
if (!isset($_SESSION['shipping']) || isset($_SESSION['shipping']) && $_SESSION['shipping'] == false && xtc_count_shipping_modules() > 1) {
    $_SESSION['shipping'] = $shipping_modules->cheapest();
}
if ($kein_versand == 1) {
    $_SESSION['shipping'] = false;
}
$order = new order();
// load all enabled payment modules
require DIR_WS_CLASSES . 'payment.php';
$payment_modules = new payment($_SESSION['payment']);
$payment_modules->update_status();
require DIR_WS_CLASSES . 'order_total.php';
// GV Code ICW ADDED FOR CREDIT CLASS SYSTEM
$order_total_modules = new order_total();
$order_total_modules->process();
// GV Code Start
$order_total_modules->collect_posts();
$order_total_modules->pre_confirmation_check();
// GV Code End
if (is_array($payment_modules->modules)) {
    $payment_modules->pre_confirmation_check();
}
$breadcrumb->add(NAVBAR_TITLE_PAYPAL_CHECKOUT, xtc_href_link(FILENAME_PAYPAL_CHECKOUT, '', 'SSL'));
require DIR_WS_INCLUDES . 'header.php';
if (SHOW_IP_LOG == 'true') {
Example #16
0
require DIR_WS_CLASSES . 'order_total.php';
$order_total_modules = new order_total();
$order_total_modules->collect_posts();
$order_total_modules->pre_confirmation_check();
// load the selected payment module
require DIR_WS_CLASSES . 'payment.php';
if (!isset($credit_covers)) {
    $credit_covers = FALSE;
}
//echo 'credit covers'.$credit_covers;
if ($credit_covers) {
    unset($_SESSION['payment']);
    $_SESSION['payment'] = '';
}
//@debug echo ($credit_covers == true) ? 'TRUE' : 'FALSE';
$payment_modules = new payment($_SESSION['payment']);
$payment_modules->update_status();
if (($_SESSION['payment'] == '' || !is_object(${$_SESSION}['payment'])) && $credit_covers === FALSE) {
    $messageStack->add_session('checkout_payment', ERROR_NO_PAYMENT_MODULE_SELECTED, 'error');
}
if (is_array($payment_modules->modules)) {
    $payment_modules->pre_confirmation_check();
}
if ($messageStack->size('checkout_payment') > 0) {
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
//echo $messageStack->size('checkout_payment');
//die('here');
// Stock Check
$flagAnyOutOfStock = false;
$stock_check = array();
}
if (!tep_session_is_registered('payment')) {
    tep_session_register('payment');
}
if (isset($HTTP_POST_VARS['payment'])) {
    $payment = $HTTP_POST_VARS['payment'];
}
if (!tep_session_is_registered('comments')) {
    tep_session_register('comments');
}
if (tep_not_null($HTTP_POST_VARS['comments'])) {
    $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
}
// load the selected payment module
require DIR_WS_CLASSES . 'payment.php';
$payment_modules = new payment($payment);
require DIR_WS_CLASSES . 'order.php';
$order = new order();
$payment_modules->update_status();
if ($payment_modules->selected_module != $payment || is_array($payment_modules->modules) && sizeof($payment_modules->modules) > 1 && !is_object(${$payment}) || is_object(${$payment}) && ${$payment}->enabled == false) {
    tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));
}
if (is_array($payment_modules->modules)) {
    $payment_modules->pre_confirmation_check();
}
// load the selected shipping module
require DIR_WS_CLASSES . 'shipping.php';
$shipping_modules = new shipping($shipping);
require DIR_WS_CLASSES . 'order_total.php';
$order_total_modules = new order_total();
$order_total_modules->process();
Example #18
0
 $order = order_info($order_id);
 /*if ($payment['is_cod'] == 1)
   {
       $order = order_info($order_id);
       $region_id_list = array(
           $order['country'], $order['province'], $order['city'], $order['district']
       );
       $shipping = shipping_area_info($order['shipping_id'], $region_id_list);
       $pay_fee = pay_fee($pay_id, $order_amount, $shipping['pay_fee']);
   }
   else
   {
       $pay_fee = pay_fee($pay_id, $order_amount);
   }*/
 include_once '../includes/modules/payment/payment.php';
 $pay_obj = new payment();
 $order['pay_num'] = $pay_obj->pay_set($order_id, $pay_id, $order_amount);
 /* 保存订单 */
 /* $order = array(
        'pay_id' => $pay_id,
        'pay_name' => addslashes($payment['pay_name']),
        'pay_fee' => $pay_fee
    );
    update_order($order_id, $order);*/
 update_order_amount($order_id);
 /* 更新 pay_log */
 update_pay_log($order_id);
 /* todo 记录日志 */
 $sn = $old_order['order_sn'];
 $new_order = order_info($order_id);
 if ($old_order['total_fee'] != $new_order['total_fee']) {
 function payment_esolutions($config)
 {
     parent::payment($config);
     add_member_field('esolutions_card_id', 'Esolutions Customer Card Id', '', '');
 }
Example #20
0
     $paypal_data .= "\n{$key}: {$value}";
 }
 $logger->log('ACH Data:', Zend_Log::INFO);
 $logger->log($paypal_data, Zend_Log::INFO);
 $check_payment = new payment();
 $check_payment->filter = 'online_payment_id';
 $check_payment->online_payment_id = $_POST['pg_consumerorderid'];
 $check_payment->domain_id = '1';
 $number_of_payments = $check_payment->count();
 $logger->log('ACH - number of times this payment is in the db: ' . $number_of_payments, Zend_Log::INFO);
 if ($number_of_payments > 0) {
     $xml_message = 'Online payment for invoices: ' . $_POST['pg_consumerorderid'] . ' has already been entered into Simple Invoices';
     $logger->log($xml_message, Zend_Log::INFO);
 }
 if ($number_of_payments == '0') {
     $payment = new payment();
     $payment->ac_inv_id = $_POST['pg_consumerorderid'];
     $payment->ac_amount = $_POST['pg_total_amount'];
     $payment->ac_notes = $paypal_data;
     $payment->ac_date = date('Y-m-d');
     $payment->online_payment_id = $_POST['pg_consumerorderid'];
     $payment->domain_id = '1';
     $payment_type = new payment_type();
     $payment_type->type = "ACH";
     $payment_type->domain_id = '1';
     $payment->ac_payment_type = $payment_type->select_or_insert_where();
     $logger->log('ACH - payment_type=' . $payment->ac_payment_type, Zend_Log::INFO);
     $payment->insert();
     $invoiceobj = new invoice();
     $invoice = $invoiceobj->select($_POST['pg_consumerorderid']);
     $biller = getBiller($invoice['biller_id']);
 function payment_micropayment_cc($config)
 {
     parent::payment($config);
     add_product_field('micropayment_cc_project', 'Micropayment_cc Project Code', 'text', '');
     add_member_field('micropayment_cc_customer_vault_id', 'Micropayment_cc Customer Vault Id', '', '');
 }
if (!tep_session_is_registered('shipping') || !tep_session_is_registered('sendto')) {
    tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
}
if (tep_not_null(MODULE_PAYMENT_INSTALLED) && !tep_session_is_registered('payment')) {
    tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
// avoid hack attempts during the checkout procedure by checking the internal cartID
if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
    if ($cart->cartID != $cartID) {
        tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
    }
}
include DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS;
// load selected payment module
require DIR_WS_CLASSES . 'payment.php';
$payment_modules = new payment($payment);
// load the selected shipping module
require DIR_WS_CLASSES . 'shipping.php';
$shipping_modules = new shipping($shipping);
require DIR_WS_CLASSES . 'order.php';
$order = new order();
// Stock Check
$any_out_of_stock = false;
if (STOCK_CHECK == 'true') {
    for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
        if (tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) {
            $any_out_of_stock = true;
        }
    }
    // Out of Stock
    if (STOCK_ALLOW_CHECKOUT != 'true' && $any_out_of_stock == true) {
        $_SESSION['billto'] = $_SESSION['customer_default_address_id'];
        if (isset($_SESSION['payment'])) {
            unset($_SESSION['payment']);
        }
    }
}
require 'includes/classes/class_order.php';
$oOrder = new order();
require 'includes/classes/class_order_total.php';
$oOrderTotalModules = new order_total();
$total_weight = $_SESSION['cart']->show_weight();
$total_count = $_SESSION['cart']->count_contents();
$total_count = $_SESSION['cart']->count_contents_virtual();
// load all enabled payment modules
require 'includes/classes/class_payment.php';
$oPaymentModules = new payment();
$selection = $oPaymentModules->selection();
$credit_selection = $oOrderTotalModules->credit_selection();
// links breadcrumb
$oBreadcrumb->add($aLang['navbar_title_1'], oos_href_link($aPages['checkout_shipping'], '', 'SSL'));
$oBreadcrumb->add($aLang['navbar_title_2'], oos_href_link($aPages['checkout_payment'], '', 'SSL'));
if (ENABLE_SSL == '1') {
    $condition_link = OOS_HTTPS_SERVER;
} else {
    $condition_link = OOS_HTTP_SERVER;
}
$condition_link .= OOS_SHOP . OOS_MEDIA . $sLanguage . '/' . $aFilename['conditions_download'];
ob_start();
require 'js/checkout_payment.js.php';
print $oPaymentModules->javascript_validation();
$javascript = ob_get_contents();
Example #24
0
<?php

/*
  $Id: shopping_cart.php 1739 2007-12-20 00:52:16Z hpdl $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2007 osCommerce

  Released under the GNU General Public License
*/
require "includes/application_top.php";
if ($cart->count_contents() > 0) {
    include DIR_WS_CLASSES . 'payment.php';
    $payment_modules = new payment();
}
require DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOPPING_CART;
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SHOPPING_CART));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php 
echo HTML_PARAMS;
?>
>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo CHARSET;
?>
">
<title><?php 
if (!tep_session_is_registered('sendto')) {
    tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
if (tep_not_null(MODULE_PAYMENT_INSTALLED) && !tep_session_is_registered('payment')) {
    tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
// avoid hack attempts during the checkout procedure by checking the internal cartID
if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
    if ($cart->cartID != $cartID) {
        tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
    }
}
include DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS;
// load selected payment module
require DIR_WS_CLASSES . 'payment.php';
$payment_modules = new payment($payment);
// load the selected shipping module
require DIR_WS_CLASSES . 'shipping.php';
$shipping_modules = new shipping($shipping);
require DIR_WS_CLASSES . 'order.php';
$order = new order();
// load the before_process function from the payment modules
$payment_modules->before_process();
require DIR_WS_CLASSES . 'order_total.php';
$order_total_modules = new order_total();
$order_totals = $order_total_modules->process();
$sql_data_array = array('customers_id' => $customer_id, 'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'], 'customers_company' => $order->customer['company'], 'customers_street_address' => $order->customer['street_address'], 'customers_suburb' => $order->customer['suburb'], 'customers_city' => $order->customer['city'], 'customers_postcode' => $order->customer['postcode'], 'customers_state' => $order->customer['state'], 'customers_country' => $order->customer['country']['title'], 'customers_telephone' => $order->customer['telephone'], 'customers_email_address' => $order->customer['email_address'], 'customers_address_format_id' => $order->customer['format_id'], 'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'], 'delivery_company' => $order->delivery['company'], 'delivery_street_address' => $order->delivery['street_address'], 'delivery_suburb' => $order->delivery['suburb'], 'delivery_city' => $order->delivery['city'], 'delivery_postcode' => $order->delivery['postcode'], 'delivery_state' => $order->delivery['state'], 'delivery_country' => $order->delivery['country']['title'], 'delivery_address_format_id' => $order->delivery['format_id'], 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], 'billing_company' => $order->billing['company'], 'billing_street_address' => $order->billing['street_address'], 'billing_suburb' => $order->billing['suburb'], 'billing_city' => $order->billing['city'], 'billing_postcode' => $order->billing['postcode'], 'billing_state' => $order->billing['state'], 'billing_country' => $order->billing['country']['title'], 'billing_address_format_id' => $order->billing['format_id'], 'payment_method' => $order->info['payment_method'], 'cc_type' => $order->info['cc_type'], 'cc_owner' => $order->info['cc_owner'], 'cc_number' => $order->info['cc_number'], 'cc_expires' => $order->info['cc_expires'], 'date_purchased' => 'now()', 'orders_status' => $order->info['order_status'], 'currency' => $order->info['currency'], 'currency_value' => $order->info['currency_value']);
tep_db_perform(TABLE_ORDERS, $sql_data_array);
$insert_id = tep_db_insert_id();
for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
    $sql_data_array = array('orders_id' => $insert_id, 'title' => $order_totals[$i]['title'], 'text' => $order_totals[$i]['text'], 'value' => $order_totals[$i]['value'], 'class' => $order_totals[$i]['code'], 'sort_order' => $order_totals[$i]['sort_order']);
Example #26
0
        ?>
</li></ul>
				</div>
				<!--/Pagination----------->
			</div>
		<?php 
    } else {
        echo '<h3>No transaction</h3>';
    }
}
?>

<?php 
if ($_GET['t'] == 'ownerTransaction') {
    $owner_id = $_SESSION['user']['id'];
    $query = payment::payment_by_user($owner_id);
    $res_trans_object = new PS_Pagination($conn, $query, 10, 5, "type=transaction&t=ownerTransaction");
    $res_trans = $res_trans_object->paginate();
    // if All messages seleted
    if (mysql_num_rows($res_trans) > 0) {
        ?>

			<div class="dashboardinbox">

				<div class="dasbmessagesbdr fontbld font18">	
						<div class="datediv">S.No</div>
						<div class="inboxcnt">Item</div>
						<div class="datediv">Renter</div>
						<div class="datediv pL20">Amount</div>
						<div class="datediv">Date</div>	
				</div>
Example #27
0
<?php

//stop the direct browsing to this file - let index.php handle which files get displayed
checkLogin();
# Deal with op and add some basic sanity checking
#insert - process payment
#op=pay_selected_invoice means the user came from the print_view or manage_invoces
#op=pay_invoice means the user came from the process_paymen page
global $db_server;
global $auth_session;
if (isset($_POST['process_payment'])) {
    $payment = new payment();
    $payment->ac_inv_id = $_POST['invoice_id'];
    $payment->ac_amount = $_POST['ac_amount'];
    $payment->ac_notes = $_POST['ac_notes'];
    $payment->ac_date = SqlDateWithTime($_POST['ac_date']);
    $payment->ac_payment_type = $_POST['ac_payment_type'];
    $result = $payment->insert();
    $saved = !empty($result) ? "true" : "false";
    if ($saved == 'true') {
        $display_block = $LANG['save_payment_success'];
    } else {
        $display_block = $LANG['save_payment_failure'] . "<br />" . $sql;
    }
    $refresh_total = "<meta http-equiv='refresh' content='27;url=index.php?module=payments&view=manage' />";
}
$smarty->assign('display_block', $display_block);
$smarty->assign('pageActive', 'payment');
$smarty->assign('active_tab', '#money');
	window.close();
}
';
    }
    $script .= '
//--></script>

<script language="javascript" type="text/javascript" src="' . $tpl_path . 'includes/general.js"></script>';
    //}
    if ($load_all_scripts || NOT_IS_AJAX_PROCESSING) {
        $script_transient = EMPTY_STRING;
        if ($load_all_scripts || strstr($PHP_SELF, FILENAME_CHECKOUT_PAYMENT)) {
            if ($load_all_scripts) {
                // load all enabled payment modules
                require_once DIR_WS_CLASSES . 'payment.php';
                $payment_modules = new payment();
            }
            $script_transient .= $payment_modules->javascript_validation();
            if ($load_all_scripts) {
                unset($payment_modules);
            }
        }
        if ($load_all_scripts || strstr($PHP_SELF, FILENAME_CREATE_ACCOUNT)) {
            $get_form_check = true;
        } elseif (strstr($PHP_SELF, FILENAME_CREATE_GUEST_ACCOUNT)) {
            $get_form_check = true;
        } elseif (strstr($PHP_SELF, FILENAME_ACCOUNT_PASSWORD)) {
            $get_form_check = true;
        } elseif (strstr($PHP_SELF, FILENAME_ACCOUNT_EDIT)) {
            $get_form_check = true;
        } elseif (strstr($PHP_SELF, FILENAME_ADDRESS_BOOK_PROCES)) {
Example #29
0
	$table_invoice = new Table("cc_invoice", "status,paid_status");
	$clause_invoice = "id = " . $item_id;
	$result = $table_invoice->Get_list($DBHandle, $clause_invoice);
	if (is_array($result) && $result[0]['status'] == 1 && $result[0]['paid_status'] == 0) {
		$table_invoice_item = new Table("cc_invoice_item", "COALESCE(SUM(price*(1+(vat/100))),0)");
		$clause_invoice_item = "id_invoice = " . $item_id;
		$result = $table_invoice_item->Get_list($DBHandle, $clause_invoice_item);
		$amount = $result[0][0];

		$static_amount = true;
	}
}
$smarty->display('main.tpl');
$HD_Form->create_toppage($form_action);

$payment_modules = new payment;
?>
<script language="javascript">
function checkamount()
{
 	if (document.checkout_amount.amount == "")
	{
		alert('Please enter some amount.');
		return false;
	}
	return true;
}
</script>
<script language="javascript"><!--
var selected;
Example #30
0
 function _process()
 {
     global $osC_Database, $osC_Session, $osC_Customer, $osC_Currencies, $cart, $order, $payment_modules, $shipping_modules, $order_total_modules;
     // load selected payment module
     require DIR_WS_CLASSES . 'payment.php';
     $payment_modules = new payment($osC_Session->value('payment'));
     // load the selected shipping module
     require DIR_WS_CLASSES . 'shipping.php';
     $shipping_modules = new shipping($osC_Session->value('shipping'));
     $order = new order();
     // load the before_process function from the payment modules
     $payment_modules->before_process();
     require DIR_WS_CLASSES . 'order_total.php';
     $order_total_modules = new order_total();
     $order_totals = $order_total_modules->process();
     $Qorder = $osC_Database->query('insert into :table_orders (customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, customers_ip_address, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, date_purchased, orders_status, currency, currency_value) values (:customers_id, :customers_name, :customers_company, :customers_street_address, :customers_suburb, :customers_city, :customers_postcode, :customers_state, :customers_country, :customers_telephone, :customers_email_address, :customers_address_format_id, :customers_ip_address, :delivery_name, :delivery_company, :delivery_street_address, :delivery_suburb, :delivery_city, :delivery_postcode, :delivery_state, :delivery_country, :delivery_address_format_id, :billing_name, :billing_company, :billing_street_address, :billing_suburb, :billing_city, :billing_postcode, :billing_state, :billing_country, :billing_address_format_id, :payment_method, :cc_type, :cc_owner, :cc_number, :cc_expires, :date_purchased, :orders_status, :currency, :currency_value)');
     $Qorder->bindTable(':table_orders', TABLE_ORDERS);
     $Qorder->bindInt(':customers_id', $osC_Customer->id);
     $Qorder->bindValue(':customers_name', $order->customer['firstname'] . ' ' . $order->customer['lastname']);
     $Qorder->bindValue(':customers_company', $order->customer['company']);
     $Qorder->bindValue(':customers_street_address', $order->customer['street_address']);
     $Qorder->bindValue(':customers_suburb', $order->customer['suburb']);
     $Qorder->bindValue(':customers_city', $order->customer['city']);
     $Qorder->bindValue(':customers_postcode', $order->customer['postcode']);
     $Qorder->bindValue(':customers_state', $order->customer['state']);
     $Qorder->bindValue(':customers_country', $order->customer['country']['title']);
     $Qorder->bindValue(':customers_telephone', $order->customer['telephone']);
     $Qorder->bindValue(':customers_email_address', $order->customer['email_address']);
     $Qorder->bindInt(':customers_address_format_id', $order->customer['format_id']);
     $Qorder->bindValue(':customers_ip_address', tep_get_ip_address());
     $Qorder->bindValue(':delivery_name', $order->delivery['firstname'] . ' ' . $order->delivery['lastname']);
     $Qorder->bindValue(':delivery_company', $order->delivery['company']);
     $Qorder->bindValue(':delivery_street_address', $order->delivery['street_address']);
     $Qorder->bindValue(':delivery_suburb', $order->delivery['suburb']);
     $Qorder->bindValue(':delivery_city', $order->delivery['city']);
     $Qorder->bindValue(':delivery_postcode', $order->delivery['postcode']);
     $Qorder->bindValue(':delivery_state', $order->delivery['state']);
     $Qorder->bindValue(':delivery_country', $order->delivery['country']['title']);
     $Qorder->bindInt(':delivery_address_format_id', $order->delivery['format_id']);
     $Qorder->bindValue(':billing_name', $order->billing['firstname'] . ' ' . $order->billing['lastname']);
     $Qorder->bindValue(':billing_company', $order->billing['company']);
     $Qorder->bindValue(':billing_street_address', $order->billing['street_address']);
     $Qorder->bindValue(':billing_suburb', $order->billing['suburb']);
     $Qorder->bindValue(':billing_city', $order->billing['city']);
     $Qorder->bindValue(':billing_postcode', $order->billing['postcode']);
     $Qorder->bindValue(':billing_state', $order->billing['state']);
     $Qorder->bindValue(':billing_country', $order->billing['country']['title']);
     $Qorder->bindInt(':billing_address_format_id', $order->billing['format_id']);
     $Qorder->bindValue(':payment_method', $order->info['payment_method']);
     $Qorder->bindValue(':cc_type', $order->info['cc_type']);
     $Qorder->bindValue(':cc_owner', $order->info['cc_owner']);
     $Qorder->bindValue(':cc_number', $order->info['cc_number']);
     $Qorder->bindValue(':cc_expires', $order->info['cc_expires']);
     $Qorder->bindRaw(':date_purchased', 'now()');
     $Qorder->bindValue(':orders_status', $order->info['order_status']);
     $Qorder->bindValue(':currency', $order->info['currency']);
     $Qorder->bindValue(':currency_value', $order->info['currency_value']);
     $Qorder->execute();
     $insert_id = $osC_Database->nextID();
     for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
         $Qtotals = $osC_Database->query('insert into :table_orders_total (orders_id, title, text, value, class, sort_order) values (:orders_id, :title, :text, :value, :class, :sort_order)');
         $Qtotals->bindTable(':table_orders_total', TABLE_ORDERS_TOTAL);
         $Qtotals->bindInt(':orders_id', $insert_id);
         $Qtotals->bindValue(':title', $order_totals[$i]['title']);
         $Qtotals->bindValue(':text', $order_totals[$i]['text']);
         $Qtotals->bindValue(':value', $order_totals[$i]['value']);
         $Qtotals->bindValue(':class', $order_totals[$i]['code']);
         $Qtotals->bindInt(':sort_order', $order_totals[$i]['sort_order']);
         $Qtotals->execute();
     }
     $Qstatus = $osC_Database->query('insert into :table_orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values (:orders_id, :orders_status_id, :date_added, :customer_notified, :comments)');
     $Qstatus->bindTable(':table_orders_status_history', TABLE_ORDERS_STATUS_HISTORY);
     $Qstatus->bindInt(':orders_id', $insert_id);
     $Qstatus->bindInt(':orders_status_id', $order->info['order_status']);
     $Qstatus->bindRaw(':date_added', 'now()');
     $Qstatus->bindInt(':customer_notified', SEND_EMAILS == 'true' ? '1' : '0');
     $Qstatus->bindValue(':comments', $order->info['comments']);
     $Qstatus->execute();
     // initialized for the email confirmation
     $products_ordered = '';
     $subtotal = 0;
     $total_tax = 0;
     $total_weight = 0;
     $total_cost = 0;
     for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
         // Stock Update - Joao Correia
         if (STOCK_LIMITED == 'true') {
             if (DOWNLOAD_ENABLED == 'true') {
                 $Qstock = $osC_Database->query('select products_quantity, pad.products_attributes_filename from :table_products p left join :table_products_attributes pa on (p.products_id = pa.products_id) left join :table_products_attributes_download pad on (pa.products_attributes_id = pad.products_attributes_id) where p.products_id = :products_id');
                 $Qstock->bindTable(':table_products', TABLE_PRODUCTS);
                 $Qstock->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES);
                 $Qstock->bindTable(':table_products_attributes_download', TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD);
                 $Qstock->bindInt(':products_id', tep_get_prid($order->products[$i]['id']));
                 // Will work with only one option for downloadable products otherwise, we have to build the query dynamically with a loop
                 $products_attributes = $order->products[$i]['attributes'];
                 if (is_array($products_attributes)) {
                     $Qstock->appendQuery('and pa.options_id = :options_id and pa.options_values_id = :options_values_id');
                     $Qstock->bindInt(':options_id', $products_attributes[0]['option_id']);
                     $Qstock->bindInt(':options_values_id', $products_attributes[0]['value_id']);
                 }
             } else {
                 $Qstock = $osC_Database->query('select products_quantity from :table_products where products_id = :products_id');
                 $Qstock->bindTable(':table_products', TABLE_PRODUCTS);
                 $Qstock->bindInt(':products_id', tep_get_prid($order->products[$i]['id']));
             }
             $Qstock->execute();
             if ($Qstock->numberOfRows() > 0) {
                 $stock_left = $Qstock->valueInt('products_quantity');
                 // do not decrement quantities if products_attributes_filename exists
                 if (DOWNLOAD_ENABLED != 'true' || DOWNLOAD_ENABLED == 'true' && strlen($Qstock->value('products_attributes_filename')) < 1) {
                     $stock_left = $stock_left - $order->products[$i]['qty'];
                     $Qupdate = $osC_Database->query('update :table_products set products_quantity = :products_quantity where products_id = :products_id');
                     $Qupdate->bindTable(':table_products', TABLE_PRODUCTS);
                     $Qupdate->bindInt(':products_quantity', $stock_left);
                     $Qupdate->bindInt(':products_id', tep_get_prid($order->products[$i]['id']));
                     $Qupdate->execute();
                 }
                 if (STOCK_ALLOW_CHECKOUT == 'false' && $stock_left < 1) {
                     $Qupdate = $osC_Database->query('update :table_products set products_status = :products_status where products_id = :products_id');
                     $Qupdate->bindTable(':table_products', TABLE_PRODUCTS);
                     $Qupdate->bindInt(':products_status', 0);
                     $Qupdate->bindInt(':products_id', tep_get_prid($order->products[$i]['id']));
                     $Qupdate->execute();
                 }
             }
         }
         // Update products_ordered (for bestsellers list)
         $Qupdate = $osC_Database->query('update :table_products set products_ordered = products_ordered + :products_ordered where products_id = :products_id');
         $Qupdate->bindTable(':table_products', TABLE_PRODUCTS);
         $Qupdate->bindInt(':products_ordered', $order->products[$i]['qty']);
         $Qupdate->bindInt(':products_id', tep_get_prid($order->products[$i]['id']));
         $Qupdate->execute();
         $Qproducts = $osC_Database->query('insert into :table_orders_products (orders_id, products_id, products_model, products_name, products_price, final_price, products_tax, products_quantity) values (:orders_id, :products_id, :products_model, :products_name, :products_price, :final_price, :products_tax, :products_quantity)');
         $Qproducts->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
         $Qproducts->bindInt(':orders_id', $insert_id);
         $Qproducts->bindInt(':products_id', tep_get_prid($order->products[$i]['id']));
         $Qproducts->bindValue(':products_model', $order->products[$i]['model']);
         $Qproducts->bindValue(':products_name', $order->products[$i]['name']);
         $Qproducts->bindValue(':products_price', $order->products[$i]['price']);
         $Qproducts->bindValue(':final_price', $order->products[$i]['final_price']);
         $Qproducts->bindValue(':products_tax', $order->products[$i]['tax']);
         $Qproducts->bindInt(':products_quantity', $order->products[$i]['qty']);
         $Qproducts->execute();
         $order_products_id = $osC_Database->nextID();
         //------insert customer choosen option to order--------
         $attributes_exist = '0';
         $products_ordered_attributes = '';
         if (isset($order->products[$i]['attributes'])) {
             $attributes_exist = '1';
             for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) {
                 if (DOWNLOAD_ENABLED == 'true') {
                     $Qattributes = $osC_Database->query('select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount, pad.products_attributes_filename from :table_products_options popt, :table_products_options_values poval, :table_products_attributes pa left join :table_products_attributes_download pad on (pa.products_attributes_id = pad.products_attributes_id) where pa.products_id = :products_id and pa.options_id = :options_id and pa.options_id = popt.products_options_id and pa.options_values_id = :options_values_id and pa.options_values_id = poval.products_options_values_id and popt.language_id = :popt_language_id and poval.language_id = :poval_language_id');
                     $Qattributes->bindTable(':table_products_options', TABLE_PRODUCTS_OPTIONS);
                     $Qattributes->bindTable(':table_products_options_values', TABLE_PRODUCTS_OPTIONS_VALUES);
                     $Qattributes->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES);
                     $Qattributes->bindTable(':table_products_attributes_download', TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD);
                     $Qattributes->bindInt(':products_id', $order->products[$i]['id']);
                     $Qattributes->bindInt(':options_id', $order->products[$i]['attributes'][$j]['option_id']);
                     $Qattributes->bindInt(':options_values_id', $order->products[$i]['attributes'][$j]['value_id']);
                     $Qattributes->bindInt(':popt_language_id', $osC_Session->value('languages_id'));
                     $Qattributes->bindInt(':poval_language_id', $osC_Session->value('languages_id'));
                 } else {
                     $Qattributes = $osC_Database->query('select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from :table_products_options popt, :table_products_options_values poval, :table_products_attributes pa where pa.products_id = :products_id and pa.options_id = :options_id and pa.options_id = popt.products_options_id and pa.options_values_id = :options_values_id and pa.options_values_id = poval.products_options_values_id and popt.language_id = :popt_language_id and poval.language_id = :poval_language_id');
                     $Qattributes->bindTable(':table_products_options', TABLE_PRODUCTS_OPTIONS);
                     $Qattributes->bindTable(':table_products_options_values', TABLE_PRODUCTS_OPTIONS_VALUES);
                     $Qattributes->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES);
                     $Qattributes->bindInt(':products_id', $order->products[$i]['id']);
                     $Qattributes->bindInt(':options_id', $order->products[$i]['attributes'][$j]['option_id']);
                     $Qattributes->bindInt(':options_values_id', $order->products[$i]['attributes'][$j]['value_id']);
                     $Qattributes->bindInt(':popt_language_id', $osC_Session->value('languages_id'));
                     $Qattributes->bindInt(':poval_language_id', $osC_Session->value('languages_id'));
                 }
                 $Qattributes->execute();
                 $Qopa = $osC_Database->query('insert into :table_orders_products_attributes (orders_id, orders_products_id, products_options, products_options_values, options_values_price, price_prefix) values (:orders_id, :orders_products_id, :products_options, :products_options_values, :options_values_price, :price_prefix)');
                 $Qopa->bindTable(':table_orders_products_attributes', TABLE_ORDERS_PRODUCTS_ATTRIBUTES);
                 $Qopa->bindInt(':orders_id', $insert_id);
                 $Qopa->bindInt(':orders_products_id', $order_products_id);
                 $Qopa->bindValue(':products_options', $attributes_values['products_options_name']);
                 $Qopa->bindValue(':products_options_values', $attributes_values['products_options_values_name']);
                 $Qopa->bindValue(':options_values_price', $attributes_values['options_values_price']);
                 $Qopa->bindValue(':price_prefix', $attributes_values['price_prefix']);
                 $Qopa->execute();
                 if (DOWNLOAD_ENABLED == 'true' && strlen($Qattributes->value('products_attributes_filename')) > 0) {
                     $Qopd = $osC_Database->query('insert into :table_orders_products_download (orders_id, orders_products_id, orders_products_filename, download_maxdays, download_count) values (:orders_id, :orders_products_id, :orders_products_filename, :download_maxdays, :download_count)');
                     $Qopd->bindTable(':table_orders_products_download', TABLE_ORDERS_PRODUCTS_DOWNLOAD);
                     $Qopd->bindInt(':orders_id', $insert_id);
                     $Qopd->bindInt(':orders_products_id', $order_products_id);
                     $Qopd->bindValue(':orders_products_filename', $Qattributes->value('products_attributes_filename'));
                     $Qopd->bindValue(':download_maxdays', $Qattributes->value('products_attributes_maxdays'));
                     $Qopd->bindValue(':download_count', $Qattributes->value('products_attributes_maxcount'));
                     $Qopd->execute();
                 }
                 $products_ordered_attributes .= "\n\t" . $Qattributes->value('products_options_name') . ' ' . $Qattributes->value('products_options_values_name');
             }
         }
         //------insert customer choosen option eof ----
         $total_weight += $order->products[$i]['qty'] * $order->products[$i]['weight'];
         $total_tax += tep_calculate_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'];
         $total_cost += $order->products[$i]['final_price'];
         $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $osC_Currencies->displayPrice($order->products[$i]['final_price'], $order->products[$i]['tax_class_id'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
     }
     // lets start with the email confirmation
     $email_order = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT, 'orders=' . $insert_id, 'SSL', false) . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
     if ($order->info['comments']) {
         $email_order .= tep_output_string_protected($order->info['comments']) . "\n\n";
     }
     $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $products_ordered . EMAIL_SEPARATOR . "\n";
     for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
         $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
     }
     if ($order->content_type != 'virtual') {
         $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($osC_Customer->id, $osC_Session->value('sendto'), 0, '', "\n") . "\n";
     }
     $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($osC_Customer->id, $osC_Session->value('billto'), 0, '', "\n") . "\n\n";
     $payment =& $osC_Session->value('payment');
     if (is_object(${$payment})) {
         $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n";
         $payment_class = ${$payment};
         $email_order .= $payment_class->title . "\n\n";
         if (isset($payment_class->email_footer)) {
             $email_order .= $payment_class->email_footer . "\n\n";
         }
     }
     tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
     // send emails to other people
     if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
         tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
     }
     // load the after_process function from the payment modules
     $payment_modules->after_process();
     $cart->reset(true);
     // unregister session variables used during checkout
     $osC_Session->remove('sendto');
     $osC_Session->remove('billto');
     $osC_Session->remove('shipping');
     $osC_Session->remove('payment');
     $osC_Session->remove('comments');
     tep_redirect(tep_href_link(FILENAME_CHECKOUT, 'success', 'SSL'));
 }