webtechnick / CakePHP-Paypal-IPN-Plugin

CakePHP Paypal Instant Payment Notification Plugin

Home Page:http://www.webtechnick.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need an exit() on __processTransaction() ?

brandonjjon opened this issue · comments

Hi there,

I spent a ton of time on this issue. Every time a valid post would come through, my cake error.log was being spammed with hundreds (possibly thousands) of lines complaining about headers already being sent. But it wouldn't happen on an invalid post. I ended up resolved it by putting an exit(); right after $this->afterPaypalNotification($txnId); in the __processTransaction() function. I'll paste it as such:

private function __processTransaction($txnId) {
    $this->log("Processing Trasaction: {$txnId}");
    $this->afterPaypalNotification($txnId);
    exit();
}

Not sure exactly why this would happen, but glad it's fixed now. I suppose it could also be a problem with my particular project since I haven't seen any related issues.

Thanks!