Paypal PDT返回变量不发送

时间:2012-01-07 05:44:00

标签: paypal paypal-ipn

这个旧的贝宝按钮代码的小问题..

我正在尝试使用此脚本将os0和os1恢复为POST ..我正在获取金额和名称,但这就是全部..?

谢谢!

我有一个简单的表格:

<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="mm@mm.com">
<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="mm@mm.com">
          <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 个答案:

答案 0 :(得分: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很有用。