-
Notifications
You must be signed in to change notification settings - Fork 0
PayPal Lib
[h3]Introduction[/h3]
This library provides a neat and simple method to interface with PayPal and the PayPal Instant Payment Notification (IPN) interface. It requires the developer (that should be you) to understand the PayPal process and know the variables you want/need to pass to PayPal to achieve what you want.
PayPal_Lib requires CI 1.5.0.1 and higher and the url and form helpers to be loaded.
Distributed under LGPL by Ran Aroussi (based on the Paypal PHP class by Micah Carrick).
Extensive documentation is available in the download and here.
Download: File:paypal_lib.zip
Cheers!
Ran Aroussi Web Consultant & Entrepreneur
[h3]EDIT:[/h3] Several people have had some problems getting the IPN function to work with this library. Gunther, Derek, Oscar, Joeles, and a guy from Japan were able to get it working. Here are the fixes:
[b][u]Controller:[/b][/u] paypal.php Around Line 90:
** Change: [code]$data['pp_info'] = $this->input->post();[/code] ** to: [code]$data['pp_info'] = $_POST;[/code]
[b][u]Library:[/b][/u] Paypal_Lib.php Around Line 153:
** Change: [code] if ($this->CI->input->post()) { foreach ($this->CI->input->post() as $field=>$value) { $this->ipn_data[$field] = $value; $post_string .= $field.'='.urlencode(stripslashes($value)).'&'; } } [/code]
** To: [code] if (isset($_POST)) { foreach ($_POST as $field=>$value) { // str_replace("\n", "\r\n", $value) // put line feeds back to CR+LF as that's how PayPal sends them out // otherwise multi-line data will be rejected as INVALID
$value = str_replace("\n", "\r\n", $value);
$this->ipn_data[$field] = $value;
$post_string .= $field.'='.urlencode(stripslashes($value)).'&';
}
}
[/code]