Commit fa17e6f0 authored by capo's avatar capo
Browse files

Call IPN->main() from inside a try catch to allow loops

parent ab800724
......@@ -97,7 +97,12 @@ function civicrm_api3_stripe_Ipn($params) {
// CRM_Core_Payment::handlePaymentMethod
$_GET['processor_id'] = $ppid;
$ipnClass = new CRM_Core_Payment_StripeIPN($object);
$ipnClass->main();
$ipnClass->setExceptionMode(FALSE);
try {
$ipnClass->main();
} catch(Throwable $e) {
return civicrm_api3_create_error($e->getMessage());
}
if ($params['noreceipt'] == 1) {
$ipnClass->setSendEmailReceipt(0);
}
......
  • mentioned in merge request scardinius/mjwshared!1 (closed)

    Toggle commit list
  • Author Maintainer

    I haven't created a pull request for this yet because it depends on this other one, which implements the setExceptionMode method.

  • Author Maintainer

    This change will make possible to call the Stripe.ipn API in a loop, catching the generated exceptions. There is an example implementation of what would be possible: here.

  • mentioned in merge request extensions/mjwshared!5 (closed)

    Toggle commit list
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment