Reputation: 305
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'.
My code for the created button is
<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>
MrWarby
Upvotes: 0
Views: 2476
Reputation: 81
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="[email protected]">
<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>
Refer to this for further info: https://www.paypal.com/cgi-bin/webscr?cmd=_pdn_xclick_techview_outside
Then just manipulate input values using $('#item_name').val("");
Upvotes: 2