2

I'm going to attempt to integrate paypal with my php and html website and there seems to be loads of documentation out there on this topic, but some of it is confusing.

What I basically want to do, is have a shopping cart which i will make myself, display all the items a user wants to purchase and have just a single paynow button for these items that will send this info to paypal, and allow the user to login and return them to my site once it's done.

i dont need a cart or add to cart button etc just a button to pay for the goods which will hopefully display price and all relevant data about each item on the paypal page.

if anyone knows of any tutorials they could point me in the direction of for this type of thing i would be grateful.

DJ22T
  • 1,628
  • 3
  • 34
  • 66
eoin
  • 113
  • 2
  • 3
  • 20

2 Answers2

11

Here is a very simple example of the buy now button:

<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" value="me@mybusiness.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="Teddy Bear">
<input type="hidden" name="amount" value="12.99">
<input type="image" src="http://www.paypal.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>

You just need to change the business, the amount and the item_name

If you need multiple items add them like this :

<input type="hidden" name="item_name_1" value="Toy">
<input type="hidden" name="amount_1" value="10">

<input type="hidden" name="item_name_2" value="Bike">
<input type="hidden" name="amount_2" value="20">

Straight from the Paypal Docs here

Manse
  • 37,765
  • 10
  • 83
  • 108
1

This page has a pretty good tutorial.

But you might consider encrypting the fields so they don't get manipulated by someone else.

belgther
  • 2,544
  • 17
  • 15
  • i think info on Third-Party Shopping Carts – The Cart Upload Command is what i may have been looking for. – eoin Mar 14 '12 at 15:45