Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paypal in CodeIgniter

After reading documentation on paypals developers website for quite a while, I've come to stack. I'm a bit confused on how the whole API deal works, and I decided to take it simpler, find out if I even need to use anything more complex than buttons. So...

What I Need: Multiple options for digital goods (IE - 2 Posts for $5, 10 posts for $10)

I obviously could use a button to have them pay, but I need to be able to get a response to know which of the 2 (or more in the future) things they bought, so I can modify the database accordingly. Is this possible with something like https://www.x.com/community/ppx/wps

Or am I going to have to use the API? I installed Leon's Barretts' library for paypal in CodeIgniter: http://www.leonbarrett.com/code/paypal/

And I'm just completely unsure where to go from here, ideally I'd like the user to be able to pay with credit card w/o a paypal account, or pay with paypal with a paypal account.

Any thoughts to help me get going? Thanks guys!

like image 607
user652650 Avatar asked Mar 13 '11 23:03

user652650


4 Answers

Actually, I just went through this. One thing you MUST be aware of is that PayPal (PP) is moving their "new clients over to the new "payflowpro" api. I spent a month successfully developing a cart which made use of the older paypalpro nvp api only to find out that since my client was "new" (she had been using PP for years at tradeshows and such) because she wanted to add online purchasing to her web site - she had to use payflowpro!

No where in the documentation did PayPal steer me to the new api. I chose the nvp solution because there was more documentation on it out there. Do yourself a favor and make sure you are developing for the right api!

Here is a link to a class that worked for me Angell EYE PayPal CodeIgniter Library

Best of all, Andrew Angell is really helpful!

like image 156
docMojoman Avatar answered Oct 19 '22 16:10

docMojoman


This should be a good resource to get you started. It covers what is required to do payments through paypal, and has some code examples. You can then apply that information to creating your own library, or using the one you previously installed.

like image 31
akpb Avatar answered Oct 19 '22 15:10

akpb


Here is a built-in paypal library for codeigniter by Ran Aroussi paypal library for codeigniter

like image 2
ianace Avatar answered Oct 19 '22 15:10

ianace


You can also checkout Paypal IPN library - https://github.com/orderly/codeigniter-paypal-ipn

like image 2
Puzo Avatar answered Oct 19 '22 16:10

Puzo