CodeIgniter Forums
AngellEye PayPal IPN listener post additional data to database. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: AngellEye PayPal IPN listener post additional data to database. (/thread-60290.html)



AngellEye PayPal IPN listener post additional data to database. - El Forum - 02-23-2014

[eluser]comyou[/eluser]
Hello all,

I'm unaware if anyone is familiar with the Angell Lab PayPal library for CodeIgniter.
I've currently got the IPN listener etc. all set up on my server fine and it's writing to its orders table however I'm looking to insert some data into another table.

I'm looking to input the returned field "credits" & existing value from "users.credits" into my table "users" where users.id = the returned field "custom".

> Grab current "credits" value from "users" table where "users.id" is $order_data['custom'];
> Update "credits" in "users" table to the current value + $order_data['item_number'];


I'm not having any luck, I've tried this to see if it inputs the value but it doesn't seem to work.
Code:
$user_data = array (
'id' => $order_data['custom'],
'credits' => $order_data['item_number'],
);

$this->db->insert('users', $user_data);

Does anyone familiar with the IPN listener know how I would do this?

The listener: http://www.angelleye.com/product/paypal-instant-payment-notification-ipn-php-template/

The current query which inserts the order data into the table "orders":
Code:
$order_id = $db -> query_insert('orders', $order_data);