Welcome Guest, Not a member yet? Register   Sign In
Paypal library
#1

[eluser]Romyblack[/eluser]
Hi everyone.

I'm working in a project and i needed to handle the payment process but at the internet the documentation and libraries to do this are in most cases complicated.

You gave me a lot to make my job easier so here I made this library for you.

This PayPal library is build entirely for CodeIgniter but you can adapt it to any framework if needed. NOTE: It's documented at the top of the file

Quote:Please feel free to make any modification according to your needs and if you find this library useful, Please share it with people you know that need this Smile.

Quote:Tags: PayPal, CI_PayPal, PayPal Codeigniter, Romyblack

Here's the link : Download PayPal library
Save at \application\libraries\Paypal.php
#2

[eluser]Unknown[/eluser]
Thanks, you saved my a lot of time!
this is very simple and basic liked it
#3

[eluser]Romyblack[/eluser]
[quote author="Memphis" date="1364908421"]Thanks, you saved my a lot of time!
this is very simple and basic liked it [/quote]

Glad it helped you, be free to make any modifications you need. Smile share with friends.
#4

[eluser]quickshiftin[/eluser]
Nice work!
#5

[eluser]Andy Armstrong[/eluser]
Hey Romyblack,

I really like your paypal library, its cool and pretty easier even for a novice like me. I was wondering if you could help me to figure out some questions. I do love your paypal library its just i have some few questions regarding updating my database. If it does not take too much of your time though..

I am using your library for client's project and of course it involves Paypal apparently. I have successfully made a payment through sandbox and I am happy with the result.

Question:

If the payer has successfully made a payment, how would I record it into the database? I know how to use the model and of course I know how to work with the database its just that, If the payer has made the payment how would I know if its successful or not, If the user has made a payment but did not click the return page link from paypal to my website how would I catch all the items he purchased and record it to my database?

Could you look at this code logic

Code:
Class Purchase_item extends CI_Controller{

/*This will trigger to purchase item and go to paypal page*/
public function do_purchase(){

}

/* I want to update my database for the item that the payer had just purchased an item*/
public function success_payment(){
//Codes here to update the database of all the items that the user just purchased including the invoice number
}

/*Cancel payment*/
public function cancel_payment(){

}
}

Could you give an example on how to do it with your state of the art coding techniques?
I am looking forward to hear from you soon :-D

Many many Thanks,
#6

[eluser]w1n78[/eluser]
thanks for the library. been trying to get this to work, but when i do a test run in paypal sandbox, arrays don't display in the $config['return'] page. i noticed the $config['notify_url'] = 'process_payment.php'. what does that file look like?
#7

[eluser]Romyblack[/eluser]
[quote author="Andy Armstrong" date="1375546333"]Hey Romyblack,

I really like your paypal library, its cool and pretty easier even for a novice like me. I was wondering if you could help me to figure out some questions. I do love your paypal library its just i have some few questions regarding updating my database. If it does not take too much of your time though..

I am using your library for client's project and of course it involves Paypal apparently. I have successfully made a payment through sandbox and I am happy with the result.

Question:

If the payer has successfully made a payment, how would I record it into the database? I know how to use the model and of course I know how to work with the database its just that, If the payer has made the payment how would I know if its successful or not, If the user has made a payment but did not click the return page link from paypal to my website how would I catch all the items he purchased and record it to my database?

Could you look at this code logic

Code:
Class Purchase_item extends CI_Controller{

/*This will trigger to purchase item and go to paypal page*/
public function do_purchase(){

}

/* I want to update my database for the item that the payer had just purchased an item*/
public function success_payment(){
//Codes here to update the database of all the items that the user just purchased including the invoice number
}

/*Cancel payment*/
public function cancel_payment(){

}
}

Could you give an example on how to do it with your state of the art coding techniques?
I am looking forward to hear from you soon :-D

Many many Thanks,[/quote]

I'm sorry i came so late to see this message, if it helps you, in the library you have to pass the URL in wich Paypal notifies you when a payment have been made. What i usually do is that i save the purchase into the database with a status [unpaid] and send that ID to Paypal, then when Paypal notifies me that the payment has been done i update the status of the payment as payed or done. Smile Sorry again for the lateness.
#8

[eluser]Unknown[/eluser]
On clicking the download link I'm getting the following error:

Error:

No paste found.

© 2011 Code Tidy
#9

[eluser]Romyblack[/eluser]
[quote author="JQL01" date="1413110641"]On clicking the download link I'm getting the following error:

Error:

No paste found.

© 2011 Code Tidy [/quote]

Ok no problem let me update the link
#10

[eluser]Romyblack[/eluser]
[quote author="JQL01" date="1413110641"]On clicking the download link I'm getting the following error:

Error:

No paste found.

© 2011 Code Tidy [/quote]

Hi again, i uploaded the library to GitHub, and also created a wiki. Please follow this link Paypal Library




Theme © iAndrew 2016 - Forum software by © MyBB