2012-01-07 57 views
1

小问题,这个老PayPal按钮代码..宝PDT返回变量不发送

我试图让OS0和OS1发送回这个脚本..我得到的数量和名称,但是全部 .. ?

谢谢!

我有一个简单的表格:

<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> 

一旦用户购买了产品,他们自动返回W/PDT启用,我试图找回变量OS0和OS1 - 但没有要回来。

我得到金额和姓名,但不是option_selection1或2?

这是我回报的脚本:(我尝试不同的变量看..但什么?)

$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 
} 

回答

1

嗨你有没有解决这个问题?我刚刚开始为我的网站创建一个pdt,并基于我学到的知识:'option_name1'将从您的窗体中拉出'on0'标签,'option_name2'将拉动'on1'标签等。'option_selection1 '(拉取'os0'文本框中输入的信息)和'option_selection2'。

到目前为止,我只在沙箱环境中尝试过,但我发现https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables很有用。