passing multiple items to Paypal

By using an HTML snippet provided by MB in a previous conversation I can allow a customer to purchase items from my site using a web app that I have written. If customer purchases multiple items using the cart I provide I, how can I use the snippet to obtain number of items of a type purchased and options for each item. I have had a play with the paypal snippet that performs the call to the paypal website, but I dont know how to get detailed information from the web site shopping cart. here is the snippet that makes the call to the Paypal site; https://www.paypal.com/xclick/business=myaddress@mybusiness.com&item_name=$name&item_number=$reference&amount=$value&no_shipping=2&no_note=1&currency_code=USD&custom=$whatever"

I think you may be expecting too much from a very simple feature. Payment standard has never been meant to do several items, no more than a credit card receipt does. Actually, you must think of it as the equivalent of a credit card terminal where you enter the total and run the card.

May I suggest you separate the information from you shopping cart/invoicing system, and the payment part. You can have your shopping cart present the customer with the itemized list on the screen, then offer to pay with Paypal. Afterward, use IPN to let your app know and generate an invoice you send to the customer, or give him a link to follow to download his invoice.

Otherwise, you can use Paypal shopping cart buttons and use the Paypal shopping cart feature, but you will lose the flexibility to create charges of any amount on the fly.

OK, after trolling through the mountain of pages Paypal has, I finally found my answer on this page https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/cart_upload/#id09BLDK0007Q

It details how to use a third party cart (ie; something you may have written in Xojo WE) with Paypal checkout.

[quote=155483:@Chris Benton]OK, after trolling through the mountain of pages Paypal has, I finally found my answer on this page https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/cart_upload/#id09BLDK0007Q

It details how to use a third party cart (ie; something you may have written in Xojo WE) with Paypal checkout.[/quote]

Nice discovery. Indeed it should let you pass several items through the URL variables. You will have to set up an HTML form, though, since these variables do not seem to do anything in the URL method I posted.

A few things do work though, such as passing options (&onX=$whatever). Getting multiple items, prices and descriptions passed from my cart to Paypal still evades me.

You must build a form in HTML to feed that to Paypal. Here is the actual HTML code you must use to have a button to click and lead the user to the charge form :

[code]

cart [/code]

So what your program must do is to generate the HTML code, then you may simply want to ShowURL it so the charge will be displayed in the default browser.

Copy the code I posted in Notepad or any text editor, and save as paypal.html, then double click on it. All it will display is a small button called Paypal. Click on it and you will see the itemized charge page.

[quote=155511:@Michel Bujardet]So what your program must do is to generate the HTML code, then you may simply want to ShowURL it so the charge will be displayed in the default browser.

Copy the code I posted in Notepad or any text editor, and save as paypal.html, then double click on it. All it will display is a small button called Paypal. Click on it and you will see the itemized charge page.[/quote]

Very wierd. All I get when I double click on the saved HTML file is the HTML text contained in the file in both Safari and Chrome. If I try this code in HTML sandbox (www.HTMLsandbox.com) I get the paypal button, but nothing happens if I click the button.

Did you put the extension html on your file ? The code I posted is from a text file called cart.html that just displays the button “Paypal” which when clicked shows the charge.

Make sure the file is in pure Text. You can also try to drag and drop it over the browser.

Also, make sure everything from to is there. If is missing it can do what you describe.

Sure did. Done this before in Windows and it works just fine, so why it is misbehaving in OSX has me stumped.[quote=155719:@Michel Bujardet]Make sure the file is in pure Text. You can also try to drag and drop it over the browser.[/quote]
Nope, same deal.I wonder if its some form of security measure on OSX.

[quote=155726:@Chris Benton]Sure did. Done this before in Windows and it works just fine, so why it is misbehaving in OSX has me stumped.
Nope, same deal.I wonder if its some form of security measure on OSX.[/quote]

Mac here. The html file is sitting on the desktop…

The icon bears “HTML”.

I just tried it on my mac.
Duplicated a text file, renamed as test.html
Opened in textedit, pasted the html above
saved
double click
It opens as a web page in safari, showing a single paypal button, and clicking that takes me to a page with two test items on it.

[quote=155745:@Jeff Tullin]I just tried it on my mac.
Duplicated a text file, renamed as test.html
Opened in textedit, pasted the html above
saved
double click
It opens as a web page in safari, showing a single paypal button, and clicking that takes me to a page with two test items on it.[/quote]

When I first save the file, it displays the Safari logo on the file icon for about a second then it turns into an HTML logo. Very strange stuff indeed. I am using a laptop in hospital at the moment with Lion loaded as the OS. I wonder if this has anything to do with the fail?

Try saving a page as HTML for instance from this forum. I just did, and a double click does open fine on the web page, not the source. Unless there is something weird in your system, that has been the default behavior for all versions of the Mac system for as far as I can remember.

Thanks guys. I really think that there is something not right with this laptop I am using. I will wait until I get out of hospital and back onto my trusty old Mac and then pursue this.

What happens looks more like a browser misconfiguration than anything else. I would try to download Firefox from mozilla.org and drag the file over it.