【问题标题】:paypal html form not working贝宝 html 表单不起作用
【发布时间】:2012-07-28 15:18:13
【问题描述】:

我尝试为网上商店创建一个自动填写的贝宝表单:

<form action="https://www.paypal.com/cgi-bin/webscr" class="input-form" method="post" enctype="application/x-www-form-urlencoded; charset=utf-8">
    <input type="hidden" value="utf-8" name="charset">
    <input type="hidden" value="_s-xclick" name="cmd">
    <input type="hidden" value="{somehash}" name="hosted_button_id">
    <input type="hidden" value="17" name="item_number">
    <input type="hidden" value="kosár és szállítás" name="item_name">
    <input type="hidden" value="9990" name="amount">
    <input type="hidden" value="HUF" name="currency_code">
    <input type="hidden" value="1" name="upload">
    <input type="hidden" value="1" name="no_shipping">
    <input type="hidden" value="http://www.mydomain.loc/" name="return">
    <input type="image" border="0" alt="PayPal - The safer, easier way to pay online!" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif" class="button submit-button image-button">
    <img width="1" height="1" border="0" alt="" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif">
</form>

{somehash} 给了我贝宝帐户所有者(我从来没有帐户)。我的问题,提交后我得到这样的东西: screenshot 它只包含项目名称...

<div id="miniCartContent" class="body clearfix" style="height: 1083px;">
    <div class="" id="miniCart">
    <h3>Your order summary</h3>
    <div class="small head wrap">
        Descriptions
        <span class="amount">Amount</span>
    </div>
    <ol class="small wrap items ">
        <li class="seller1">
            <ul>
            <li class="itmdet" id="multiitem1">
                <ul class="item1">
                    <li class="dark">
                        <span class="name">
                            <a id="showname0" title="" href="#name0" class="autoTooltip">
                                kosár és szállítás
                                <span class="accessAid">kosár és szállítás</span>
                            </a>
                        </span>
                        <span class="secondary noamt amount">0</span>
                    </li>
                    <li class="secondary qty">
                        <p class="group">
                            <label for="item_price"><span class="labelText">Item price: </span></label>
                            <span class="field">
                                <input type="text" value="" name="amount" id="item_price" size="6" maxlength="15">
                            </span>
                        </p>
                    </li>
                    <li class="secondary">
                        Quantity: 1
                    </li>
                    <li>
                        <div class="action">
                            <span class="buttonAsLink">
                                <input type="submit" onclick="PAYPAL.Checkout.Slider.showPanelMsg('cartMsg')" class="action updateSubmit" name="update.x" id="updateTotals0" value="Update">
                            </span>
                        </div>
                    </li>
                </ul>
                <ul></ul>
            </li>
        </ul>
    </li>
</ol>
<div class="wrap items totals item1">
    <ul>
        <li class="small heavy">
            Item total <span class="amount">0</span>
        </li>
    </ul>
</div>

我不知道该怎么做,我阅读了十几个教程,但没有成功:S 有什么想法吗?

编辑:

从开发服务器、本地主机进行测试(但我认为这不算数)...

【问题讨论】:

  • 官方paypal网站有一个创建HTML表单代码的向导:paypal.com/pdn-item
  • 我没有贝宝账户...

标签: html forms paypal


【解决方案1】:

&lt;input type="hidden" value="_s-xclick" name="cmd"&gt; 更改为&lt;input type="hidden" value="_xclick" name="cmd"&gt; 而不是&lt;input type="hidden" value="{somehash}" name="hosted_button_id"&gt;,使用&lt;input type="hidden" value="{somehash}" name="business"&gt;

_s-xclick 用于安全和/或所谓的“托管”按钮,其中按钮的详细信息存储在某人的 PayPal 帐户中。
要使用 PayPal Website Payments Standard(您正在使用的产品)指定收款人,您需要使用 business 参数。

【讨论】:

  • 好的,我试试。我认为存储的按钮是用于恒定数量的,而网上商店是通过改变数量和数量来操作的,所以 cmd 类型真的是错误的......
  • 我有 95% 的把握,我称之为“{somehash}”的存储按钮 ID 是不可能的。有没有办法不提供电子邮件地址? (只是客户 ID,或类似的东西???)
  • 你需要指定一个接收者;无论是电子邮件地址,还是“安全的 PayPal 帐户 ID”。或者,您可以使用 BMCreateButton API 通过 API 调用自动创建托管按钮:stackoverflow.com/questions/7825694/…
猜你喜欢
  • 2015-12-12
  • 2023-03-15
  • 2012-07-15
  • 2021-07-18
  • 2013-09-28
  • 2013-08-10
  • 2016-01-13
  • 2012-02-09
  • 2017-08-21
相关资源
最近更新 更多