Guest User

Untitled

a guest
Oct 7th, 2020
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.85 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.1.0.1
  8. * @ Author : DeZender
  9. * @ Release on : 29.08.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class Nestpay
  15. {
  16. public function __construct($core)
  17. {
  18. $this->core = $core;
  19. $this->core->title = $this->core->get_option('nestpay_title');
  20. $this->core->description = $this->core->get_option('nestpay_desc');
  21. $this->core->talimatlar = $this->core->get_option('nestpay_talimatlar');
  22. }
  23.  
  24. public function ayarlar($fields)
  25. {
  26. $ayarlar = [
  27. 'nestpay_3d' => ['title' => __('NestPay 3D', 'mrova'), 'type' => 'checkbox', 'label' => __('Nestpay için 3D ödeme aktifleştirilsin mi ?', 'mrova'), 'default' => 'no'],
  28. 'nestpay_title' => ['title' => __('Başlık', 'ds-ccnow'), 'type' => 'text', 'description' => __('', 'ds-ccnow'), 'default' => 'Kredi Kartı'],
  29. 'nestpay_desc' => ['title' => __('Açıklama', 'ds-ccnow'), 'type' => 'textarea', 'description' => __('', 'ds-ccnow'), 'default' => 'Kredi Kartı ile Ödeme'],
  30. 'nestpay_talimatlar' => ['title' => __('Talimatlar', 'ds-ccnow'), 'type' => 'textarea', 'description' => __('', 'woocommerce'), 'default' => '', 'desc_tip' => true],
  31. 'clientid' => ['title' => __('Müşteri NO', 'mrova'), 'type' => 'text', 'description' => __('Müşteri numaranız')],
  32. 'storekey' => ['title' => __('Store KEY', 'mrova'), 'type' => 'text', 'description' => __('Store keyiniz.')],
  33. 'api_username' => ['title' => __('API Kullanıcı Adı', 'mrova'), 'type' => 'text', 'description' => __('API Kullanıcı adı')],
  34. 'api_password' => ['title' => __('API Şifresi', 'mrova'), 'type' => 'text', 'description' => __('API Şifreniz.')],
  35. 'taksit2' => ['title' => __('2 Taksit Komisyon', 'mrova'), 'type' => 'text', 'description' => __('Kapatmak için boş bırakın, komisyon almamak için 0 yazın.', 'mrova'), 'default' => __('1.00', 'mrova')],
  36. 'taksit3' => ['title' => __('3 Taksit Komisyon', 'mrova'), 'type' => 'text', 'description' => __('Kapatmak için boş bırakın, komisyon almamak için 0 yazın.', 'mrova'), 'default' => __('1.00', 'mrova')],
  37. 'taksit4' => ['title' => __('4 Taksit Komisyon', 'mrova'), 'type' => 'text', 'description' => __('Kapatmak için boş bırakın, komisyon almamak için 0 yazın.', 'mrova'), 'default' => __('1.00', 'mrova')],
  38. 'taksit5' => ['title' => __('5 Taksit Komisyon', 'mrova'), 'type' => 'text', 'description' => __('Kapatmak için boş bırakın, komisyon almamak için 0 yazın.', 'mrova'), 'default' => __('1.00', 'mrova')],
  39. 'taksit6' => ['title' => __('6 Taksit Komisyon', 'mrova'), 'type' => 'text', 'description' => __('Kapatmak için boş bırakın, komisyon almamak için 0 yazın.', 'mrova'), 'default' => __('1.00', 'mrova')],
  40. 'taksit7' => ['title' => __('7 Taksit Komisyon', 'mrova'), 'type' => 'text', 'description' => __('Kapatmak için boş bırakın, komisyon almamak için 0 yazın.', 'mrova'), 'default' => __('1.00', 'mrova')],
  41. 'taksit8' => ['title' => __('8 Taksit Komisyon', 'mrova'), 'type' => 'text', 'description' => __('Kapatmak için boş bırakın, komisyon almamak için 0 yazın.', 'mrova'), 'default' => __('1.00', 'mrova')],
  42. 'taksit9' => ['title' => __('9 Taksit Komisyon', 'mrova'), 'type' => 'text', 'description' => __('Kapatmak için boş bırakın, komisyon almamak için 0 yazın.', 'mrova'), 'default' => __('1.00', 'mrova')]
  43. ];
  44. return array_merge($fields, $ayarlar);
  45. }
  46.  
  47. public function hidden_olustur($order)
  48. {
  49. }
  50.  
  51. public function print_form($tema, $temaURL, $order)
  52. {
  53. $this->hidden_olustur($order);
  54. include 'temalar/' . $tema . '/form.php';
  55. }
  56.  
  57. public function SecOdemeYap($order)
  58. {
  59. $son = explode('/', $_POST['son']);
  60. $krediKartiNumarasi = str_replace(' ', '', $_POST['numara']);
  61. $sonKullanmaTarihi = trim($son[1]) . trim($son[0]);
  62. $kartTipi = (substr($krediKartiNumarasi, 0, 1) == '4' ? 1 : 2);
  63. $tutar = number_format($order->order_total, 2, '.', '');
  64. $paraKodu = $this->core->get_option('currency');
  65. $taksit = intval($_POST['taksit']);
  66. $islemNumarasi = uniqid();
  67. $username = $this->core->get_option('api_username');
  68. $password = $this->core->get_option('api_password');
  69. $SuccessURL = $this->core->acturl . '&sa=&Fail=false';
  70. $FailureURL = $this->core->acturl . '&sa=&Fail=true';
  71. $ekVeri = implode('|sa|', ['order' => $order->id, 'karttipi' => $kartTipi, 'numara' => $krediKartiNumarasi, 'sonKullanmaTarihi' => '20' . $sonKullanmaTarihi, 'guvenlik' => $_POST['guvenlik'], 'taksit' => $taksit]);
  72. $clientId = $this->core->get_option('clientid');
  73. $amount = $tutar;
  74. $oid = $order->id;
  75. $okUrl = $SuccessURL;
  76. $failUrl = $FailureURL;
  77. $rnd = microtime();
  78. $storekey = $this->core->get_option('storekey');
  79. $storetype = '3d';
  80. $hashstr = $clientId . $oid . $amount . $okUrl . $failUrl . $rnd . $storekey;
  81. $taksitSayisi = $taksit;
  82. $taksitim = '<input type="hidden" name="staksit" value="' . $taksitSayisi . '"/>';
  83. $hash = base64_encode(pack('H*', sha1($hashstr)));
  84. $this->hidden_form = '<input type="hidden" name="clientid" value="' . $clientId . '">' . "\r\n" . ' ' . "\t\t\t" . $taksitim . "\r\n" . ' <input type="hidden" name="amount" value="' . $amount . '">' . "\r\n" . ' <input type="hidden" name="oid" value="' . $oid . '"> ' . "\r\n" . ' <input type="hidden" name="okUrl" value="' . $okUrl . '">' . "\r\n" . ' <input type="hidden" name="failUrl" value="' . $failUrl . '">' . "\r\n" . ' <input type="hidden" name="rnd" value="' . $rnd . '" >' . "\r\n" . ' <input type="hidden" name="hash" value="' . $hash . '" >' . "\r\n" . ' <input type="hidden" input name="pan" value="' . $krediKartiNumarasi . '">' . "\r\n" . '<input type="hidden" input name="Ecom_Payment_Card_ExpDate_Year" value="' . trim($son[1]) . '" >' . "\r\n" . '<input type="hidden" input name="Ecom_Payment_Card_ExpDate_Month" value="' . trim($son[0]) . '">' . "\r\n" . '<input type="hidden" name="cv2" value="' . $_POST['guvenlik'] . '" />' . "\r\n" . ' ' . "\r\n" . ' <input type="hidden" name="storetype" value="3d" > ' . "\r\n" . ' <input type="hidden" name="lang" value="tr">' . "\r\n" . ' <input type="hidden" name="currency" value="' . $this->core->get_option('currency') . '">';
  85. echo "\r\n\t\t" . '<form name="downloadForm" action="https://sanalpos.sekerbank.com.tr/fim/est3Dgate" method="POST">' . "\r\n\t\t" . $this->hidden_form . "\r\n\t\t" . '<input type="submit" value="Otomatik yönlendirlmezseniz buraya tıklayınız.">' . "\r\n\t\t" . '</form>' . "\r\n\t\t" . '<SCRIPT LANGUAGE="Javascript" >' . "\r\n\t\t" . 'document.downloadForm.submit();' . "\r\n\t\t" . '</SCRIPT>';
  86. return true;
  87. }
  88.  
  89. public function SecStepOdemeYap($order)
  90. {
  91. $hashparams = $_POST['HASHPARAMS'];
  92. $hashparamsval = $_POST['HASHPARAMSVAL'];
  93. $hashparam = $_POST['HASH'];
  94. $storekey = $this->core->get_option('storekey');
  95. $paramsval = '';
  96. $index1 = 0;
  97. $index2 = 0;
  98.  
  99. while ($index1 < strlen($hashparams)) {
  100. $index2 = strpos($hashparams, ':', $index1);
  101. $vl = $_POST[substr($hashparams, $index1, $index2 - $index1)];
  102.  
  103. if ($vl == NULL) {
  104. $vl = '';
  105. }
  106.  
  107. $paramsval = $paramsval . $vl;
  108. $index1 = $index2 + 1;
  109. }
  110.  
  111. $storekey = $this->core->get_option('storekey');
  112. $hashval = $paramsval . $storekey;
  113. $hash = base64_encode(pack('H*', sha1($hashval)));
  114. if (($paramsval != $hashparamsval) || ($hashparam != $hash)) {
  115. echo '<h4>Güvenlik Uyarisi. Sayisal Imza Geçerli Degil</h4>';
  116. }
  117.  
  118. $xid = $_POST['xid'];
  119. $eci = $_POST['eci'];
  120. ...........................................................................
  121. ..............................................
  122. ......................
Add Comment
Please, Sign In to add comment