0

我在 jqtouch 网站中有一个贝宝按钮,如下所示

  <div id="paypal">
  <div class="toolbar">
  <h5>Pay online</h5>
  <a href="#" class="back">Back</a>
  </div>
        <div class="s-scrollwrapper"  >
              <div>
              <form action="https://www.paypal.com/cgi-bin/webscr"method="post">
              <input type="hidden" name="cmd" value="_xclick">
              <input type="hidden" name="business" value="----@-----------">
              <input type="hidden" name="item_name" value="Test Item">
              <input type="hidden" name="amount" value="1.00">
              <input type="hidden" name="currency_code" value="NZD">
              <input type="hidden" name="button_subtype" value="services">
              <input type="hidden" name="bn"value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
              <input type="image" src="https://www.paypalobjects.com/en_US/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/en_US/i/scr/pixel.gif" width="1"height="1">
              </form>
              </div>
        </div>
 </div>

点击贝宝按钮没有任何作用。Firebuging 看到一个post请求,其结果代码为 ,302后面跟着一个get被取消的请求。如果我将按钮放在 jqtouch 之外的页面上,它似乎没有问题。你会怎么解决这个问题?

Chrome 控制台显示以下内容。在非 jqtouch 中,发起者是(other)

在此处输入图像描述

4

2 回答 2

0

这不是一个有效的 PayPal 按钮。302 将您重定向到登录,因为您没有发布有效的数据集。我建议设置一个沙盒帐户并剪切并粘贴实际的按钮片段。它应该看起来更像这个PayPal 按钮示例

<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="business" value="me@mybusiness.com">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="item_name" value="Teddy Bear">
    <input type="hidden" name="amount" value="12.99">
    <input type="image" src="http://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" 
    border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
于 2012-06-30T11:13:30.703 回答
0

Jqtouch 默认使用 AJAX 提交所有表单。这扰乱了贝宝按钮。将以下内容添加到您的初始化中

 formSelector: false
于 2012-06-30T12:10:51.930 回答