PayPal security with php

Question:

Hi, first of all say that I've spent a lot of time researching and I can't find something that satisfies me.

It turns out that you can not make sure in another way but to use the hateful form that paypal provides us and validate with your ipn but then I find this: See example , I mean, it does not use the form.

  • header location does not work
  • CURL doesn't work for me
  • it is useless to pass it by get
  • file_get_contents does not work

I'd really like someone to give me a hand on this if it's not too much to ask. By the way when I say that it does not work, I do not mean that the function does not work, be careful with that 🙂

Answer:

Try eston,

1.- Generate the form on your website

 function activar(){
  
  var nombre = $("#nombre").val();
  var apellido = $("#apellido").val();
  var correo = $("#correo").val();
  var total = $("#total").val();
  var numerocliente = '001';
  var moneda = 'USD';
  var descuento = '0';
  
  window.location="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=cliente@paypal.com&currency_code="+moneda+"&item_name=nombredelaweb&charset=utf-8&amount="+total+"&discount_amount="+descuento+"&quantity=1&first_name="+nombre+"&last_name="+apellido+"&email="+correo+"&custom="+numerocliente+"";
  
  
 }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>
  <div>
    <input type="text" name="nombre" id="nombre">
    <input type="text" name="apellido" id="apellido">
    <input type="text" name="correo" id="correo">
    <input type="number" name="total" id="total">
    <button type="button" onclick="activar()">ACTIVAR BOTON</button> 
  </div>
</body>
</html>

this in online mode sends you to the paypal form already with the data pre-filled and you can use it to make it a bit dynamic, the possibilities are endless

And with respect to the ipn you can configure that the response of the data is through url, it is in the paypal configuration where it redirects you.

Scroll to Top