#9 Por ejemplo este codigo seria para hacer un pago a Caixa Catalunya
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<SCRIPT LANGUAGE="JavaScript" SRC="sha1.js">
</SCRIPT>
<meta name="Microsoft Theme" content="canvas 011">
</head>
<body onload="javascript:calc_Order();" background="cnvbkgnd.jpg" bgcolor="#ffffff" text="#000000" link="#0066cc" vlink="#006666" alink="#996699"><font face="Arial, Arial, Helvetica">
<script>
function normalizar(precio) {
var precio2="";
if (precio=="") {
alert("");
return false;
} else {
precio=precio.replace(",",".");
if (isNaN(precio)) {
alert("Introduzca un importe válido");
document.formul.Ds_Merchant_Amount.focus();
document.formul.Ds_Merchant_Amount.focus();
return false;
} else {
if (precio.indexOf(".") == -1){
precio2 = precio + "00";
} else if (precio.indexOf(".") != -1){
decimales = precio.substring(1+precio.indexOf("."),precio.length);
precio2 = precio.substring(0,precio.indexOf(".")) + (decimales.length < 2 ? (decimales.length==0 ? "00":decimales + "0") : decimales.substring(0,2) );
}
}
}
return precio2;
}
function calc_Order() {
var fecha = new Date()
var anyo
var mes
var dia
var hours
var min
var seg
anyo = fecha.getYear();
mes = fecha.getMonth() + 1;
dia = fecha.getDate();
hours = fecha.getHours();
min = fecha.getMinutes();
seg = fecha.getSeconds();
anyo = anyo % 100;
def = anyo * 10000000000 + mes * 100000000 + dia * 1000000 + hours* 10000 + min * 100 + seg;
document.formul.Ds_Merchant_Order.value=def;
}
function calcular()
{
var precio = normalizar(document.formul.Ds_Merchant_Amount.value);
if (precio!=false) {
var price_converted = new Number(precio);
document.formul.Ds_Merchant_Amount.value=price_converted;
var x = document.formul.Ds_Merchant_Amount.value + document.formul.Ds_Merchant_Order.value + FUC + Moneda + document.formul.DS_Merchant_TransactionType.value + Clave;
document.formul.Ds_Merchant_MerchantSignature.value=hash(x);
document.formul.submit();
} else {
document.formul.Ds_Merchant_Amount.value="";
document.formul.Ds_Merchant_Amount.focus();
}
}
</script>
<SCRIPT LANGUAGE="JavaScript">
var Comercio = 'xxxxxxxxxxx';
var FUC = 'xxxxxxxx';
var Clave = 'xxxxxxxx';
var Moneda = '978';
var Terminal = '1';
var Idioma = '1';
var Importe = '100';
var Pedido = '1234512611';
var zz="";
document.write(' <p align="center"> </p> ');
document.write(' <p align="center"><strong><font color="#FF0000" size="5">SIMULADOR DE PAGO CON TPV VIRTUAL</font></strong></p> ');
document.write(' <p align="center"><strong><font color="#FF0000">CAIXA CATALUNYA</font></p> ');
document.write(' </center></strong></u><strong> ');
document.write(' <p> </p><p> </p><p><br></p><p><font face="comic sans ms" size="2"></p> ');
document.write(' <form name="formul" action="https://sis.sermepa.es/sis/realizarPago" method="POST"> ');
document.write(' <p align="center">CODIGO DE PEDIDO: ');
document.write(' <input type=text name="Ds_Merchant_Order" width=10> ');
document.write(' </p> ');
document.write(' <br> ');
document.write(' <p align="center">IMPORTE DE LA COMPRA: ');
document.write(' <input type=text name="Ds_Merchant_Amount" width=10> ');
document.write(' </p> ');
document.write(' <br> ');
document.write(' <input type="Hidden" name="Ds_Merchant_Currency" value="' + Moneda + '">');
document.write(' <input type="Hidden" name="Ds_Merchant_MerchantCode" value="' + FUC + '"> ');
document.write(' <input type="Hidden" name="Ds_Merchant_MerchantName" value="' + Comercio + '"> ');
document.write(' <input type="Hidden" name="Ds_Merchant_ConsumerLanguage" value="' + Idioma + '"> ');
document.write(' <input type="Hidden" name="Ds_Merchant_Terminal" value="' + Terminal + '"></p> ');
document.write(' <input type="Hidden" name="Ds_Merchant_MerchantSignature" value="' + Clave + '"> ');
document.write(' <input type="Hidden" name="DS_Merchant_TransactionType" value="0"> ');
document.write(' <p><center><a href="#" onclick="javascript:calcular();"><img alt="PAGAR" src="tpvirtual.jpg" border="0" width="74" height="72" align="center" name="tpvvirtual" ></a></center></p> ');
document.write(' </form></font></strong> ');
</SCRIPT>
</font>
</body>
</html>