I was trying to figure out why I didn't see IPN call backs for pending payments so I did a little digging into paypal_listener.php and after seeing why, it might be good to post this. I'd looked at this code before but it didn't sink in at that time but the code around line 113 looks like this:
That means that the only payment status getting processed is one that is "Completed". Since there are currently 11 statuses (Canceled_Reversal, Completed, Created, Denied, Expired, Failed, Pending, Refunded, Reversed, Processed, Voided) this may cause people a little confusion when the don't see their IPN calls getting processed in their "On Verified" code.
I don't know what other people are doing, but it would seem that it would make more sense to just let all the statuses come through under the "verified" action since the data has been verified. I changed the code on my system to look like this:
I think it would also work to put the processing code after the listener and use the "Show Stopper" action in both "On Error" and "On Invalid" but I didn't test that since all my processing was in the "On Verified" and I didn't want to mess with moving it😉
Dave
function set_events($valid = false, $form){
if($valid){
if($form->data['payment_status'] == 'Completed'){
$this->events['verified'] = 1;
}
//$this->events['invalid'] = 1;//delete
}else{
$this->events['invalid'] = 1;
}
}
That means that the only payment status getting processed is one that is "Completed". Since there are currently 11 statuses (Canceled_Reversal, Completed, Created, Denied, Expired, Failed, Pending, Refunded, Reversed, Processed, Voided) this may cause people a little confusion when the don't see their IPN calls getting processed in their "On Verified" code.
I don't know what other people are doing, but it would seem that it would make more sense to just let all the statuses come through under the "verified" action since the data has been verified. I changed the code on my system to look like this:
function set_events($valid = false, $form){
if($valid){
$this->events['verified'] = 1;
}else{
$this->events['invalid'] = 1;
}
}
I think it would also work to put the processing code after the listener and use the "Show Stopper" action in both "On Error" and "On Invalid" but I didn't test that since all my processing was in the "On Verified" and I didn't want to mess with moving it😉
Dave