<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="vi" xml:lang="vi">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title> Kết quả trả về thành công </title>
</head>
<body>	
<?php 
include 'NL_Checkoutv3.php';
$nlcheckout = new NL_CheckOutV3('45525', '2daa09faf06829a2d97bcde3b8ee2003', '*****@*****.**', 'https://www.nganluong.vn/checkout.api.nganluong.post.php');
$nl_result = $nlcheckout->GetTransactionDetail($_GET['token']);
if ($nl_result) {
    $nl_errorcode = (string) $nl_result->error_code;
    $nl_transaction_status = (string) $nl_result->transaction_status;
    if ($nl_errorcode == '00') {
        if ($nl_transaction_status == '00') {
            //trạng thái thanh toán thành công
            echo "<pre>";
            print_r($nl_result);
            echo "</pre>";
            echo "Cập nhật trạng thái thành công";
        }
    } else {
        echo $nlcheckout->GetErrorMessage($nl_errorcode);
    }
}
?>
</body>	
</html>		
<!-- http://localhost/Codeigniter-Project/home/pay_thank?order_code=ACEMVDWA_1457968979&error_code=00&token=1010012-641c9dcf6127f9bc63f5c661ab0e68fa -->
示例#2
0
			<h1>Thanh toán thất bại.</h1>
			<p style="line-height:22px; margin:10px 0"><strong>Kính gởi quý khách,</strong></p>
			<p style="line-height:22px; margin:10px 0">Cảm ơn quý khách đã quan tâm đến các khoá học thanh toán qua mạng của Stevbros.</p>
			<p style="line-height:22px; margin:10px 0">Chúng tôi rất tiếc thông báo giao dịch của quý khách không thành công tại thời điểm này.</p>
			<p style="line-height:22px; margin:10px 0">Nếu quý khách cần hổ trợ, vui lòng email về <a href="mailto:support@stevbros.com">support@stevbros.com</a>. Chúng tôi rất vui lòng được phục vụ quý khách.</p>
			<p style="line-height:22px; margin:10px 0">Trân trọng,<br />Stevbros Training & Consultancy.</p>
		</div></div>';
    }
    /*end 123Pay*/
} else {
    /*Ngan luong*/
    include 'nganluong/config.php';
    include 'nganluong/include/NL_Checkoutv3.php';
    $error_code = explode('?error_code=', $url_token[0]);
    $error_code = $error_code[1];
    $nlcheckout = new NL_CheckOutV3(MERCHANT_ID, MERCHANT_PASS, RECEIVER);
    $nl_result = $nlcheckout->GetTransactionDetail($token);
    if ($nl_result) {
        $nl_errorcode = (string) $nl_result->error_code;
        $nl_transaction_status = (string) $nl_result->transaction_status;
        if ($nl_errorcode == '00') {
            $qr = $tc->view_thanhtoan_trave($mTransactionID);
            $row = mysql_fetch_array($qr);
            $navigator = $tc->navigator($row_menu_one['url'], $row_menu_one['name'], $row_menu_one['title'], 'h3');
            $view_post .= '<div id="left"><div id="view_post">
				<h1>Thanh toán thành công</h1>
				<p style="line-height:22px; margin:10px 0">Kính gởi bạn <strong>' . $row['name'] . '</strong></p>
				<p style="line-height:22px; margin:10px 0"><strong>Công ty đào tạo và tư vấn Stevbros</strong> – uỷ quyền đào tạo của <strong>Viện Quản Lý Dự Án Hoa Kỳ (PMI)</strong> mã số 3807 – kính chào bạn. Cảm ơn bạn đã quan tâm đến các khoá học của Stevbros.</p>
				<p style="line-height:22px; margin:10px 0">Stevbros xin thông báo bạn đã đăng ký khoá học thành công và Stevbros đã nhận được học phí của khoá học bạn đăng ký. Thông tin chi tiết như sau:</p>
				<p style="margin-left:30px">
					ID đơn hàng: <strong>' . $mTransactionID . '</strong><br />
示例#3
0
<?php

/*ngan luong*/
if (@$_POST['nlpayment']) {
    include 'nganluong/config.php';
    include 'nganluong/include/NL_Checkoutv3.php';
    $nlcheckout = new NL_CheckOutV3(MERCHANT_ID, MERCHANT_PASS, RECEIVER);
    $array_items[0] = array('item_name1' => $row_detail['name'], 'item_quantity1' => 1, 'item_amount1' => $row_detail['price'], 'item_url1' => 'http://nganluong.vn/');
    $payment_method = 'VISA';
    $bank_code = $_POST['bankcode'];
    $order_code = 'stevbros' . rand(1000000000, 9999999999);
    $total_amount = $row_detail['price'];
    $payment_type = '';
    $discount_amount = 0;
    $order_description = '';
    $tax_amount = 0;
    $fee_shipping = 0;
    $return_url = "http://{$domain}/payment-info/{$order_code}/";
    $cancel_url = urlencode("http://{$domain}/payment-error/");
    $buyer_fullname = $_POST['buyer_fullname'];
    $buyer_email = $_POST['buyer_email'];
    $buyer_mobile = $_POST['buyer_mobile'];
    $buyer_address = '';
    if ($payment_method != '' && $buyer_email != "" && $buyer_mobile != "" && $buyer_fullname != "" && filter_var($buyer_email, FILTER_VALIDATE_EMAIL)) {
        /*insert database*/
        $expire_date = time() + 60 * 1 * 1 * 1;
        setcookie('error_thanhtoan', $result[1], $expire_date, "/", "");
        $tc->insert_khachhang($order_code, $buyer_fullname, $_POST['country'], 'U', $buyer_email, $buyer_mobile, $_SERVER['REMOTE_ADDR'], '', '00', 'TTQT', $row_detail['id']);
        if ($payment_method == "VISA") {
            $nl_result = $nlcheckout->VisaCheckout($order_code, $total_amount, $payment_type, $order_description, $tax_amount, $fee_shipping, $discount_amount, $return_url, $cancel_url, $buyer_fullname, $buyer_email, $buyer_mobile, $buyer_address, $array_items);
        } elseif ($payment_method == "NL") {
示例#4
0
 /**
  * [success description]
  * @return [type] [description]
  */
 public function success()
 {
     log_message('gash', 'Nganluong $_GET: ' . json_encode($_GET));
     $token = $this->input->get('token');
     if (empty($token)) {
         log_message('gash', 'NganLuong: not receive token');
         return;
     }
     $order_info = $this->pay_model->get_order_by_tradeseq($token);
     if (empty($order_info)) {
         $msg = $this->recharge_lang['ask_to_contact'];
         $this->CI->payorder->over($msg);
         log_message('gash', 'Nganluong: no token exists. Token: ' . $order_info->tradeseq);
     } else {
         $msg = $this->recharge_lang['ask_to_contact'];
         //初始设置msg为失败
         $merchant_info = $this->pay_model->get_merchant_data_by_id($order_info->merchant_id);
         $this->merchant_id = $merchant_info[0]->merchant_name;
         $this->merchant_pass = $merchant_info[0]->merchant_key;
         $this->receiver = $merchant_info[0]->merchant_key2;
         $nlcheckout = new NL_CheckOutV3($this->merchant_id, $this->merchant_pass, $this->receiver);
         $nl_result = $nlcheckout->GetTransactionDetail($token);
         log_message('gash', 'Nganluong result: ' . json_encode($nl_result));
         if ($nl_result) {
             $nl_errorcode = (string) $nl_result->error_code;
             $nl_transaction_status = (string) $nl_result->transaction_status;
             if ($nl_errorcode == '00') {
                 if ($nl_transaction_status == '00' || $nl_transaction_status == '04') {
                     //transaction success
                     $ret = $this->payorder->update_order_to_get_payment(array('order_sn' => $order_info->order_sn));
                     if ($ret !== true) {
                         log_message('GASH', 'Nganluong: update order to get payment false!');
                     }
                     // offer yuanbao
                     if ($order_info->offer_yuanbao == 1) {
                         log_message('GASH', 'Nganluong error : before offer service, order_status offer_yuanbao is already 1!');
                         return;
                     }
                     $offer_ret = $this->offer_service($order_info->order_sn, $order_info->game_id);
                     // $offer_ret['status']=1;
                     if (!$offer_ret['status']) {
                         log_message('gash', 'Nganluong error: offer yuanbao failed.');
                     } else {
                         $ret = $this->payorder->update_order_to_offer_service(array('order_sn' => $order_info->order_sn));
                         $msg = $this->recharge_lang['recharge_success'];
                         //设置msg为充值成功
                         $order_info = $this->pay_model->get_order_by_tradeseq($token);
                         $this->CI->payorder->over($msg, $order_info->order_sn);
                     }
                     $this->CI->payorder->over($msg);
                 }
             } else {
                 log_message('gash', 'Nganluong error_code:' . json_encode($nlcheckout->GetErrorMessage($nl_errorcode)));
             }
         }
         $this->CI->payorder->over($msg);
     }
 }