Hi,

Maybe there is some paypal developper experts around to help me ? 🙂

I'm trying to create a form field (for the VAT number of my customers) that have to be send back through my IPN when clicking on the checkout paypal button. (So that I can see that VAT number value in my orders database associated with the purchase)
I was thinking using the "on0" paypal custom variable as the "custom" one is already in use in my code.
I tried with a fixed value of "123456" but it doesnt seems to go though. So I guess something is wrong in my code.
Everyting is working fine and sending back to IPN and database with this code, except that "on0" value.

$pp_checkout_btn .= '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="return is_checked()">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="myaddress@email.com">';

/// 70 lines of code here but all is working fine ///

$pp_checkout_btn .= '<input type="hidden" name="custom" value="' . $product_id_array . '">
<input type="hidden" name="notify_url" value="https://www.mywebsite.com/ipn.php">
<input type="hidden" name="return" value="https://www.mywebsite.com/return.php">

<input type="hidden" name="on0" value="123456">

<input type="hidden" name="cbt" value="Return to The Store">
<input type="hidden" name="cancel_return" value="https://www.mywebsite.com/cancel.php">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="currency_code" value="USD">
<input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online.">

<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>';

    10 days later

    I would suggest checking the paypal docs on IPN notifications but I find the paypal documentation to be quite confusing. It's my feeling that understanding what sort of IPN notifications you can expect is difficult and that IPN-handling scripts I've written tend to be really complicated affairs. I would point out that paypal IPN notifications DO NOT have all the data that you submit to paypal for the initial transaction. The amount of your own data that comes back with any IPN notification is often very limited. You might get a whole bunch of information about items purchased, etc. for some initial purchase, but if the user cancels or gets refunded or their card fails or something, then subsequent IPN notifications might only have invoice or custom and perhaps some transaction ids and maybe parent transaction ids and such but almost nothing else. It's really up to you to store information about the purchase on your system before sending a user off to paypal. In your case, you might want to store some kind of database record on your system and then send the id of this record along in the custom field instead of whatever you are sending now.

    Another possibility is that your $$pp_checkout_btn code could append the value of on0 as a query string var to the notify_url or the return_url. E.g.

    <input type="hidden" name="notify_url" value="https://www.mywebsite.com/ipn.php?on0=123456">
    
      Write a Reply...