Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix creation of recurrent with invalid charge_at date
If `subscription_types.fixed_end` is set, next `charge_at` is always set to value `subscription_types.fixed_end - recurrent_charge_before` which can be (when current date is close to or after `fixed_end`) before `subscriptions.start_time`. `RecurrentPaymentsRepository->calculateChargeAt()` now throws exception if calculated next `charge_at` is invalid (recurrent payment's next charge shouldn't be before subscriptions start date or before current datetime). And if `RecurrentPaymentsRepository->createFromPayment()` catches this exception, recurrent payment is stopped (marked as stopped by system). remp/crm#1662
- Loading branch information