PayPal付款标准自定义HTML表单; PayPal如何知道谁在提交?

时间:2012-05-31 14:47:46

标签: paypal

我正在尝试使用PayPal付款标准来启动此捐赠...

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
  <input type="hidden" name="cmd" value="_donations">
  <input type="text" name="amount"></input>
  <input type="hidden" name="item_name" value="OrganizationXYZ Donation">
  <input type="hidden" name="image_url" value="http://www.OrganizationXYZ.org/images/logo.gif">
  <input type="image" name="submit" border="0"  src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online">  
</form>

这似乎应该根据PayPal的documentation工作,但事实并非如此。相反,我得到了这个错误:

“我们无法处理此交易,因为卖家提供的PayPal电子邮件地址存在问题。请与卖家联系以解决问题。如果此付款是针对易趣物品,您可以联系卖家通过列表页面上的“向卖家提问”链接。当您拥有正确的电子邮件地址时,可以在www.paypal.com上付款。“

此错误没有任何意义,因为您没有提供这些表单中的电子邮件地址。然而在我看来,我的表格需要发布一些类型的身份证明 - 否则PayPal将如何知道哪个帐户正在接受捐赠?除非我使用PayPal帐户设置注册域名,否则也无法做到这一点。

有人有设置此功能的经验吗?

4 个答案:

答案 0 :(得分:8)

是的,正如您所提到的,它需要某种接收者的标识符 您需要添加的是“业务”参数。就这样。

<input type="hidden" name="business" value="your secure merchant account ID / email here">

答案 1 :(得分:5)

您必须拥有商家帐户。

您可以在此处查看教程:
http://kb.worldsecuresystems.com/833/cpsid_83331.html


试试这段代码:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">

    <select name="amount">
    <option value="3.99">6 Months ($3.99)</option>
    <option value="5.99">12 Months ($5.99)</option>

    </select>
    <br>
    <input name="currency_code" type="hidden" value="USD">
    <input name="shipping" type="hidden" value="0.00">
    <input name="tax" type="hidden" value="0.00">
    <input name="return" type="hidden" value="urlOnValidPayment">
    <input name="cancel_return" type="hidden" value="UrlOnCancelPayment">
    <input name="notify_url" type="hidden" value="URLForValidationPayement">
    <input name="cmd" type="hidden" value="_xclick">
    <input name="business" type="hidden" value="your e-mail">
    <input name="item_name" type="hidden" value="name of the object">
    <input name="no_note" type="hidden" value="1">
    <input type="hidden" name="no_shipping" value="1">
    <input name="lc" type="hidden" value="EN">
    <input name="bn" type="hidden" value="PP-BuyNowBF">
    <input name="custom" type="hidden" value="custom data">
    <input type="image" src="https://www.paypalobjects.com/en_US/CH/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
    <img alt="" border="0" src="https://www.paypalobjects.com/fr_FR/i/scr/pixel.gif" width="1" height="1">
    </form>

对我来说这是工作

答案 2 :(得分:1)

¿你自己只是在付款吗?

我必须建议您登录您的PayPal帐户,转到菜单的这一部分:

商家服务 - &gt;主要特点 - &gt;立即购买按钮

然后选择我想你想要捐赠按钮的按钮类型。

然后配置整体按钮设置,我必须建议将按钮保存在paypal服务器中。

最后选择Create Button

这将为您提供正确的HTML代码。这是一个捐赠按钮HTML示例。

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
  <input type="hidden" name="cmd" value="_donations">
  <input type="hidden" name="business" value="YOUR_BUSINESS_ID">
  <input type="hidden" name="lc" value="US">
  <input type="hidden" name="item_name" value="myorgname">
  <input type="hidden" name="item_number" value="donateid">
  <input type="hidden" name="amount" value="20">
  <input type="hidden" name="currency_code" value="USD">
  <input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted">
  <input type="hidden" name="custom_variable1" value="val1">
  <input type="hidden" name="custom_variable2" value="val2">
  <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
  <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

答案 3 :(得分:0)

这是你的问题:

<input type="hidden" name="cmd" value="_donations">

Paypal在“加密支付系统”(WPS - EPS)中对“cmd”的图像值为“_s-xclick” 所以使用它如下:

<input type="hidden" name="cmd" value="_s-xclick">