• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PayPal IPN Library - How to post IPN results to db in model?

#1
[eluser]spheroid[/eluser]
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
Code:
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
Code:
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);
    }

#2
[eluser]alexatkeplar[/eluser]
To post IPN results to db in model, I would suggest using my new library:

PayPal IPN library for CodeIgniter

It has saving to db baked in - no extra code required.

#3
[eluser]CI2RULZ[/eluser]
you use doctrine which opens up a whole other can of worms that many CI users are not using.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.