<?php /* $Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require 'includes/application_top.php'; require DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT; if ($_GET["process"] == "pending") { $_SESSION['customers'] = array("name" => $_POST['hoten'], "email" => $_POST['email'], "address" => $_POST['diachi'], "telephone" => $_POST['dienthoai']); require_once "nganluong.php"; $nl = new NL_Checkout(); $return_url = "http://hotelonline.viit-group.com/complete.php"; //dia chi thanh toan thanh cong $transaction_info = $_GET['osCsid']; //thong tin giao dich $receiver = "*****@*****.**"; //tai khoan chu hotel $order_code = "Phòng khách sạn"; //ma hoa don $price = "2000"; $url = $nl->buildCheckoutUrl($return_url, $receiver, $transaction_info, $order_code, $price); // print_r($_SESSION['customers']); tep_redirect($url); exit; } ?>
while ($row = $result->fetch()) { $payment = $row['payment']; $array_data_payment[$payment] = array('config' => array(), 'orders_id' => array(), 'data' => array()); $array_data_payment[$payment]['domain'] = $row['domain']; $array_data_payment[$payment]['paymentname'] = $row['paymentname']; if (file_exists(NV_ROOTDIR . '/modules/' . $module_file . '/payment/' . $payment . '.config.ini')) { $array_data_payment[$payment]['config'] = unserialize(nv_base64_decode($row['config'])); } } // Check lai cac don hang $checkpayment = $nv_Request->get_string('checkpayment', 'post,get', ''); if (!empty($checkpayment) and $checkpayment == md5($order_id . session_id() . $global_config['sitekey'])) { $order_code = $data_content['order_code']; require_once NV_ROOTDIR . '/modules/' . $module_file . '/payment/nganluong.class.php'; $payment_config = $array_data_payment['nganluong']['config']; $nl = new NL_Checkout($payment_config['checkout_url'], $payment_config['merchant_site'], $payment_config['secure_pass']); $transaction_i = $nl->checkOrder($payment_config['public_api_url'], $order_code, 0); if ($transaction_i !== false) { print_r($transaction_i); die; } } $a = 1; $array_transaction = array(); $result = $db->query('SELECT * FROM ' . $db_config['prefix'] . '_' . $module_data . '_transaction WHERE order_id=' . $order_id . ' ORDER BY transaction_id ASC'); if ($result->rowCount()) { $array_payment = array(); while ($row = $result->fetch()) { $row['a'] = $a++; $row['transaction_time'] = nv_date('H:i:s d/m/y', $row['transaction_time']); $row['order_id'] = !empty($row['order_id']) ? $row['order_id'] : '';
<?php /** * @Project NUKEVIET 4.x * @Author VINADES., JSC (contact@vinades.vn) * @Copyright (C) 2014 VINADES ., JSC. All rights reserved * @License GNU/GPL version 2 or any later version * @Createdate Dec 29, 2010 10:42:00 PM */ if (!defined('NV_IS_MOD_SHOPS')) { die('Stop!!!'); } require_once NV_ROOTDIR . "/modules/" . $module_file . "/payment/nganluong.class.php"; $nl = new NL_Checkout($payment_config['checkout_url'], $payment_config['merchant_site'], $payment_config['secure_pass']); $data_orders_return = $nl->checkOrders($payment_config['public_api_url'], $array_order); foreach ($data_orders_return as $data_transaction_id) { if ($data_transaction_id['TRANSACTION_ERROR_CODE'] == '00') { $order_code = $data_transaction_id['ORDER_CODE']; $payment_data = nv_base64_encode(serialize($data_transaction_id)); $payment_data_old = $array_order[$order_code]['payment_data']; if ($payment_data != $payment_data_old) { $nv_transaction_status = intval($data_transaction_id['nv_transaction_status']); $payment_amount = intval($data_transaction_id['AMOUNT']); $payment_time = max($data_transaction_id['CREATED_TIME'], $data_transaction_id['PAID_TIME']); $order_id = $array_order[$order_code]['order_id']; $payment_id = intval($data_transaction_id['PAYMENT_ID']); $transaction_id = $db->insert_id("INSERT INTO " . $db_config['prefix'] . "_" . $module_data . "_transaction (transaction_id, transaction_time, transaction_status, order_id, userid, payment, payment_id, payment_time, payment_amount, payment_data) VALUES (NULL, " . NV_CURRENTTIME . ", '" . $nv_transaction_status . "', '" . $order_id . "', '0', '" . $payment . "', '" . $payment_id . "', '" . $payment_time . "', '" . $payment_amount . "', '" . $payment_data . "')"); if ($transaction_id > 0) { $db->query("UPDATE " . $db_config['prefix'] . "_" . $module_data . "_orders SET transaction_status=" . $nv_transaction_status . " , transaction_id = " . $transaction_id . " , transaction_count = transaction_count+1 WHERE order_id=" . $order_id); $array_update_order[] = $order_code; }
<!-- left_navigation_eof //--> <?php function getroomofdate($daytest) { //cap nhat so phong dat xuong table status_room $listing_sql2 = "select * from status_room where status_room_dayofyear ='" . $daytest . "'"; $listing_split2 = new splitPageResults($listing_sql2, MAX_DISPLAY_SEARCH_RESULTS); $listing_query2 = tep_db_query($listing_split2->sql_query); $listing2 = tep_db_fetch_array($listing_query2); return $listing2; } ?> <?php require_once "nganluong.php"; $nl = new NL_Checkout(); $transaction_info = @$_GET["transaction_info"]; //lay thong tin giao dich // tep_redirect(tep_href_link("datphong.php?osCsid=" . $transaction_info)); $payment_id = @$_GET["payment_id"]; //ma giao dich $payment_type = @$_GET["payment_type"]; //loai giao dich (1. thanh toan ngay 2. thanh toan tam giu) $order_code = @$_GET["order_code"]; //ma gia dich $price = @$_GET["price"]; //so tien thanh toan voi ngan luong $error_text = @$_GET['error_text']; //lay thong tin chi tiet loi tra ve tu giao dich $secure_code = @$_GET["secure_code"]; //lay ma kiem tra tinh hop le cua dau vao
$price = $_POST["txt_gia"]; //Mã đơn hàng $order_code = $_POST["txt_madonhang"]; //Thông tin giao dịch $transaction_info = "Thanh toan dang ky thanh vien"; $currency = "vnd"; $quantity = 1; $tax = 0; $discount = 0; $fee_cal = 0; $fee_shipping = 0; $order_description = "Ghi chú đơn hàng"; $buyer_info = "Ghi chú người mua hàng"; $affiliate_code = ""; //Khai báo đối tượng của lớp NL_Checkout $nl = new NL_Checkout(); //Tạo link thanh toán đến nganluong.vn $url = $nl->buildCheckoutUrlNew($return_url, $receiver, $transaction_info, $order_code, $price, $currency, $quantity, $tax, $discount, $fee_cal, $fee_shipping, $order_description, $buyer_info, $affiliate_code); if ($order_code != "") { //die($url); echo '<meta http-equiv="refresh" content="0;url=' . $url . '">'; } } ?> <script type="text/javascript"> function check(){ var price = document.Test.txt_gia.value; if (price < 2000) { alert('Số tiền tối thiểu lớn hơn 2000 VNĐ');
* @Createdate Dec 29, 2010 10:42:00 PM */ if (!defined('NV_IS_MOD_SHOPS')) { die('Stop!!!'); } require_once NV_ROOTDIR . "/modules/" . $module_file . "/payment/nganluong.class.php"; $receiver = $payment_config['receiver_pay']; $transaction_info = $nv_Request->get_string('transaction_info', 'get', ''); $order_code = $nv_Request->get_string('order_code', 'get', ""); $price = $nv_Request->get_int('price', 'get', ""); $payment_id = $nv_Request->get_string('payment_id', 'get', "", 1); $payment_type = $nv_Request->get_string('payment_type', 'get', "", 1); $error_text = $nv_Request->get_string('error_text', 'get', "", 1); $secure_code = $nv_Request->get_string('secure_code', 'get', "", 1); ///////////////////////////////////////////////////////////////////////////////// $nl = new NL_Checkout($payment_config['checkout_url'], $payment_config['merchant_site'], $payment_config['secure_pass']); $check = $nl->verifyPaymentUrl($transaction_info, $order_code, $price, $payment_id, $payment_type, $error_text, $secure_code); if ($check) { $transaction_i = $nl->checkOrder($payment_config['public_api_url'], $order_code, $payment_id); if ($transaction_i !== false) { $stmt = $db->prepare("SELECT order_id FROM " . $db_config['prefix'] . "_" . $module_data . "_orders WHERE order_code= :order_code"); $stmt->bindParam(':order_code', $order_code, PDO::PARAM_STR); $stmt->execute(); $order_id = $stmt->fetchColumn(); if ($order_id > 0) { $error_update = false; $payment_data = nv_base64_encode(serialize($transaction_i)); $db->sqlreset()->select('payment_data')->from($db_config['prefix'] . "_" . $module_data . "_transaction")->where("payment='" . $payment . "' AND payment_id= :payment_id")->order('transaction_id DESC')->limit(1); $stmt = $db->prepare($db->sql()); $stmt->bindParam(':payment_id', $payment_id, PDO::PARAM_STR); $stmt->execute();