Part of the EllisLab Network
   
 
PayPal IPN Library - How to post IPN results to db in model?
Posted: 02 November 2007 12:07 PM   [ Ignore ]  
Grad Student
Rank
Total Posts:  78
Joined  09-26-2007

Got the Paypal IPN Library working great! But…I can’t add payment and cart info to my db tables in the model. I can email the results though. Here’s what I have:

Controller

function ipn()
    
{        
        
if ($this->paypal_lib->validate_ipn())
        
{
            
if ($this->paypal_lib->ipn_data['txn_type'] == "cart")
            
{
                $this
->load->model('Store_model', '', TRUE);
                
$this->Store_model->paypalIPNInsertCartPaymentInfo();
                
$this->Store_model->paypalIPNInsertCartItemInfo();
            
}
        }
    }

Model

function paypalIPNInsertCartPaymentInfo()
    
{
        $datecreation
= date("Y").date("m").date("d");
        
        
$updatedata = array(
            
'paymentstatus' => $this->paypal_lib->ipn_data['payment_status'],
            
'buyer_email' => $this->paypal_lib->ipn_data['payer_email'],
            ...
            );
        
        
$this->db->insert('paypal_payment_info', $updatedata);
    
}
Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120468 Total Logged-in Users: 32
Total Topics: 126547 Total Anonymous Users: 4
Total Replies: 665392 Total Guests: 301
Total Posts: 791939    
Members ( View Memberlist )