自定义 Paypal 表单仅在完成交易后收集一些数据

Posted

技术标签:

【中文标题】自定义 Paypal 表单仅在完成交易后收集一些数据【英文标题】:Custom Paypal form only collecting some data after completed transaction 【发布时间】:2013-06-09 07:35:55 【问题描述】:

我根据从 Paypal KB、*** 和其他支持论坛获得的信息创建了一个自定义表单。然而事情并没有像我计划的那样工作。我猜我在这个过程中遗漏了一些导致我的问题的东西。

我创建了一个自定义捐赠按钮,构建了我在 Paypal 中所需的基础,但没有保存按钮,而是使用 Paypal 生成的代码作为我自定义的基础(代码发布在下面)。重点是收集捐赠类型的信息(下拉菜单)、捐赠人的姓名(文本字段)、捐赠的金额(金额字段)以及使用 on 和 os 的 5 个其他可选文本字段变量。在所有字段的末尾是 Paypal 捐赠按钮。

正确发生的情况:

当有人填写表格然后点击捐赠 ALL 值时,他们在表格中输入的值会正确显示在 PayPal 付款页面上。

交易完成后,捐赠者会收到一封电子邮件,显示他们的交易,并显示他们在捐赠详细信息区域填写的表格中的所有信息。捐助方的一切都很顺利,他们从不知道有问题。

出了什么问题:

但是,在付款完成时接受捐赠的组织出现了问题。当组织收到付款的电子邮件通知时,详细信息中仅显示捐赠表单中的前 3 个值(下拉菜单中的值、第一个文本字段中的值和金额字段)。所有其他相关的贝宝交易信息都在那里,交易很好。但是从自定义表单中收集的所有需要​​的细节都丢失了。如果我登录收到付款的贝宝帐户,我会看到交易,但就像通知电子邮件一样,金额丢失后的所有数据。

总结:

捐赠者的自定义表单似乎可以正常运行,包括从网络表单传递到贝宝付款表单的值,甚至包含在捐赠者收到的捐赠收据电子邮件中。然而,当涉及到组织时,只有前 3 个字段显示在通知电子邮件中和贝宝账户中的交易本身

知道为什么所有值都显示在捐赠者电子邮件通知上,而组织网站上只显示 3 个值吗?我的表单格式(在字段之间添加空格)是否破坏了表单?如果是这样,为什么所有信息都正确显示给捐赠者而不是组织?我在下面包含了表单代码。请指教。非常感谢!

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input type="hidden" name="cmd" value="_donations"> <input type="hidden" name="business" value="paypal@sthecompany.org"> <input type="hidden" name="lc" value="US"> <input type="hidden" name="item_name" value="Honor/Memorial Donation"> <input type="hidden" name="button_subtype" value="services"> <input type="hidden" name="no_note" value="0"> <input type="hidden" name="cn" value="Please add your comments here"> <input type="hidden" name="no_shipping" value="2"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted">
<table>
<tbody>
<tr><td><input type="hidden" name="on0" value="Gift Type">Gift Type</td></tr>
<tr>
<td ><select name="os0">
<option value="Honor">Honor</option>
<option value="Memorial">Memorial</option>
</select></td>
</tr>
<tr>
<td><input type="hidden" name="on1" value="Name">In Honor or Memory of</td>
</tr>
<tr>
<td><input type="text" name="os1" maxlength="200"></td>
</tr>
<tr>
<td><label for="amount">Amount $<br /></label><input id="amount" type="text" name="amount" value=""></td>
</tr>
<tr>
<td><br />If you would like a letter sent to the honoree or next of kin,<br />please fill out the following information otherwise leave blank. <br /><br /> <input type="hidden" name="on2" value="Notification Name">Notification Name</td>
</tr>
<tr>
<td><input type="text" name="os2" maxlength="200"></td>
</tr>
<tr>
<td><br /><input type="hidden" name="on3" value="Notification Address">Notification Address</td>
</tr>
<tr>
<td><textarea name="os3" rows="5" cols="40"></textarea></td>
</tr>
<tr>
<td><br /><input type="hidden" name="on4" value="Notification City">Notification City</td>
</tr>
<tr>
<td><input type="text" name="os4" maxlength="200"></td>
</tr>
<tr>
<td><br /><input type="hidden" name="on5" value="Notification State">Notification State</td>
</tr>
<tr>
<td><input type="text" name="os5" maxlength="200"></td>
</tr>
<tr>
<td><br /><input type="hidden" name="on6" value="Notification Zip">Notification Zip</td>
</tr>
<tr>
<td><input type="text" name="os6" maxlength="200"></td>
</tr>
</tbody>
</table>
<br /> <input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted"> <input type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" ><img src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif"   ></form> 

【问题讨论】:

【参考方案1】:

我没有检查这些自定义值是否通过 IPN 消息发送,但这可能会解决问题。

【讨论】:

【参考方案2】:

我能够产生与您描述的相同的结果。我建议在www.paypal.com/mts 向 PayPal 的商家技术团队开一张票。一旦您打开了票,如果您想提供票号,我会抓住您的票并进一步调查。这可能是一个错误或有意的,我将不得不更深入地研究代码。最初,某些按钮不支持某些附加变量,但我会进一步调查并通过您的票证向您更新这是否是错误或需要提交功能请求的东西。

【讨论】:

以上是关于自定义 Paypal 表单仅在完成交易后收集一些数据的主要内容,如果未能解决你的问题,请参考以下文章

PayPal IPN 自定义表单数据

使用 php 成功完成 paypal 货币交易后提交表单

具有自定义值的 Paypal 结帐表单[关闭]

PayPal 有发货 API 吗?

如何在 PayPal 智能按钮交易中发送自定义数据字段

PHP Paypal IPN:交易未确认