Selling physical items by PayPal

Hi,

I have a client that would like to sell his book through PayPal.

It will be the same price for all but different postage based on UK | Europe | Rest of World.

Can someone please help explain what steps I should take to set this up on my web site.

Basically so the user selects the item and they get taken through to PayPal.

Many thanks for any pointers.

If when you click the “Submit Payment” or whatever you called it button on your html form you then get taken to the Paypal site and if you can see there the contents of the shopping cart with the correct payment amounts then that is a very good start. From there the shopper has the choice to use their paypal account or their credit card to make the actual payment.

I’m sure I’ve done this. I’d be happy to PM you a link to my test page.

It’s a really basic system we’re doing.
I mean it’s just adding ‘Add to Cart’ buttons to certain WordPress pages.

I remember reading about IPN in the past as this was something we were looking at for another client. Right now, I’m not sure how necessary it is however.

I think right now I’m good to go as I don’t need IPN to change my database.

Can’t thank you enough for your help here Kalon. Very patient and helpful in your replies. Many thanks :slight_smile:

invision2, just in follow up to my earlier statement, PayPal alike with shipping do (somewhere in their API) have a similar feature for calculating sales tax (as it differs wildly between countries - and even states in the USA). So as you’re looking for the variables for hooking up the delivery cost you might be able to get PayPal to factor in the tax variable as well. In regards to where the stuff is located, there should be something in PayPal’s array of help files to point you in the direction. :slight_smile:

That’s ok :slight_smile:

As long as the shopper can see the contents of their cart and the correct total for payment when they are taken to the Paypal site from your site, it should be ok.

I would suggest rtfm (Read The Fine Manual) first, especially if you haven’t integrated Paypal into a website before. The link I posted earlier takes you to their web page where you can download the appropriate pdf manuals.

Then create a Paypal Sandbox account for testing your application. Then start coding up your Paypal integration.

Happy coding :slight_smile:

Hey Kalon,

Many thanks for your detailed reply.

We’re hoping to use WordPress for the entire site so we’ll probably just use PayPal’s shopping cart buttons (‘add to cart’).

Regarding shipping, I calculate it on the client’s website according to the client’s specifications and store it in a session variable as the visitor shops. I then add the value of the shipping session variable as an additional parameter in the html form that sends all the details to Paypal. The shipping cost appears as just another item in the cart called shipping as far as the Paypal and the shopper are concerned.

Can you give me an example of the kind of data stored in the shipping session variable?

Is there any harm in getting PayPal to calculate shipping costs once the client is ‘checking out’ ?

Thanks again

You can get all the documentation (pdf files) you will need to integrate Paypal into your website from the Paypal’s website.

You can use PP’s shopping cart and/or buttons or you can use your own shopping cart (I use my own and it works well)

Basically all you need to do is set up a html form which sends your cart’s contents plus a few other parameters to Paypal for online payment processing.

Regarding shipping, I calculate it on the client’s website according to the client’s specifications and store it in a session variable as the visitor shops. I then add the value of the shipping session variable as an additional parameter in the html form that sends all the details to Paypal. The shipping cost appears as just another item in the cart called shipping as far as the Paypal and the shopper are concerned.

Hey bluedreamer,

Thanks for the reply.

I’m looking at this:
https://merchant.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=merchant/wp_standard

and it says:

Shipping Calculator - Automatically works out shipping costs at checkout based on criteria you specify.”

I’m hoping then that I’ll be able to change postage costs based on this.

the last time I looked Paypal only allows you to set one postage rate.

How I’ve got around this in the past is to make the price input a SELECT field so the user chooses their delivery country/location and sets the price including P and P accordingly.

Not totally foolproof but a quick fix :slight_smile:

The Sandbox is a testing environment to test your integrated online payment system without actually moving funds from any accounts.

If when you click the “Submit Payment” or whatever you called it button on your html form you then get taken to the Paypal site and if you can see there the contents of the shopping cart with the correct payment amounts then that is a very good start. From there the shopper has the choice to use their paypal account or their credit card to make the actual payment. You will need Sandbox to simulate the payment from here on.

One of the features of the Paypal system is IPN (Instant Payment Notification). If you want to use this feature you will need sandbox to test your code. Basically, IPN sends a POST to a script you have on your website after the shopper has completed their online payment. Part of the info sent in the POST is a parameter saying whether the payment was successful or not. Your script looks at the POSTed data and if the payment was completed then your script can do other processing like update your database saying the payment for that order has been completed and you can then arrange to deliver the ordered goods. Although IPN is optional to implement, if you do then you will need Sandbox to test that an IPN POST is sent to your script and that your script code runs correctly.

If you don’t use IPN then you still get the normal email from Paypal saying a payment has been made to your account, but only if the shopper didn’t change their mind and leave after they were taken to the Paypal site.

Hey Kalon,

I may be getting ahead of myself a little. But I’ve added an item to my PayPal account, set up the ‘Add to Cart’ buttons on my test page and it now links straight through to PayPal.

Is this it?

Do I need to create a Sandbox account at all?

Thanks again

Just got word from the client that they won’t bother about shipping as it’s too much hassle. Score! :slight_smile:

Thanks for the information you’ve given. Hopefully useful for future projects.

Thanks again for the replies.

@Alex
Good shout on Sales Tax. This may be something we need to configure.

Thanks for the tip on PayPal Sandbox. I will keep this in mind.

What would you say is the best form of attack for this?

Should I start adding items to my merchant account then add the code to my web pages?
Or just read the integration pdf? :slight_smile:

The session variable I use for shipping costs just stores a number which is the shipping cost for the cart’s contents. The way I calculate shipping depends on the criteria provided by the client.

Not if you are sure it is calculating the shipping cost exactly as you need it to. You can test your Paypal integration with your website by using the Paypal Sandbox.

Really? Aren’t you accounting for sales tax (like VAT)? It may become an issue if his book sells a large volume of copies.

Nope, PayPal are pretty good about accounting those kind of things. If the cost calculation is being done for you, it’s one less job on the table. :slight_smile: