Welcome Guest, Not a member yet? Register   Sign In
[solved] testing paypal ipn
#2

[eluser]SPeed_FANat1c[/eluser]
And found where was the problem:

we have a logging function in helper:

Code:
function log_action($type, $description, $info = FALSE)
{
    $CI =& get_instance();
    
    $data = array('uid' => (isset($info['user'])) ? $info['user'] : $CI->session->userdata('user_id'),
                  'imone' => (isset($info['company'])) ? $info['company'] : $CI->session->userdata('imones_id'),
                  'tipas' => $type,
                  'info' => $description,
                  'ip' => $_SERVER['REMOTE_ADDR'],
                  'browser' => $_SERVER['HTTP_USER_AGENT'],
                  'referrer' => (@$_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "",
                  'data' => date("Y-m-d H:i:s")
                  );    
    
    $CI->db->insert('log',$data);
}

It works well everywhere. But when we use in the IPN function and run that function with simulator, it fails. Now I made the same function in the controller, slightly modiefied:

Code:
private function log_action($type, $description, $info = FALSE)
    {
        //$CI =& get_instance();
        
        $data = array('uid' => (isset($info['user'])) ? $info['user'] : $CI->session->userdata('user_id'),
                      'imone' => (isset($info['company'])) ? $info['company'] : $CI->session->userdata('imones_id'),
                      'tipas' => $type,
                      'info' => $description,
                      'ip' => $_SERVER['REMOTE_ADDR'],
                      'browser' => $_SERVER['HTTP_USER_AGENT'],
                      'referrer' => (@$_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "",
                      'data' => date("Y-m-d H:i:s")
                      );    
        
        $this->db->insert('log',$data);
    }

And now run the simulator - it also runs succesfully, though I don't see any new rows in database log table :/

If you have an idea why the original function from helper makes IPN delivery fail, you're welcome to tell Smile


Messages In This Thread
[solved] testing paypal ipn - by El Forum - 06-02-2011, 01:09 AM
[solved] testing paypal ipn - by El Forum - 06-02-2011, 01:54 AM
[solved] testing paypal ipn - by El Forum - 06-02-2011, 02:17 AM
[solved] testing paypal ipn - by El Forum - 06-02-2011, 03:05 AM
[solved] testing paypal ipn - by El Forum - 06-02-2011, 05:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB