Les dejo el código de la página donde se envía al cliente al TPV del Banco:
comprar_paso_5.php:
Código HTML:
$total = number_format($pedido->ped_importe_total*100,0,"","");
// Compute hash to sign form data
//Ds_Merchant_Amount + Ds_Merchant_Order +Ds_Merchant_MerchantCode+ DS_Merchant_Currency + CLAVE SECRETA
$message = $total
.$num_pedido
._TPV_CODIGO
._TPV_MONEDA
._TPV_TIPO_TRANSACCION
._TPV_URLMERCHANT
._TPV_CLAVE
;
$signature = (sha1($message));
$TPV_idioma = "001"; //ESP
if(_ID_IDIOMA=="ENG") $TPV_idioma = "002";
if(_ID_IDIOMA=="DEU") $TPV_idioma = "005";
$TPV_URL_ok = crearUrl(_ID_IDIOMA,array("comprar_paso_6"),"",array());
$TPV_URL_ko = crearUrl(_ID_IDIOMA,array("comprar_paso_6"),"",array());
$desc_compra = "";
$_SESSION[_PREFIJO_SESSION.'_cesta'] = "";
$cesta->init();
$miObj = new RedsysAPIWs;
include "./apiRedsys.php";
?>
<html><body>
<form name="fCompra" action="<?=_TPV_URL?>" method="post">
<input type="hidden" name="Ds_Merchant_Amount" value='<?=$total?>'>
<input type="hidden" name="Ds_Merchant_Currency" value='<?=_TPV_MONEDA?>'>
<input type="hidden" name="Ds_Merchant_Order" value='<?=$num_pedido?>'>
<input type="hidden" name="Ds_Merchant_MerchantCode" value='<?=_TPV_CODIGO?>'>
<input type="hidden" name="Ds_Merchant_Terminal" value='<?=_TPV_TERMINAL?>'>
<input type="hidden" name="Ds_Merchant_TransactionType" value='<?=_TPV_TIPO_TRANSACCION?>'>
<input type="hidden" name="Ds_Merchant_MerchantURL" value='<?=_TPV_URLMERCHANT?>'>
<input type="hidden" name="Ds_Merchant_MerchantSignature" value='<?=$signature?>'>
<input type="hidden" name="Ds_Merchant_UrlOK" value='<?=$TPV_URL_ok?>'>
<input type="hidden" name="Ds_Merchant_UrlKO" value='<?=$TPV_URL_ko?>'>
<input type="hidden" name="Ds_Merchant_ConsumerLanguage" value='<?=$TPV_idioma?>'>
<input type="hidden" name="Ds_Merchant_ProductDescription" value='<?=htmlentities($desc_compra)?>'>
<input type="hidden" name="Ds_Merchant_Titular" value=''>
<input type="hidden" name="Ds_Merchant_SignatureVersion" value='<?=_TPV_SIGNATUREVERSION?>'>
</form>
<script>document.fCompra.submit()</script>