I am trying to call a simple function inside the app_controller but nothing
is happening.
function afterPaypalNotification($txnId) {
if
($transaction['InstantPaymentNotification']['payment_status'] ==
'Completed') {
//get info from transaction
$user_id = $transaction['InstantPaymentNotification']['custom'];
$adding = $transaction['InstantPaymentNotification']['quantity'];
$credits = $this->User->getCredits($user_id);
$addCredits = $adding + $credits;
$this->User->id = $user_id;
$this->User->saveField('credits', $addCredits);
} else {
//do something else Not Approved email
}
}
public function getCredits($id)
{
$params = array(
'conditions' => array(
'User.id' => $id),
'fields' => array('User.id',
'User.credits'),
'contain' => false);
$q = $this->User->find('first', $params);
return $q['User']['credits'];
}
Where am I going wrong here?
The IPN is being sent back when I test from PayPal sandbox, saved to mydb so
there is a record. I am sending a real user id to test so it should be doing
something.
Dave
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---