Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>KingdomlandVN | Thông Tin Giao Dịch</title>
- <meta name="description" content="Trang chủ server KingdomlandVN ">
- <meta name="author" content="www.kingdomlandvn.com">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
- <link rel="stylesheet" type="text/css" href="custom/custom-bootstrap.css" />
- <link rel="stylesheet" type="text/css" href="custom/font-awesome.css" />
- <link href="css/animate.min.css" rel="stylesheet" media="screen">
- <meta property="og:locale" content="vi_VN" />
- <meta property="og:type" content="website" />
- <meta property="og:title" content="Nạp Thẻ KingdomlandVN" />
- <meta property="og:url" content="http://kingdomlandvn.com/" />
- <meta property="og:site_name" content="KingdomlandVN" />
- <link rel="stylesheet" style="text/css" href ="css/bootstrap.min.css">
- <link href="css/baokim.css" rel="stylesheet">
- </head>
- <body>
- <div style="text-align: center; margin-top: 80px" class="form-bk">
- <h3 class="title">Thông Tin Giao Dịch</h3>
- <?php
- include "../kingdomland/lib/config.php";
- session_start();
- if (constant("ENABLE_TRANSACTION") == false)
- {
- message("Hiện tại trang nạp thẻ không thể truy cập ngay lúc này!");
- header ("Location: ../index.php");
- }
- if (!isset($_SESSION['user_login']))
- {
- header("Location: ../index.php");
- }
- header('Content-Type: text/html; charset=utf-8');
- $seri = isset($_POST['txtseri']) ? $_POST['txtseri'] : '';
- $sopin = isset($_POST['txtpin']) ? $_POST['txtpin'] : '';
- //Loai the cao (VINA, MOBI, VIETEL, VTC, GATE)
- $mang = isset($_POST['chonmang']) ? $_POST['chonmang'] : '';
- $user = get_real_name_authme($connect, $_SESSION['user_id_authme'], $mysql);
- $uuid = get_uuid_from_authme($connect, $_SESSION['user_id_authme'], $mysql);
- $coin_a = get_money_player($connect, $_SESSION['user_id_playerpoint'], $mysql);
- $card_type = 0;
- if ($mang == 92 || $mang == 'MOBI' || $mang == 2) {
- $ten = "Mobiphone";
- $card_type = 2;
- } else if ($mang == 107 || $mang == 'VIETEL' || $mang == 1) {
- $ten = "Viettel";
- $card_type = 1;
- } else if ($mang == 120 || $mang == 'GATE' || $mang == 4) {
- $ten = "Gate";
- $card_type = 4;
- } else if ($mang == 121 || $mang == 'VTC' || $mang == 5) {
- $ten = "VTC";
- $card_type = 5;
- } else if ($mang == 'Vietnamobile' || $mang == 'VNM' || $mang == 10) {
- $ten = "VNmobile";
- $card_type = 10;
- } else {
- $ten = "Vinaphone";
- $card_type = 3;
- }
- // lay thong tin tu vippay - muc thong tin ca nhan - tich hop website
- $merchant_id = 5058; //API_ID lay trong tich hop website sau khi dang nhạp vippay.vn
- $api_user = "650973ff644649f784287a40f1627be6"; //API_USERNAME lay trong tich hop website sau khi dang nhạp vippay.vn
- $api_password = "18ea6e7817e64c468ba357b036176433"; //API_PASSWORD lay trong tich hop website sau khi dang nhạp vippay.vn
- $vippay_api = new Vippay_API();
- $vippay_api->setMerchantId($merchant_id);
- $vippay_api->setApiUser($api_user);
- $vippay_api->setApiPassword($api_password);
- $vippay_api->setPin($sopin);
- $vippay_api->setSeri($seri);
- $vippay_api->setCardType(intval($card_type));
- $vippay_api->setNote($user); // Ghi chu cua ban
- $vippay_api->cardCharging();
- $code = intval($vippay_api->getCode());
- $amount = intval($vippay_api->getInfoCard());
- $error = $vippay_api->getMsg();
- date_default_timezone_set('Asia/Ho_Chi_Minh');
- $time = time();
- //$time = time();
- function prnt($msg)
- {
- echo $msg . "<br>";
- }
- function breakLine()
- {
- echo "<br>";
- }
- $status_transaction = false;
- $xu = "";
- if ($code === 0 && $amount >= 10000) {
- $xu = 0;
- $status_transaction = "<font style='color:seagreen;'>Thành công</font>";
- switch($amount) {
- case 10000: $xu = 10; break;
- case 20000: $xu = 20; break;
- case 30000: $xu = 30; break;
- case 50000: $xu= 50; break;
- case 100000: $xu = 100; break;
- case 200000: $xu = 200; break;
- case 300000: $xu = 300; break;
- case 500000: $xu = 500; break;
- case 1000000: $xu = 1000; break;
- }
- add_money($connect, $mysql, $_SESSION['user_id_playerpoint'], $xu);
- // Xu ly thong tin tai day
- $file = "carddung.log";
- $xuall = intval($coin_a) + intval($xu);
- $fh = fopen($file,'a') or die("cant open file");
- fwrite($fh,"Tai khoan: ".$user.", Loai the: ".$ten.", Menh gia: ".$amount.", Thoi gian: ".$time.", Ma the: {$sopin}, Seri: {$seri}, UUID: {$uuid}, So coin luc nay: {$coin_a}, Xu tong cong: {$xuall}");
- fwrite($fh,"\r\n");
- fclose($fh);
- }
- else{
- $status_transaction = "<font style='color:red;'>Không thành công</font>";
- breakLine();
- echo $error . "<br>";
- $file = "cardsai.log";
- $fh = fopen($file,'a') or die("cant open file");
- fwrite($fh,"Tai khoan: ".$user.", Ma the: ".$sopin.", Seri: ".$seri.", Noi dung loi: ".$error.", Thoi gian: ".$time);
- fwrite($fh,"\r\n");
- fclose($fh);
- }
- prnt("Loại giao dịch: Nạp vào tài khoản");
- prnt("--------------------------------------------------------");
- prnt("Tên tài khoản: $user");
- prnt("UUID: $uuid");
- prnt("Mã thẻ: $sopin");
- prnt("Seri: $seri");
- prnt("Loại thẻ: $ten");
- prnt("Mã giao dịch: ".$result['transaction_id']);
- prnt("Trạng thái giao dịch: ".$status_transaction);
- prnt("Số Coins lúc trước: ". $coin_a);
- if ($code === 0 && $amount >= 10000) {
- $now_a = intval($coin_a)+intval($xu);
- prnt("Hiện tại có: {$now_a}");
- prnt("Mệnh giá: " . $amount);
- }
- prnt("--------------------------------------------------------");
- prnt('<span class="glyphicon glyphicon-info-sign"></span> <span style="color: red; font-weight: bold;"> Nếu bạn bị lỗi không nhận được coins<br> khi nạp vui lòng chụp lại ảnh này và gữi<br>về page server (inbox) để được giải quyết.</span>');
- prnt('<a target="_Blank"; href="https://www.facebook.com/KingdomlandVN/">Trang Page Server</a>');
- breakLine();
- breakLine();
- prnt("<a href='../''>Trở về trang chủ</a> | <a href='../napthe'>Tiếp tục nạp thẻ</a>");
- class Vippay_API
- {
- private $merchant_id;
- private $pin;
- private $seri;
- private $card_type;
- private $api_user;
- private $api_password;
- private $code;
- private $msg;
- private $info_card;
- private $transaction_id;
- private $note;
- /**
- * @return the $merchant_id
- */
- public function getMerchantId()
- {
- return $this->merchant_id;
- }
- /**
- * @return the $pin
- */
- public function getPin()
- {
- return $this->pin;
- }
- /**
- * @return the $seri
- */
- public function getSeri()
- {
- return $this->seri;
- }
- /**
- * @return the $card_type
- */
- public function getCardType()
- {
- return $this->card_type;
- }
- /**
- * @return the $api_user
- */
- public function getApiUser()
- {
- return $this->api_user;
- }
- /**
- * @return the $api_password
- */
- public function getApiPassword()
- {
- return $this->api_password;
- }
- /**
- * @return the $code
- */
- public function getCode()
- {
- return $this->code;
- }
- /**
- * @return the $msg
- */
- public function getMsg()
- {
- return $this->msg;
- }
- /**
- * @return the $info_card
- */
- public function getInfoCard()
- {
- return $this->info_card;
- }
- /**
- * @return the $transaction_id
- */
- public function getTransactionId()
- {
- return $this->transaction_id;
- }
- /**
- * @return the $note
- */
- public function getNote()
- {
- return $this->note;
- }
- /**
- * @param field_type $merchant_id
- */
- public function setMerchantId($merchant_id)
- {
- $this->merchant_id = $merchant_id;
- }
- /**
- * @param field_type $pin
- */
- public function setPin($pin)
- {
- $this->pin = $pin;
- }
- /**
- * @param field_type $seri
- */
- public function setSeri($seri)
- {
- $this->seri = $seri;
- }
- /**
- * @param field_type $card_type
- */
- public function setCardType($card_type)
- {
- $this->card_type = $card_type;
- }
- /**
- * @param field_type $api_user
- */
- public function setApiUser($api_user)
- {
- $this->api_user = $api_user;
- }
- /**
- * @param field_type $api_password
- */
- public function setApiPassword($api_password)
- {
- $this->api_password = $api_password;
- }
- /**
- * @param field_type $code
- */
- public function setCode($code)
- {
- $this->code = $code;
- }
- /**
- * @param field_type $msg
- */
- public function setMsg($msg)
- {
- $this->msg = $msg;
- }
- /**
- * @param field_type $info_card
- */
- public function setInfoCard($info_card)
- {
- $this->info_card = $info_card;
- }
- /**
- * @param field_type $transaction_id
- */
- public function setTransactionId($transaction_id)
- {
- $this->transaction_id = $transaction_id;
- }
- /**
- * @param field_type $note
- */
- public function setNote($note)
- {
- $this->note = $note;
- }
- public function cardCharging()
- {
- $fields = array(
- 'merchant_id' => $this->merchant_id,
- 'pin' => $this->pin,
- 'seri' => $this->seri,
- 'card_type' => $this->card_type,
- 'note' => $this->note
- );
- $ch = curl_init("https://vippay.vn/api/api/card");
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_TIMEOUT, 120);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_USERPWD, $this->api_user . ":" . $this->api_password);
- $result = curl_exec($ch);
- $result = json_decode($result);
- $this->code = $result->code;
- $this->msg = $result->msg;
- $this->info_card = $result->info_card;
- $this->transaction_id = $result->transaction_id;
- }
- }
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement