Jump to content


Photo

Paypal Custom Field "on0"


  • Please log in to reply
9 replies to this topic

#1 Lucas777

Lucas777

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 19 January 2016 - 05:45 PM

Hi,

Maybe there is some paypal developper experts around to help me ? smile.gif

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.mywebsit...om/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.mywebsit...om/cancel.php">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="currency_code" value="USD">
<input type="image" src="https://www.paypalob...uynowCC_LG.gif"border="0" name="submit" alt="PayPal – The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalob.../scr/pixel.gif"width="1" height="1">
</form>';



#2 paypaldev

paypaldev

    Administrator

  • Administrators
  • 29 posts

Posted 19 January 2016 - 08:18 PM

Try:

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

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


Paymetrics.com - Sales Alanytics and Metrics for PayPal.


#3 Lucas777

Lucas777

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 20 January 2016 - 10:47 AM

Try:

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

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

Hi paypaldev. Thanks for your answer.

I tried that but It doesn't seems to be working. I'm wondering if I should create a new column called "VAT" in my Sql orders table, or does paypal generates it automatically ?



#4 paypaldev

paypaldev

    Administrator

  • Administrators
  • 29 posts

Posted 29 January 2016 - 02:27 PM

What part doesn't work?

 

I just tested it and it works fine:

<form action="https://www.paypal.com/cgi-bin/webscr"method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value=“xxx@xxx.com”>
<input type="hidden" name="item_name" value="Test vat new">
<input type="hidden" name="item_number" value="PLDZ-100105">
<input type="hidden" name="amount" value="0.80">
<input type="hidden" name="image_url" value="https://www.payloadz...fileimg/1.png">
<input type="hidden" name="on0" value="VAT">
<input type="hidden" name="os0" value="123456">
<input type="hidden" name="currency_code" value="USD">
</form>


Paymetrics.com - Sales Alanytics and Metrics for PayPal.


#5 Lucas777

Lucas777

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 29 January 2016 - 02:38 PM

What part doesn't work?

 

I just tested it and it works fine:

<form action="https://www.paypal.com/cgi-bin/webscr"method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value=“xxx@xxx.com”>
<input type="hidden" name="item_name" value="Test vat new">
<input type="hidden" name="item_number" value="PLDZ-100105">
<input type="hidden" name="amount" value="0.80">
<input type="hidden" name="image_url" value="https://www.payloadz...fileimg/1.png">
<input type="hidden" name="on0" value="VAT">
<input type="hidden" name="os0" value="123456">
<input type="hidden" name="currency_code" value="USD">
</form>

Hi,

 

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

 

This part doesn't seems to go through the IPN and back to my orders database. All other values does though.



#6 paypaldev

paypaldev

    Administrator

  • Administrators
  • 29 posts

Posted 01 February 2016 - 03:37 PM

It is being passed through to your IPN, just likely as on0_0.

In your IPN page, write out the ENTIRE PayPal response so you can see ALL of the variables they are posting.


Paymetrics.com - Sales Alanytics and Metrics for PayPal.


#7 Lucas777

Lucas777

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 01 February 2016 - 11:32 PM

It is being passed through to your IPN, just likely as on0_0.

In your IPN page, write out the ENTIRE PayPal response so you can see ALL of the variables they are posting.

I'm not so sure to understand sorry.

 

I've done some tests though and the VAT field works with a simple button like this :

 

<form action="https://www.paypal.com/cgi-bin/webscr"method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="ABCDEFG">

 

<table>
<tr><td><input type="hidden" name="on0" value="VAT text field">VAT text field</td></tr><tr><td><input type="text" name="os0" maxlength="200"></td></tr>
</table>

<input type="image" src="https://www.paypalob...uynowCC_LG.gif"border="0" name="submit" alt="PayPal – The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalob.../scr/pixel.gif"width="1" height="1">
</form>

 

 

 

But not with my custom button :

(the VAT field shows up, but doesnt send data through after clicking the Pay Now button)

 

$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="vfxassets@gmail.com">';

 

///A lot of code for the cart in between here////

$pp_checkout_btn .= '<input type="hidden" name="custom" value="' . $product_id_array . '">
    <input type="hidden" name="notify_url" value="https://www.vfxasset...inklokipn.php">
    <input type="hidden" name="return" value="https://www.vfxasset...lokipnret.php">
    

    <input type="hidden" name="cbt" value="Return to The Store">
    <input type="hidden" name="cancel_return" value="https://www.vfxasset...et/cancel.php">
    <input type="hidden" name="lc" value="US">
    <input type="hidden" name="currency_code" value="USD">

 

<table>
<tr><td><input type="hidden" name="on0" value="VAT text field">VAT text field</td></tr><tr><td><input type="text" name="os0" maxlength="200"></td></tr>
</table>

    <input type="image" src="https://www.paypalob...uynowCC_LG.gif"border="0" name="submit" alt="PayPal – The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalob.../scr/pixel.gif"width="1" height="1">
    </form>';

 

 

So it looks like it's coming from my custom button.

Any clues ?
 



#8 paypaldev

paypaldev

    Administrator

  • Administrators
  • 29 posts

Posted 02 February 2016 - 07:24 PM

The on0 and os0 values are tied to a product. They are not cart wide. So you need to pass them as a product option and read them on your IPN page as a product option.

 

It is better to save everything to your local database and simply use custom to reference the record in your database, then use custom on your IPN page to pull that record.


Paymetrics.com - Sales Alanytics and Metrics for PayPal.


#9 Lucas777

Lucas777

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 03 February 2016 - 11:15 AM

The on0 and os0 values are tied to a product. They are not cart wide. So you need to pass them as a product option and read them on your IPN page as a product option.

 

It is better to save everything to your local database and simply use custom to reference the record in your database, then use custom on your IPN page to pull that record.

Thanks, that makes sense actually that it's not working because of the tied to a product feature.

So you suggest I use the custom variable to manage the VAT field isn't ?

How could I do that if the custom is already used for something else ?



#10 paypaldev

paypaldev

    Administrator

  • Administrators
  • 29 posts

Posted 10 February 2016 - 05:32 PM

It is not a pretty hack, but you can delimit your customer value with a comma, then check the custom field in your IPN page for the comma, split the value, and that will give you two values to use.

 

Existing custom value: xyz123

New custom value: xyz123,abc456


Paymetrics.com - Sales Alanytics and Metrics for PayPal.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users