[eluser]ontguy[/eluser]
You can use the custom field in your form and included the details necessary to identify the order/purchase.
controller
Code:
function form_gen ()
{
$custom_string = $order_id:$user_id;
$this->paypal_lib->add_field('custom', $custom_string); // <-- Verify return
$this->paypal_lib->add_field('return', site_url('checkout/success')); //you could use this to say the order is in progress
$this->paypal_lib->add_field('cancel_return', site_url('checkout/cancel')); //redirect to this url when cancel on the paypal "side"
$this->paypal_lib->add_field('notify_url', site_url('checkout/ipn')); // <-- IPN url
}
function ipn () {
list($user_id, $order_id) = explode(":", $this->paypal_lib->ipn_data['custom']);
then update the database record
etc