Skip to content

Commit

Permalink
Rebased!
Browse files Browse the repository at this point in the history
  • Loading branch information
adixon committed Oct 27, 2020
1 parent f6056f1 commit e786bd4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CRM/Core/Payment/iATSService.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,13 @@ protected function updateRecurring($params, $update) {
// By default, it's empty, unless we've got a future start date.
if (empty($update['receive_date'])) {
$next = strtotime('+' . $params['frequency_interval'] . ' ' . $params['frequency_unit']);
// handle the special case of monthly contributions made after the 28th
if ('month' == $params['frequency_unit']) {
$now = getdate();
if ($now['mday'] > 28) { // pull it back to the 28th
$next = $next - (($now['mday'] - 28) * 24 * 60 * 60);
}
}
$recur_update['next_sched_contribution_date'] = date('Ymd', $next) . '030000';
}
else {
Expand Down

0 comments on commit e786bd4

Please sign in to comment.