如何整合paypal IPN争议通知

So I recently got my IPN setup which handles my payments the way I want them to, but how do I check if a user has disputed the payment? I'm new to IPNs so do I need to integrate some sort of new code INTO the same ipn.php such as if (preg_match('/Completed/', $payment_status)) { should I have like if (preg_match('/Disputed/', $payment_status)) { or something, I how would I do this?

For disputes you will get an IPN with a txn_type of "new_case". Within your code you can add logic to check for this and react accordingly.