How do you process Carts thru PayPal and ePDQ on PHP?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

How do you process Carts thru PayPal and ePDQ on PHP?

Post by simonmlewis »

We use external web sites for the cart processes. It works well for us, as it takes away the next for us to supply all the accounting information stuff.

But, it would be rather good if we could do it ourselves. I know how to do Carts, specially if done with a database and logins, but once items are in a cart, I see templates such as woocommerce, where you select PayPal for example, and process, and it takes the user to PayPal and it shows the products being bought.

Of they go thru ePDQ or other methods.

I don't understand tho how these methods work. Does each method require a very different style of processing code?
ie. PayPal: how does it pass thru each of the products, if you have not setup product codes for those items. For example, we setup a web site with a WP theme, made up two products randomly, and took them to PayPal and they they are in the PayPal screen.

This clearly isn't done with any form of PayPal created button as I didn't enter paypal to do this - until I reached that page.

How does it do it?

I'm sure if I can work that out, I can do the rest, such as local stock controls, addresses etc.

I've also seen where these payments are taken directly on the web site itself, not going to PayPal to login and pay. Is there a special way that is done?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: How do you process Carts thru PayPal and ePDQ on PHP?

Post by requinix »

Itemized carts are done by passing all the information to PayPal directly. You don't set up anything about items, you just tell them, essentially, an arbitrary number of item descriptions with prices.

Take a look through their API. It's all fairly well documented.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: How do you process Carts thru PayPal and ePDQ on PHP?

Post by simonmlewis »

Where?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: How do you process Carts thru PayPal and ePDQ on PHP?

Post by requinix »

simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: How do you process Carts thru PayPal and ePDQ on PHP?

Post by simonmlewis »

That's a list of search results. Is there not a comprehensile todo list on how to do it?
It cannot be THAT complicated.... Can it?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: How do you process Carts thru PayPal and ePDQ on PHP?

Post by requinix »

I'm sorry, I didn't know you needed a comprehensive list of what you're supposed to do. You should find a place where you can describe the exact details of your application, upload all your source code so somebody can learn it, and tell you exactly what you need to do. You know, everything up to the point where you actually do it.

Perhaps you noticed that the first result was to PayPal's API? Did you consider looking there? Learn the API, which includes examples last I knew, and implement it. You're going to have to, you know, learn here.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: How do you process Carts thru PayPal and ePDQ on PHP?

Post by simonmlewis »

I kinda assumed there was a bible saying what code was needed to make things work, how to collate the data from local variables, store them into a button or session, and pass that over. I thought there might be a place where all this is listed and taught, rather than a scattered amount of pages all over the place.

I know there will be different sources on various preferred ways, but there is surely a bible of "the" way? Or is that the API PayPal i should be looking at?

As I say, it can be done via WP plugins, but I want to do it myself, so I have my own code, and can just plug that into a web site.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: How do you process Carts thru PayPal and ePDQ on PHP?

Post by simonmlewis »

requinix wrote:I'm sorry, I didn't know you needed a comprehensive list of what you're supposed to do. You should find a place where you can describe the exact details of your application, upload all your source code so somebody can learn it, and tell you exactly what you need to do. You know, everything up to the point where you actually do it.

Perhaps you noticed that the first result was to PayPal's API? Did you consider looking there? Learn the API, which includes examples last I knew, and implement it. You're going to have to, you know, learn here.
I've had my API credentials created, and got to https://developer.paypal.com/docs/class ... scheckout/, but I don't know if i am in the right place. I don't see anything here about the files needed, where code goes, how you collate the cart into a form - that sort of stuff.

Maybe in PayPal that's where it starts.....
I'm having an ePDQ account setup for the other purpose of this.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply