Skip to content

Failed payments are treated as successful

JonGold requested to merge JonGold/mjwshared:throw-error-exceptions into master

Steps to replicate

  • Install D9, webform, webform_civicrm, mjwshared and authnet.
  • Create any form that can accept a contribution (set in test mode).
  • Submit a card with an expiration date in the past.

Expected Behavior

  • Card is declined, contribution isn't recorded, user receives an on-screen error.

Actual behavior

  • Card is declined, contribution is recorded as "Complete" in CiviCRM, user receives a message that their transaction is complete.

I traced this down to the "@fixme - Throw an exception" in the handleError() method. I made what I believe are the necessary changes in authnet, mjwshared, and stripe. I can confirm that this fixes my scenario, but I wanted to get feedback on whether I was missing something obvious, because it seems like the sort of thing that you would've done if it was straightforward.

Merge request reports

Loading