如何通过PayPal提交多个产品复选框

How do i Submit Multiple product Checkboxes via Paypal?

本文关键字:复选框 何通过 PayPal 提交      更新时间:2023-09-26

我有PayPal基于View Cart方法的形式。我转换了代码以收集多个复选框信息并通过PayPal提交总和。当我尝试通过单击"立即购买"来处理需求集时,我收到来自PayPal的错误消息,内容为:

您请求了PayPal的过时版本。这个错误经常 使用书签的结果。

这是代码:

<form target="_self" action="https://www.paypal.com/cgi-bin/webscr" method="post" id="submit" name="submit">
<!-- If using a Business or Company Logo Graphic, include the "cpp_header_image" variable in your View Cart code. -->
<input type="hidden" name="cpp_header_image" value="http://coreneto.com/picturish/assets/images/logo_light.png">
<p>
<input type="hidden" name="cmd" value="_submit">
<input type="hidden" name="display" value="1">
<!-- Replace "business" value with your PayPal Email Address or Account ID -->
<input type="hidden" name="business" value="user@gmail.com">
<!-- Replace value with the web page you want the customer to return to -->
<input type="hidden" name="shopping_url" value="http://www.yourwebsite.com/Script_02.html">
</p>
</form>
<!-- End of the viewcart FORM -->
<!-- Start of Form -->
<!-- Note: target="paypal" was replaced with the variable target="_self" -->
<!-- Note: shopping_url also added to code -->
<!-- These two changes allow better functionality with IE and Firefox -->
<FORM onsubmit="this.target='_self';&#10; return ReadForm(this, true);" action=https://www.paypal.com/cgi-bin/webscr method=post>
<!-- If using a Business or Company Logo Graphic, include the "cpp_header_image" variable in your View Cart code. -->
<input type="hidden" name="cpp_header_image" value="http://coreneto.com/picturish/assets/images/logo_light.png">
<input type="hidden" name="cmd" value="_submit">
<input type="hidden" name="add" value="1">
<!-- Replace "business" value with your PayPal Email Address or Account ID -->
<input type="hidden" name="business" value="user@gmail.com">
<input type="hidden" name="item_name" value="">
<input type="hidden" name="amount" value="">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn/btn_cart_LG.gif:NonHosted">
<!-- Replace value with the web page you want the customer to return to -->
<input type="hidden" name="shopping_url" value="http://www.yourwebsite.com/Script_02.html">
<!-- Replace value with the web page you want the customer to return to after a successful transaction -->
<input type="hidden" name="return" value="http://www.yourwebsite.com/ThankYou.html">
<!-- Replace value with the web page you want the customer to return to after item cancellation -->
<input type="hidden" name="cancel_return" value="http://www.yourwebsite.com/Cancel.html">
<input type="hidden" value="0.00" name="baseamt">
<input type="hidden" value="@0.00" name="basedes">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="cn" value="Add some notes">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted">

Add Toppings
<br><br>  
<input onclick="ReadForm (this.form, false);" type=checkbox value="Pepp +1.50"> Pepperoni - Add $1.50
<br><br>
<input onclick="ReadForm (this.form, false);" type=checkbox value="It Saug +1.50"> It Saugsage - Add $1.50
<br><br>
<input onclick="ReadForm (this.form, false);" type=checkbox value="Ons +10.10"> Onions - Add $10.10
<br><br>
<input onclick="ReadForm (this.form, false);" type=checkbox value="Mush +10.25"> Mushrooms - Add $10.25
<br><br>
<input onclick="ReadForm (this.form, false);" type=checkbox value="Gr Peppers +10.15"> Green Peppers - Add $10.15
<br>
<!-- <input class=nbor size=6 value=$0.00 name=tot>  -->
<div class="display-amount">$0.00</div>
<br><br>
<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!">
<input type=image alt="cart add" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif" name=submit>
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
<br><br>
<input onclick="document.forms.viewcart.target = '_self';&#10; document.forms.viewcart.submit ();&#10; return false;" type=image alt="cart view" src="https://www.paypalobjects.com/en_US/i/btn/btn_viewcart_LG.gif">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"> 
</form>

这是现场直播:https://jsfiddle.net/rami7250/cojvcr90/

我做错了什么?

请更改以下代码

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

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

请参阅 https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/,cmd 变量仅支持以下值:_xclick

_车

_oe礼券

_xclick订阅

_xclick自动计费

_xclick付款计划

_捐款

_s-x点击