Last active
June 27, 2021 16:01
-
-
Save joseconti/029ac40446f1f3303c7305c5c10ed2fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'redsys_modify_data_to_send', 'datos_modificados_pasarela_pago_en_redsys' ); // Filtro para «Redsys redirección (por Jose Conti)» | |
add_filter( 'bizum_modify_data_to_send', 'datos_modificados_pasarela_pago_en_redsys' ); // Filtro para «Bizum (por Jose Conti)» | |
function datos_modificados_pasarela_pago_en_redsys( $redsys_data_send ) { | |
$order_total_sign = $redsys_data_send['order_total_sign']; // Precio total | |
$terminal = $redsys_data_send['DSMerchantTerminal']; // Número de terminal | |
$currency = $redsys_data_send['currency']; // Moneda (código internacional numérico) | |
$transaction_id2 = $redsys_data_send['transaction_id2']; // Número de pedido | |
$transaction_type = $redsys_data_send['transaction_type']; // Tipo de transacción (código numérico Redsys) | |
$final_notify_url = $redsys_data_send['final_notify_url']; // URL de notificación de Redsys | |
$returnfromredsys = $redsys_data_send['returnfromredsys']; // Dónde debe volver el usaurio a la tienda desde Redsys | |
$gatewaylanguage = $redsys_data_send['gatewaylanguage']; // Idioma de Redsys | |
$secretsha256 = $redsys_data_send['secretsha256']; // SHA256 | |
$customer = $redsys_data_send['customer']; // FUC | |
$url_ok = $redsys_data_send['url_ok']; // Dirección dónde se enviará al cliente si la transacción en correcta (Thankyou Page) | |
$product_description = $redsys_data_send['product_description']; // Descripción del producto | |
$merchant_name = $redsys_data_send['merchant_name']; // Nombre del comercio | |
if ( $lo_que_sea ) { | |
// Aquí la magia y donde modificaremos los datos | |
} | |
$redsys_data_send['order_total_sign'] = $order_total_sign; | |
$redsys_data_send['DSMerchantTerminal'] = $terminal; | |
$redsys_data_send['currency'] = $currency; | |
$redsys_data_send['transaction_id2'] = $transaction_id2; | |
$redsys_data_send['transaction_type'] = $transaction_type; | |
$redsys_data_send['final_notify_url'] = $final_notify_url; | |
$redsys_data_send['returnfromredsys'] = $returnfromredsys; | |
$redsys_data_send['gatewaylanguage'] = $gatewaylanguage; | |
$redsys_data_send['secretsha256'] = $secretsha256; | |
$redsys_data_send['customer'] = $customer; | |
$redsys_data_send['url_ok'] = $url_ok; | |
$redsys_data_send['product_description'] = $product_description; | |
$redsys_data_send['merchant_name'] = $merchant_name; | |
return $redsys_data_send; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ok, gracias.