使用 jquery 中的贝宝快速结账 [英] using paypal express checkout from jquery
问题描述
我正在使用 applicationcraft.com(基于 jquery)来制作一个移动网站,该网站的格式适合移动设备.我可以使用包含 HTML 代码的 HTML 小部件.(例如,生成一个立即购买按钮).我需要添加贝宝快递.我正在通过构建选定项目的数组来创建购物车.我现在需要创建一个立即购买按钮,将项目和总数传递给贝宝快递.最简单的解决方案似乎是添加立即购买按钮.我可以在 paypal 网站上制作一些立即购买按钮,但这些按钮似乎已预先填充了金额.那么是否可以创建一个立即购买按钮,其中只包含我的总金额和计算机部件"的描述.
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>
沃比先生
推荐答案
您必须使用高级"代码.
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
然后只需使用 $('#item_name').val(""); 操作输入值;
Then just manipulate input values using $('#item_name').val("");
这篇关于使用 jquery 中的贝宝快速结账的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!