Paypal PDT 返回变量未发送

发布于 2024-12-25 07:01:07 字数 4067 浏览 0 评论 0原文

这个旧的 paypal 按钮代码有一个小问题。

我正在尝试使用此脚本让 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="[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>

一旦用户购买了产品,他们就会自动返回并启用 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
} 

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
} 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

樱&纷飞 2025-01-01 07:01:07

您好,您解决过这个问题吗?我刚刚开始为我的网站创建一个 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 很有用。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文