使用贝宝快递结帐从jQuery [英] using paypal express checkout from jquery
问题描述
我正在使用applicationcraft.com(基于jquery)生成一个格式化为套件移动设备的移动网站. 我可以使用包含HTML代码的HTML小部件. (例如,产生立即购买"按钮). 我需要添加贝宝快递. 我通过构建所选项目的数组来创建购物车. 现在,我需要创建一个立即购买"按钮,该按钮会将商品和总计传递给贝宝快递. 最简单的解决方案似乎是添加立即购买"按钮. 我可以在贝宝网站上生成一些立即购买"按钮,但是这些按钮似乎已经预先填充了金额. 因此,可以创建一个立即购买"按钮,该按钮将包含我的总额和计算机部件"的说明.
I am using applicationcraft.com (based on jquery) to produce a mobile web site formatted to suite mobile device. I can use an HTML widget that contains HTML code. (eg to produce a buy now button). I need to add paypal express. I am creating a shopping cart by building an array of selected items. I now need to create a buy now button that will pass the items and total to paypal express. The simplest solution seems to be adding buy now buttons. I can produce some buy now buttons on the paypal site but these seem to be pre-populated with amounts. So is it possible to create a buy now button that will just have my total amount and a description of 'computer parts'.
我创建的按钮的代码是
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="EBQ3TMYEHZU9S">
<input type="image" src="https://www.paypalobjects.com/en_US/GB/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_GB/i/scr/pixel.gif" width="1" height="1">
</form>
MarWarby
推荐答案
您必须使用高级"代码.
You have to use the "advanced" code.
<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" id="business" value="me@mybusiness.com">
<input type="hidden" name="currency_code" id="currency_code" value="USD">
<input type="hidden" name="item_name" id="item_name" value="Teddy Bear">
<input type="hidden" name="amount" id="amount" value="12.99">
<input type="image" src="http://www.paypalobjects.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>
请参阅此以获取更多信息: https://www.paypal.com /cgi-bin/webscr?cmd = _pdn_xclick_techview_outside
Refer to this for further info: https://www.paypal.com/cgi-bin/webscr?cmd=_pdn_xclick_techview_outside
然后只需使用$('#item_name').val(");
Then just manipulate input values using $('#item_name').val("");
这篇关于使用贝宝快递结帐从jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!