Pass customer info via Paypal IPN -


i have 2 forms (age,interest) customer. after customer filled in 2 forms , click paypal buy button, want pass info through paypal ipn , them. code

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">   <fieldset>     age     <input type="text" name="custom" value="" />     <br />     interest     <input type="text" name="custom" value="" />     <br />     <input type="hidden" name="cmd" value="_xclick" />     <input type="hidden" name="business" value="llm3n8yxznxju" />     <input type="hidden" name="item_name" value="abc" />     <input type="hidden" name="item_number" value="p1" />     <input type="hidden" name="notify_url" value="http://24151198.ngrok.com/paypal_ipn.php" />     <input type="hidden" name="button_subtype" value="services" />     <input type="hidden" name="rm" value="1" />     <input type="hidden" name="bn" value="abcd-buynowbf:btn_paynowcc_lg.gif:nonhostedguest" />     <input style="position:relative; left:-10px; background:#ffffff; border:0;" type="image" src="https://www.paypalobjects.com/en_us/i/btn/btn_buynowcc_lg.gif" name="submit" alt="paypal . safer, easier way pay online." />     <img alt="" style="border:0;" src="https://www.paypalobjects.com/en_us/i/scr/pixel.gif" width="1" height="1" />   </fieldset> </form> 

i use log record ipn message. if use 1 "custom" form, can custom info. if use 2 "custom" forms, last custom info. how can custom forms info? thanks

you can change form fields before submit performed, study proof of concept. concatenate 2 or more separate fields hidden custom field value. second example modifies visible custom field. whichever suits better paypal form handlers.

<!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta http-equiv="x-ua-compatible" content="ie=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <script> function beforesubmit1(sender) {     sender.custom.value = sender.field1.value+"|"+sender.field2.value; } function beforesubmit2(sender) {     var c1 = document.getelementbyid("custom1");     var c2 = document.getelementbyid("custom2");     c1.value = c1.value+"|"+c2.value;     c2.value = ""; } </script> </head> <body>  <form id="frm1" action="http://server.com/doit.php" method="post" onsubmit="beforesubmit1(this)">     <input id="custom" name="custom" type="hidden" value=""/>     <input id="field1" name="field1" type="text" value="value 1"/>     <input id="field2" name="field2" type="text" value="value 2"/>       <input type="submit" name="submit" /> </form>  <form id="frm2" action=http://server.com/doit.php" method="post" onsubmit="beforesubmit2(this)">     <input id="custom1" name="custom" type="text" value="value 1"/>     <input id="custom2" name="custom" type="text" value="value 2"/>      <input type="submit" name="submit" /> </form>  </body> </html> 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -