Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.80 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.0.9.0
  8. * @ Author : DeZender
  9. * @ Release on : 08.08.2019
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function getCurrencyUnit()
  15. {
  16. global $conn;
  17. $lang = $conn->prepare('SELECT site_currency FROM settings WHERE id=:id');
  18. $lang->execute(['id' => 1]);
  19. $langRow = $lang->fetch(PDO::FETCH_ASSOC);
  20. return $langRow['site_currency'] ?? 'TRY';
  21. }
  22.  
  23. function CreateApiKey($data)
  24. {
  25. global $conn;
  26. $data = md5($data['email'] . $data['username'] . rand(9999, 2324332));
  27. $row = $conn->prepare('SELECT * FROM clients WHERE apikey=:key ');
  28. $row->execute(['key' => $data]);
  29.  
  30. if ($row->rowCount()) {
  31. CreateApiKey();
  32. }
  33. else {
  34. return $data;
  35. }
  36. }
  37.  
  38. function createPaymentCode()
  39. {
  40. global $conn;
  41. $row = $conn->prepare('SELECT * FROM payments WHERE payment_method!=:method ORDER BY payment_privatecode DESC LIMIT 1 ');
  42. $row->execute(['method' => 4]);
  43. $row = $row->fetch(PDO::FETCH_ASSOC);
  44. return $row['payment_privatecode'];
  45. }
  46.  
  47. function generate_shopier_form($data)
  48. {
  49. $api_key = $data->apikey;
  50. $secret = $data->apisecret;
  51. $user_registered = date('Y.m.d');
  52. $time_elapsed = time() - strtotime($user_registered);
  53. $buyer_account_age = (int) $time_elapsed / 86400;
  54. $currency = 0;
  55. $dataArray = $data;
  56. $productinfo = $data->item_name;
  57. $producttype = 1;
  58. $productinfo = str_replace('"', '', $productinfo);
  59. $productinfo = str_replace('"', '', $productinfo);
  60. $current_language = 0;
  61. $current_lan = 0;
  62. $modul_version = '1.0.4';
  63. srand(time(NULL));
  64. $random_number = rand(1000000, 9999999);
  65. $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];
  66. $data = $args['random_nr'] . $args['platform_order_id'] . $args['total_order_value'] . $args['currency'];
  67. $signature = hash_hmac('SHA256', $data, $secret, true);
  68. $signature = base64_encode($signature);
  69. $args['signature'] = $signature;
  70. $args_array = [];
  71.  
  72. foreach ($args as $key => $value) {
  73. $args_array[] = '<input type=\'hidden\' name=\'' . $key . '\' value=\'' . $value . '\'/>';
  74. }
  75. if (!empty($dataArray->apikey) && !empty($dataArray->apisecret) && !empty($dataArray->website_index)) {
  76. $_SESSION['data']['payment_shopier'] = true;
  77. 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>';
  78. }
  79. }
  80.  
  81. function username_check($username)
  82. {
  83. if (preg_match('/^[a-z\\d_]{4,32}$/i', $username)) {
  84. $validate = true;
  85. }
  86. else {
  87. $validate = false;
  88. }
  89.  
  90. return $validate;
  91. }
  92.  
  93. function email_check($email)
  94. {
  95. if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
  96. $validate = true;
  97. }
  98. else {
  99. $validate = false;
  100. }
  101.  
  102. return $validate;
  103. }
  104.  
  105. function userdata_check($where, $data)
  106. {
  107. global $conn;
  108. $row = $conn->prepare('SELECT * FROM clients WHERE ' . $where . '=:data ');
  109. $row->execute(['data' => $data]);
  110.  
  111. if ($row->rowCount()) {
  112. $validate = true;
  113. }
  114. else {
  115. $validate = false;
  116. }
  117.  
  118. return $validate;
  119. }
  120.  
  121. function userlogin_check($username, $pass)
  122. {
  123. global $conn;
  124. $row = $conn->prepare('SELECT * FROM clients WHERE username=:username && password=:password ');
  125. $row->execute(['username' => $username, 'password' => md5(sha1(md5($pass)))]);
  126.  
  127. if ($row->rowCount()) {
  128. $validate = true;
  129. }
  130. else {
  131. $validate = false;
  132. ..................................................................................
  133. ...........................................
  134. .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement