Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.65 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.8.5
  8. * @ Author : DeZender
  9. * @ Release on : 25.03.2019
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function redsys_config()
  15. {
  16. $images_path = dirname(__FILE__) . '/redsys/img/';
  17.  
  18. if (is_dir($images_path)) {
  19. $images = array_map('htmlspecialchars', scandir($images_path));
  20.  
  21. foreach ($images as $image) {
  22. $filename = pathinfo($image, PATHINFO_FILENAME);
  23. $extension = pathinfo($image, PATHINFO_EXTENSION);
  24.  
  25. if (strtolower($extension) == 'png') {
  26. $button_images[] = $filename;
  27. }
  28. }
  29.  
  30. sort($button_images);
  31. $button_images = implode(',', $button_images);
  32. }
  33.  
  34. $configarray = [
  35. 'FriendlyName' => ['Type' => 'System', 'Value' => 'Redsys'],
  36. 'tpv_name' => ['Type' => 'text', 'FriendlyName' => 'Nombre del comercio', 'Size' => '30', 'Description' => ' Mi Comercio'],
  37. 'codigo_fuc' => ['Type' => 'text', 'FriendlyName' => 'Código del comercio (FUC)', 'Size' => '30', 'Description' => '123456'],
  38. 'clave_256' => ['Type' => 'text', 'FriendlyName' => 'Clave SHA256', 'Size' => '40', 'Description' => 'Clave SHA256 extraída de <a href=\'https://canales.redsys.es/\' target=\'_blank\'>Canales</a>'],
  39. 'terminal' => ['Type' => 'text', 'FriendlyName' => 'Num. Terminal', 'Size' => '3', 'Description' => '001', 'Value' => '001'],
  40. 'tpv_currency' => ['Type' => 'text', 'FriendlyName' => 'Moneda del Terminal', 'Size' => '3', 'Description' => '978=euros, 840=dólares, 826=libras, 392=yenes', 'Value' => '978'],
  41. 'tpv_transaction_type' => ['Type' => 'dropdown', 'FriendlyName' => 'Tipo Transacción', 'Options' => '0,1,2,3,4,5,6,7,8,9,O,P,Q,R,S', 'Description' => '0=Autorización', 'Value' => '0'],
  42. 'variable_fee' => ['Type' => 'text', 'FriendlyName' => 'Recargo variable', 'Size' => '3', 'Value' => '0', 'Description' => 'Cantidad variable a sumar a la transacción, expresada en porcentaje sin símbolo (ej: 1.50)'],
  43. 'fixed_fee' => ['Type' => 'text', 'FriendlyName' => 'Recargo fijo', 'Size' => '3', 'Value' => '0', 'Description' => 'Cantidad fija a sumar a la transacción, expresada en euros sin símbolo (ej: 0.35)'],
  44. 'test_url' => ['FriendlyName' => 'Entorno de Pruebas', 'Type' => 'yesno', 'Description' => 'Seleccione la casilla para usar URL de pruebas'],
  45. 'forced_callback' => ['Type' => 'text', 'FriendlyName' => 'Forzar URL Callback', 'Size' => '30', 'Description' => ' Dejar en blanco para usar predeterminado<br /><em>(No usar a menos que sea necesario)</em>'],
  46. 'is_debug' => ['FriendlyName' => 'Modo depuración', 'Type' => 'yesno', 'Description' => 'Habilitar el registro de depuración (sólo cuando se solicite)'],
  47. 'button_label' => ['Type' => 'text', 'FriendlyName' => 'Botón de pago', 'Size' => '30', 'Description' => ' Texto que aparecerá en el botón, por defecto: \'Realizar Pago\''],
  48. 'button_image' => ['Type' => 'dropdown', 'FriendlyName' => 'Imagen de botón', 'Options' => 'ninguno,' . $button_images, 'Description' => ' Imagen para el botón de pago. Seleccione "ninguno" para no usar una imagen']
  49. ];
  50. return $configarray;
  51. }
  52.  
  53. function redsys_activate()
  54. {
  55. }
  56.  
  57. function redsys_link($params)
  58. {
  59. $invoiceid = $params['invoiceid'];
  60. $description = $params['description'];
  61. $amount = $params['amount'];
  62. $duedate = $params['duedate'];
  63. $amount = $amount * 100;
  64. $amount = (string) $amount;
  65. $return_url = $params['systemurl'] . '/viewinvoice.php?id=' . $invoiceid;
  66. $return_url = $params['systemurl'] . '/viewinvoice.php?id=' . $invoiceid;
  67. $callback_url = $params['systemurl'] . '/modules/gateways/callback/redsys.php';
  68.  
  69. if (!empty($params['forced_callback'])) {
  70. $forced_callback = $params['forced_callback'];
  71. $forced_callback = strtolower($forced_callback);
  72. $forced_callback = trim($forced_callback);
  73. $callback_url = $forced_callback;
  74. }
  75.  
  76. $firstname = $params['clientdetails']['firstname'];
  77. $lastname = $params['clientdetails']['lastname'];
  78. $email = $params['clientdetails']['email'];
  79. $address1 = $params['clientdetails']['address1'];
  80. $address2 = $params['clientdetails']['address2'];
  81. $city = $params['clientdetails']['city'];
  82. $state = $params['clientdetails']['state'];
  83. $postcode = $params['clientdetails']['postcode'];
  84. $country = $params['clientdetails']['country'];
  85. $phone = $params['clientdetails']['phone'];
  86. $companyname = $params['companyname'];
  87. $systemurl = $params['systemurl'];
  88. $currency = $params['currency'];
  89. ...................................................................
  90. .........................................
  91. ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement