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.8.5
- * @ Author : DeZender
- * @ Release on : 25.03.2019
- * @ Official site : http://DeZender.Net
- *
- */
- function redsys_config()
- {
- $images_path = dirname(__FILE__) . '/redsys/img/';
- if (is_dir($images_path)) {
- $images = array_map('htmlspecialchars', scandir($images_path));
- foreach ($images as $image) {
- $filename = pathinfo($image, PATHINFO_FILENAME);
- $extension = pathinfo($image, PATHINFO_EXTENSION);
- if (strtolower($extension) == 'png') {
- $button_images[] = $filename;
- }
- }
- sort($button_images);
- $button_images = implode(',', $button_images);
- }
- $configarray = [
- 'FriendlyName' => ['Type' => 'System', 'Value' => 'Redsys'],
- 'tpv_name' => ['Type' => 'text', 'FriendlyName' => 'Nombre del comercio', 'Size' => '30', 'Description' => ' Mi Comercio'],
- 'codigo_fuc' => ['Type' => 'text', 'FriendlyName' => 'Código del comercio (FUC)', 'Size' => '30', 'Description' => '123456'],
- '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>'],
- 'terminal' => ['Type' => 'text', 'FriendlyName' => 'Num. Terminal', 'Size' => '3', 'Description' => '001', 'Value' => '001'],
- 'tpv_currency' => ['Type' => 'text', 'FriendlyName' => 'Moneda del Terminal', 'Size' => '3', 'Description' => '978=euros, 840=dólares, 826=libras, 392=yenes', 'Value' => '978'],
- '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'],
- '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)'],
- '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)'],
- 'test_url' => ['FriendlyName' => 'Entorno de Pruebas', 'Type' => 'yesno', 'Description' => 'Seleccione la casilla para usar URL de pruebas'],
- '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>'],
- 'is_debug' => ['FriendlyName' => 'Modo depuración', 'Type' => 'yesno', 'Description' => 'Habilitar el registro de depuración (sólo cuando se solicite)'],
- 'button_label' => ['Type' => 'text', 'FriendlyName' => 'Botón de pago', 'Size' => '30', 'Description' => ' Texto que aparecerá en el botón, por defecto: \'Realizar Pago\''],
- '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']
- ];
- return $configarray;
- }
- function redsys_activate()
- {
- }
- function redsys_link($params)
- {
- $invoiceid = $params['invoiceid'];
- $description = $params['description'];
- $amount = $params['amount'];
- $duedate = $params['duedate'];
- $amount = $amount * 100;
- $amount = (string) $amount;
- $return_url = $params['systemurl'] . '/viewinvoice.php?id=' . $invoiceid;
- $return_url = $params['systemurl'] . '/viewinvoice.php?id=' . $invoiceid;
- $callback_url = $params['systemurl'] . '/modules/gateways/callback/redsys.php';
- if (!empty($params['forced_callback'])) {
- $forced_callback = $params['forced_callback'];
- $forced_callback = strtolower($forced_callback);
- $forced_callback = trim($forced_callback);
- $callback_url = $forced_callback;
- }
- $firstname = $params['clientdetails']['firstname'];
- $lastname = $params['clientdetails']['lastname'];
- $email = $params['clientdetails']['email'];
- $address1 = $params['clientdetails']['address1'];
- $address2 = $params['clientdetails']['address2'];
- $city = $params['clientdetails']['city'];
- $state = $params['clientdetails']['state'];
- $postcode = $params['clientdetails']['postcode'];
- $country = $params['clientdetails']['country'];
- $phone = $params['clientdetails']['phone'];
- $companyname = $params['companyname'];
- $systemurl = $params['systemurl'];
- $currency = $params['currency'];
- ...................................................................
- .........................................
- ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement