Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alteration of recurring contributions from other payment processors #687

Open
bastienho opened this issue Nov 10, 2023 · 1 comment
Open

Comments

@bastienho
Copy link
Contributor

I figure a strange behavior, really hard to catch.

On an installation using many payment processors, the next_sched_contribution_date on contribution_recur is set with SEPA settings, even if it's not SEPA payments. This behavior is very annoying.

Its seems that sepa_civicrm_post considers every recurring contribution as "eligible" without verification of its payment processor.

/**
 * CiviCRM POST event: make sure the next collection date
 *   is adjusted according to the change
 */
function sepa_civicrm_post($op, $objectName, $objectId, &$objectRef) {
  if ($objectName == 'ContributionRecur' || $objectName == 'SepaMandate') {
    if ($op == 'create' || $op == 'edit') {
      if ($objectName == 'SepaMandate') {
        CRM_Sepa_Logic_NextCollectionDate::processMandatePostEdit($op, $objectName, $objectId, $objectRef);
      } else {
        CRM_Sepa_Logic_NextCollectionDate::processRecurPostEdit($op, $objectName, $objectId, $objectRef);
      }
    }
  }
}

Moreover, the mechanism updates the next_sched_contribution_date only if it is empty, but based on params sent to the civicrm_pre hook, which is not relevant in case of the update of partial data.

Is my assumption correct?

In that case, I suggest t:

  • Check the if the payment_processor_id is associated to SEPA
  • Check the value of next_sched_contribution_date in both self::$currently_edited_recurring_contribution_params and $objectRef
@bastienho
Copy link
Contributor Author

It seems related to #672

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant