![]() |
Paypal_Lib + Monthly Subscription - 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_Lib + Monthly Subscription (/showthread.php?tid=32413) Pages:
1
2
|
Paypal_Lib + Monthly Subscription - El Forum - 07-22-2010 [eluser]bondjp[/eluser] Hi, i've managed to get the library to work with my app when a user wants to buy some credits. What i'm not getting is how i setup the library to accept monthly payments. I know that for monthly payments we have to use Code: $this->add_field('cmd','_xclick-subscriptions'); Code: $this->add_field('cmd','_xclick'); How do i do it? Thanks. Paypal_Lib + Monthly Subscription - El Forum - 07-22-2010 [eluser]pickupman[/eluser] I just recently did something similar on a project. I added to the Paypal_lib a add_subscription() method to handle the extra fields like recurring period and such. Code: /** I still use add_field for business_name. I created a class property for paypal command. Then I can pass _xclick or subscription for the form type. Paypal_Lib + Monthly Subscription - El Forum - 07-22-2010 [eluser]bondjp[/eluser] Thanks for posting. I'm a newbie so i'm finding a bit hard to merge this. Ok i can take this code and insert it in Paypal_Lib. How can i then make my controller to work? Here's where i will handle the monthly subscriptios: Controller Code: ........ Paypal_Lib + Monthly Subscription - El Forum - 07-22-2010 [eluser]pickupman[/eluser] You are on the right track. I think I may have added an initialize method as well, so I could pass an array to configure it. I also created a clear() method to reset the form fields. I was having multiple forms for subscriptions. I have in a controller: Code: //Setup subscription button Paypal_Lib + Monthly Subscription - El Forum - 07-22-2010 [eluser]bondjp[/eluser] Ok, just tried and i'm getting this error: Fatal error: Call to undefined method Paypal_Lib::initialize() in /home/availabl/public_html/app/controllers/membership.php on line 109 in this line Code: $this->paypal_lib->initialize($config); //set paypal cmd for subscriptions Paypal_Lib + Monthly Subscription - El Forum - 07-22-2010 [eluser]pickupman[/eluser] Yeah, I mentioned I added that. Code: /** You will have to create the class property paypal cmd Code: class Paypal_lib{ Paypal_Lib + Monthly Subscription - El Forum - 07-22-2010 [eluser]bondjp[/eluser] Ok, did some more digging and found that i get this error: Fatal error: Call to undefined method Paypal_Lib::initialize() in /home/availabl/public_html/app/controllers/membership.php on line 109 [ Code: $this->paypal_lib->initialize($config); //set paypal cmd for subscriptions Only on my live site, my localhost does the processing ok and i can get the order complete in sandbox. Can someone tell me why it's giving me this error only on my live site? Thanks. Paypal_Lib + Monthly Subscription - El Forum - 07-22-2010 [eluser]pickupman[/eluser] It's the casing of the class/filename. Windows doesn't care, but need to make sure the class is named Paypal_lib (lowercase "l" in lib), and make sure filename is the same way. Paypal_Lib + Monthly Subscription - El Forum - 07-22-2010 [eluser]bondjp[/eluser] [quote author="pickupman" date="1279843805"]It's the casing of the class/filename. Windows doesn't care, but need to make sure the class is named Paypal_lib (lowercase "l" in lib), and make sure filename is the same way.[/quote] You're right. Changed to Paypal_lib and it worked! Thanks! Now to finish i have 2 problems lol: 1- Getting this: Fatal error: ob_start() [<a href='ref.outcontrol'>ref.outcontrol</a>]: Cannot use output buffering in output buffering display handlers in /home/availabl/public_html/sys/libraries/Exceptions.php on line 162 When displaying this: Code: $this->button('Click here if you\'re not automatically redirected...'); I have compression enable so how can i get this going without the error? 2- I don't have any ipn log file after the completed transaction. I only receive the email. Is this normal? Thanks. Paypal_Lib + Monthly Subscription - El Forum - 07-22-2010 [eluser]pickupman[/eluser] 1.In order to use output compression you need to change the echos'. Add each line to a string, and pass that off to a view. Code: $data['form'] = '<html>' ."\n"; 2. In order to use the log, enable the option in config/paypallib_config.php. Make sure the file exists and has write permissions (0777). I edited the code and created a paypal_log table. Then I just insert the log details into the table. I can view in my dashboard that way. Lazy opening files I guess. |