Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.0.9.0
- * @ Author : DeZender
- * @ Release on : 08.08.2019
- * @ Official site : http://DeZender.Net
- *
- */
- function getCurrencyUnit()
- {
- global $conn;
- $lang = $conn->prepare('SELECT site_currency FROM settings WHERE id=:id');
- $lang->execute(['id' => 1]);
- $langRow = $lang->fetch(PDO::FETCH_ASSOC);
- return $langRow['site_currency'] ?? 'TRY';
- }
- function CreateApiKey($data)
- {
- global $conn;
- $data = md5($data['email'] . $data['username'] . rand(9999, 2324332));
- $row = $conn->prepare('SELECT * FROM clients WHERE apikey=:key ');
- $row->execute(['key' => $data]);
- if ($row->rowCount()) {
- CreateApiKey();
- }
- else {
- return $data;
- }
- }
- function createPaymentCode()
- {
- global $conn;
- $row = $conn->prepare('SELECT * FROM payments WHERE payment_method!=:method ORDER BY payment_privatecode DESC LIMIT 1 ');
- $row->execute(['method' => 4]);
- $row = $row->fetch(PDO::FETCH_ASSOC);
- return $row['payment_privatecode'];
- }
- function generate_shopier_form($data)
- {
- $api_key = $data->apikey;
- $secret = $data->apisecret;
- $user_registered = date('Y.m.d');
- $time_elapsed = time() - strtotime($user_registered);
- $buyer_account_age = (int) $time_elapsed / 86400;
- $currency = 0;
- $dataArray = $data;
- $productinfo = $data->item_name;
- $producttype = 1;
- $productinfo = str_replace('"', '', $productinfo);
- $productinfo = str_replace('"', '', $productinfo);
- $current_language = 0;
- $current_lan = 0;
- $modul_version = '1.0.4';
- srand(time(NULL));
- $random_number = rand(1000000, 9999999);
- $args = ['API_key' => $api_key, 'website_index' => $data->website_index, 'platform_order_id' => $data->order_id, 'product_name' => $productinfo, 'product_type' => $producttype, 'buyer_name' => $data->buyer_name, 'buyer_surname' => $data->buyer_surname, 'buyer_email' => $data->buyer_email, 'buyer_account_age' => $buyer_account_age, 'buyer_id_nr' => 0, 'buyer_phone' => $data->buyer_phone, 'billing_address' => $data->billing_address, 'billing_city' => $data->city, 'billing_country' => 'TR', 'billing_postcode' => '', 'shipping_address' => $data->billing_address, 'shipping_city' => $data->city, 'shipping_country' => 'TR', 'shipping_postcode' => '', 'total_order_value' => $data->ucret, 'currency' => $currency, 'platform' => 0, 'is_in_frame' => 1, 'current_language' => $current_lan, 'modul_version' => $modul_version, 'random_nr' => $random_number];
- $data = $args['random_nr'] . $args['platform_order_id'] . $args['total_order_value'] . $args['currency'];
- $signature = hash_hmac('SHA256', $data, $secret, true);
- $signature = base64_encode($signature);
- $args['signature'] = $signature;
- $args_array = [];
- foreach ($args as $key => $value) {
- $args_array[] = '<input type=\'hidden\' name=\'' . $key . '\' value=\'' . $value . '\'/>';
- }
- if (!empty($dataArray->apikey) && !empty($dataArray->apisecret) && !empty($dataArray->website_index)) {
- $_SESSION['data']['payment_shopier'] = true;
- return '<html> <!doctype html><head> <meta charset="UTF-8"> <meta content="True" name="HandheldFriendly"> <meta http-equiv="X-UA-Compatible" content="IE=edge">' . "\n" . ' <meta name="robots" content="noindex, nofollow, noarchive" />' . "\n" . ' <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0" /> <title lang="tr">Güvenli Ödeme Sayfası</title><body><head>' . "\n" . ' <form action="https://www.shopier.com/ShowProduct/api_pay4.php" method="post" id="shopier_payment_form" style="display: none">' . implode('', $args_array) . '<script>setInterval(function(){document.getElementById("shopier_payment_form").submit();},2000)</script></form></body></html>';
- }
- }
- function username_check($username)
- {
- if (preg_match('/^[a-z\\d_]{4,32}$/i', $username)) {
- $validate = true;
- }
- else {
- $validate = false;
- }
- return $validate;
- }
- function email_check($email)
- {
- if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
- $validate = true;
- }
- else {
- $validate = false;
- }
- return $validate;
- }
- function userdata_check($where, $data)
- {
- global $conn;
- $row = $conn->prepare('SELECT * FROM clients WHERE ' . $where . '=:data ');
- $row->execute(['data' => $data]);
- if ($row->rowCount()) {
- $validate = true;
- }
- else {
- $validate = false;
- }
- return $validate;
- }
- function userlogin_check($username, $pass)
- {
- global $conn;
- $row = $conn->prepare('SELECT * FROM clients WHERE username=:username && password=:password ');
- $row->execute(['username' => $username, 'password' => md5(sha1(md5($pass)))]);
- if ($row->rowCount()) {
- $validate = true;
- }
- else {
- $validate = false;
- ..................................................................................
- ...........................................
- .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement