PHP - Problemas al pasar parámetros

 
Vista:

Problemas al pasar parámetros

Publicado por Jordi (1 intervención) el 12/01/2016 14:54:22
Buenas a todos/as,
Tengo un problema en el siguiente código. Resulta que en el momento de hacer el submit, me han comentado que no se recibe ningún valor en el parámetro DS_MERCHANT_TITULAR cuando envio los valores a la página de pago. Por desgracia tengo muy pocos conocimientos de html i php. No sé que puedo estar haciendo mal. Os agradeceré vuestra ayuda.
Muchas gracias.

Un saludo.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
$miObj = new RedsysAPI;
 
// Valores de entrada
$fuc="123456789";
$terminal="01";
$moneda="978";
$trans="0";
$url="";
$urlOKKO="";
$id=time();
//Importe en euros multiplicado por cien
$amount="100";
$descripcio="Carrera de bicicletas";
$titular="";
 
 
// Se Rellenan los campos
$miObj->setParameter("DS_MERCHANT_AMOUNT",$amount);
$miObj->setParameter("DS_MERCHANT_ORDER",strval($id));
$miObj->setParameter("DS_MERCHANT_MERCHANTCODE",$fuc);
$miObj->setParameter("DS_MERCHANT_CURRENCY",$moneda);
$miObj->setParameter("DS_MERCHANT_TRANSACTIONTYPE",$trans);
$miObj->setParameter("DS_MERCHANT_TERMINAL",$terminal);
$miObj->setParameter("DS_MERCHANT_PRODUCTDESCRIPTION",$descripcio);
$miObj->setParameter("DS_MERCHANT_TITULAR",$titular);
$miObj->setParameter("DS_MERCHANT_MERCHANTURL",$url);
$miObj->setParameter("DS_MERCHANT_URLOK",$urlOKKO);
$miObj->setParameter("DS_MERCHANT_URLKO",$urlOKKO);
 
//Datos de configuración
$version="HMAC_SHA256_V1";
$kc = '11111111111111111111111111111';//Clave recuperada de CANALES
// Se generan los parámetros de la petición
$request = "";
$params = $miObj->createMerchantParameters();
$signature = $miObj->createMerchantSignature($kc);
?>
 
 
<html lang="es">
<head>
<TITLE> TPV CARRERA DE BICICLETAS BTT </TITLE>
<body bgcolor=white>
<pre>
<table>
<tr><td>
<h2>TPV VIRTUAL CARRERAS BICICLETAS</h2>
</td></tr><tr><td>
Comerç: <font color=blue>TPV CARRERA DE BICICLETAS BTT</font>
</td></tr><tr><td>
Descripció: <font color=blue>CARRERA PEDALES DE FUEGO</font>
</td></tr><tr><td>
Preu inscripció: <font color=blue> 1€ </font>
 
 
</table>
</pre>
</head>
<form name="frm" action="https://sis.redsys.es/sis/realizarPago" method="POST" target="_blank">
//<div style=" font-family: Courier, serif;"> <div style=" font-size:14px;">Nombre del inscrito: <input type="text" size="30" style="font-family: Courier; font-size: 10pt; name="DS_MERCHANT_TITULAR" value="<?php echo $titular; ?>"/></br>

Nom de l'inscrit: <input type="text" size="30" style="font-family: Courier; font-size: 10pt; name="DS_MERCHANT_TITULAR" value="">
<input type="hidden" name="Ds_SignatureVersion" value="<?php echo $version; ?>"/></br>
<input type="hidden" name="Ds_MerchantParameters" value="<?php echo $params; ?>"/></br>
<input type="hidden" name="Ds_Signature" value="<?php echo $signature; ?>"/></br>

<input type="submit" value="Pagar" style='width:70px; height:25px' >
</form>

</body>
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Miguel Hernandez Liebano

Problemas al pasar parámetros

Publicado por Miguel Hernandez Liebano (15 intervenciones) el 12/01/2016 15:12:19
No se que tratas de hacer, pero los parametros se reciben por dos vias por POST ($_POST['variable']) o por GET ($_GET["variable"]), en tu caso no veo que recojas ninguna variable enviada. Ahora viendo tu codigo, se nota que estas "cableando" los datos es decir ya los estas definiendo cuando haces esto:

1
2
3
4
5
6
7
8
9
10
11
12
// Valores de entrada
$fuc="123456789";
$terminal="01";
$moneda="978";
$trans="0";
$url="";
$urlOKKO="";
$id=time();
//Importe en euros multiplicado por cien
$amount="100";
$descripcio="Carrera de bicicletas";
$titular="";

y como ves titular esta vacio, lo correcto sería:

1
$titular=$_POST['DS_MERCHANT_TITULAR'];
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar