2012-07-30 76 views
0

我尝试创建一个自动填充的贝宝形式的网上商店:贝宝的HTML表单不工作

<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给我的PayPal帐户所有者(我从未有过一个帐户)。我的问题,我得到这样的提交后: 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 任何想法?

编辑:

测试从开发服务器,本地主机(但我不认为它计数)...

+0

官方的Paypal网站有一个创建HTML表单代码的向导:https://www.paypal.com/pdn-item – xato 2012-07-30 21:58:15

+0

我没有paypal帐户... – inf3rno 2012-07-30 22:29:19

回答

2

变化<input type="hidden" value="_s-xclick" name="cmd"><input type="hidden" value="_xclick" name="cmd"> 而不是<input type="hidden" value="{somehash}" name="hosted_button_id">,使用<input type="hidden" value="{somehash}" name="business">

_s-xclick用于安全和/或所谓的“托管”按钮,其中按钮的详细信息存储在某人的PayPal账户中。
要指定PayPal网站付款标准版(您使用的产品)的资金收件人,您需要使用business参数。

+0

好吧我会试试看。我认为存储的按钮是恒定的金额,并且网店经营的金额和数量有所变化,所以cmd类型真的是错误的... – inf3rno 2012-08-01 05:37:30

+0

我95%的确定,这是不可能的存储按钮ID我称为“{} somehash”。有没有办法不给电子邮件地址? (只是客户ID,或类似的东西?) – inf3rno 2012-08-01 05:50:54

+0

您将需要指定一个接收器;无论是电子邮件地址,还是“安全的PayPal账户ID”。或者,您可以使用BMCreateButton API通过API调用自动创建托管按钮:http://stackoverflow.com/questions/7825694/how-to-send-the-total-amount-to-be-paid-to- paypal/7841854#7841854 – Robert 2012-08-01 16:42:24