PayPal security with php

6

Good, first of all say that I spend a lot of time researching and I can not find something that satisfies me.

It turns out that you can not make sure otherwise using the odd form that gives us paypal and validate with your ipn but then I find this: See example , you do not use the form.

  • header location does not work
  • CURL does not work for me
  • it's no use passing it through get
  • the file_get_contents does not work

I would like someone to really help out 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, ojito with that :)

    
asked by Iranh Canul May 24.02.2017 в 23:48
source

1 answer

0

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 pre-filled data and you can use it to be a bit dynamic, the possibilities are endless

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

    
answered by 28.02.2018 в 21:07