Skip to content
Snippets Groups Projects
Commit fa17e6f0 authored by capo's avatar capo
Browse files

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

parent ab800724
No related tags found
No related merge requests found
......@@ -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);
}
......
  • capo @capo

    mentioned in merge request scardinius/mjwshared!1 (closed)

    ·

    mentioned in merge request scardinius/mjwshared!1 (closed)

    Toggle commit list
  • Author Owner

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

  • Author Owner

    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.

  • capo @capo

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

    ·

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

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