eberswine
eberswine

Reputation: 1224

Paypal PDT return variable not sending

small problem with this old paypal button code..

I am trying to get the os0 and os1 to POST back with this script.. I am getting the amount and name, but that is all .. ?

Thanks!

I have a Simple form:

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" style="float:left; width:49.9%">

<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_cart_SM.gif" border="0" name="submit" alt="description">
<img alt="description" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="[email protected]">
<input type="hidden" name="item_name" value="Digital Image (Download ONLY)">
<input type="hidden" name="amount" value="6.00">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="cancel_return" value="http://www.website.com/store/sorry.php">
<input type="hidden" name="return" value="http://www.website.com/store/thank_you.php">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="bn" value="PP-ShopCartBF"><!--<br />
Phone Number:<input type="text" name="on1" maxlength="60">-->
<table><tr><td><input type="hidden" name="on0" value="Photo ID"></td>
    <td><input name="os0" type="hidden" value="{name}" size="40" maxlength="200"></td></tr><tr><td>
    <input type="hidden" name="on1" value="Thumbnail preview"></td>
    <td><input name="os1" type="hidden" value="{image_url}/{name}" size="40" maxlength="200"></td></tr></table>
</form>     <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" style="float:left; width:49.9%">

          <input type="hidden" name="cmd" value="_cart">
          <input type="hidden" name="business" value="[email protected]">
          <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_viewcart_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
          <input type="hidden" name="display" value="1">

      </form>

Once the user buys the product, they auto return w/ PDT enabled and I am trying to get back the variables os0 and os1 -- but nothing is coming back.

I get the amount and the first and last name, but not the option_selection1 or 2 ??

Here is my return script: ( I was trying different variables to see.. but nothing ? )

$firstname = $keyarray['first_name'];
$lastname = $keyarray['last_name'];
$option_name1 = $keyarray['option_name1'];
$option_name2 = $keyarray['option_name2'];
$custom = $keyarray['option_selection1'];
$os1 = $keyarray['os1'];
$option_selection2 = $keyarray['os2'];
$on1 = $keyarray['on1'];
$on2 = $keyarray['on2'];
$os1 = $keyarray['os1'];
$os2 = $keyarray['os2'];
$amount = $keyarray['payment_gross'];

echo ("<p><h3>Thank you for your purchase!</h3></p>");

echo ("<b>Payment Details</b><br>\n");
echo ("<ul><li>Name: $firstname $lastname</li>\n");
echo ("<li>Item: $option_name1</li>\n");
echo ("<li>Item Name: $option_name2</li>\n");
echo ("<li>Item Name 2: $option_selection1</li>\n");
echo ("<li>Item Name 2: $option_selection2</li>\n");
echo ("<li>Item: $custom</li>\n");
echo ("<li>Item: $on1</li>\n");
echo ("<li>Item Name: $on2</li>\n");
echo ("<li>Item Name 2: $os1</li>\n");
echo ("<li>Item Name 2: $os2</li>\n");

echo ("<li>Amount: $amount</li></ul>\n");
echo ("");
}
else if (strcmp ($lines[0], "FAIL") == 0) {
// log for manual investigation
} 

Upvotes: 1

Views: 1079

Answers (1)

Kathryn
Kathryn

Reputation: 11

Hi did you ever resolve this issue? I have just begun to create a pdt for my website and based on what I have learnt: 'option_name1' will pull the 'on0' label from your form, 'option_name2' will pull the 'on1' label, etc. same with 'option_selection1' (pulls the information entered in the 'os0' text field box) and 'option_selection2'.

So far I've only tried it in the sandbox environment, but I've found https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables to be useful.

Upvotes: 1

Related Questions