homepage Welcome to WebmasterWorld Guest from 54.166.10.100
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / WebmasterWorld / Ecommerce
Forum Library, Charter, Moderators: buckworks

Ecommerce Forum

    
PayPal API PHP Integration
apauto




msg:4208513
 3:15 am on Sep 29, 2010 (gmt 0)

Hi guys,

I have a website now where people who want to pay with paypal, click on PayPal, and the form sends over what they are ordering. They enter in their info and then they pay on PayPal. Once they pay, they don't go back to my site.

I had a few questions:

1) How can I get PayPal to redirect them back to my site, so I can show them a "Thank you" page.

2) I have API access, does anyone know of a good "plug and play" PHP code example of PayPal API access (going through their documentation hurts my noob eyes).

I want to run affiliates through my store, so I need a way to get these guys to return to my site after payment so I can call conversion code, and also give out order numbers.

Thanks everyone

 

apauto




msg:4208515
 3:19 am on Sep 29, 2010 (gmt 0)

BTW, I know there is a Return URL. However, I need it to be dynamic, since I use the same paypal account for multiple sites (so I need to change the URL of the return url).

Also, need a way to pass some kind of identifier.

Thanks!

jcaron




msg:4208519
 3:34 am on Sep 29, 2010 (gmt 0)

The following parameters in your form should be of use, then:
- return (guess what it is!)
- cancel_return
- rm which dictates how they return (values 0, 1 or 2 IIRC)
- either "custom" or "invoice" for the identifier to be returned. You can configure Paypal not to accept duplicate payments for the same "invoice" number

There's a PDF somewhere which details all the variables and is a bit less ugly than the HTML documentation.

Note that even if you do everything to have them return to your site, in many cases they won't:
- either because they did not have a Paypal account and it was suggested to them after payment that they should open one
- or because they didn't like the warning if you send them back to a non-secure page (depends on the value of rm)
- or simply because they don't feel like it for some reason

You should thus be prepared to store the payments in your DB, and display the tracking code on a future visit (and then flag the payment as "tracked"), or talk to your affiliate network(s) about batch processing or whatever solution they might have for you.

Of course, you should use IPN to receive notifications of the payments.

Jacques.

ergophobe




msg:4210159
 8:20 pm on Oct 1, 2010 (gmt 0)

Almost every open source shopping cart has a Paypal module. Those would be good starting points. The problem is that they are connecting the PP API with the cart API, which can make it hard to sort out if you don't know the cart API.

Also, try searching on "Paypal PHP class" - lots of options

rocknbil




msg:4211176
 5:53 pm on Oct 4, 2010 (gmt 0)

so I need to change the URL of the return url

You can send this as a parameter in what you post to payPal. Have you found the samples? That's the fastest way to get up to speed.

enigma1




msg:4211534
 10:28 am on Oct 5, 2010 (gmt 0)

Best to setup the return URL at the application so you have flexibility to where you redirect the customer after order placement (different parameters etc).

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Ecommerce
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved