From 59534465b7c7674793c63d19243151286c3ff1a4 Mon Sep 17 00:00:00 2001 From: Jamie McClelland <jm@mayfirst.org> Date: Tue, 8 Aug 2017 11:37:30 -0400 Subject: [PATCH] avoid IDS extension problems https://github.com/drastik/com.drastikbydesign.stripe/issues/228 --- stripe.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/stripe.php b/stripe.php index f7701012..0783174b 100644 --- a/stripe.php +++ b/stripe.php @@ -203,3 +203,20 @@ function stripe_civicrm_managed(&$entities) { } } } + +/* + * Implementation of hook_idsException. + * + * Ensure webhooks don't get caught in the IDS check. + */ +function stripe_civicrm_idsException(&$skip) { + // Handle old method. + $skip[] = 'civicrm/stripe/webhook'; + // Handle new method. Get the IDs of the Stripe payment processor. + $sql = "SELECT pp.id FROM civicrm_payment_processor pp JOIN civicrm_payment_processor_type + pt ON pp.payment_processor_type_id = pt.id AND pt.name = 'Stripe'"; + $dao = CRM_Core_DAO::executeQuery($sql); + while($dao->fetch()) { + $skip[] = 'civicrm/payment/ipn/' . $dao->id; + } +} -- GitLab