CodeIgniter Forums
Paypal library - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Paypal library (/showthread.php?tid=27751)



Paypal library - El Forum - 02-19-2010

[eluser]Iwasignited[/eluser]
Hello everyone.
I'd like to ask you a question about Paypal library.
I read the user guide carefully but it seems to be difficult for a newbie like me since it has no examples.
I just want to make a function like 'run a sql query after paying successfully'.
Please show me an example or something like that.
Thanks in advance.


Paypal library - El Forum - 02-19-2010

[eluser]stef25[/eluser]
If you are using Paypal IPN: the way it works is that when someone makes a payment, Paypal will call a URL on your site (that you have to specify first ) and have some parameters in the URL that allow to you identify which payment was paid.

Since you will not be making the payment, that URL just sits and waits until PP calls it. When this happens, you run your query to update your DB


Paypal library - El Forum - 02-19-2010

[eluser]Iwasignited[/eluser]
could you just give me a simple example?
Thanks.


Paypal library - El Forum - 02-19-2010

[eluser]mikelbring[/eluser]
Sorry I do not have a reply to your question but I am asking a question regarding the same topic.

It seems on paypal you can only set one IPN url in your account, what if I own multiple market sites?


Paypal library - El Forum - 02-19-2010

[eluser]bugboy[/eluser]
When creating a button to place on your site you can define a new IPN address in the advance tab. This is done in your Paypal account.

If your buttons are created dynamically then something like this maybe.

<input type="hidden" name="notify_url" value="URL of your store's "notify" page" />


Paypal library - El Forum - 02-20-2010

[eluser]Iwasignited[/eluser]
please post an example from your source code
thx


Paypal library - El Forum - 02-20-2010

[eluser]bugboy[/eluser]
I suggest you read the paypal doc's as that's where I got it from.


Paypal library - El Forum - 02-21-2010

[eluser]Iwasignited[/eluser]
aha, I found the example included in the paypal lib package Smile
but it seems to have some small bugs
Code:
$this->view('paypal/form', $data);
should be
Code:
$this->load->view('paypal/form', $data);

and ..
Code:
$this->view('paypal/cancel');
should be
Code:
$this->load->view('paypal/cancel');

Code:
$this->view('paypal/success', $data);
should be
Code:
$this->load->view('paypal/success', $data);

I stopped receving errors when make these changes.
Please correct me if Im wrong.
Thank you guys so much.