Commit 820f26aa authored by mattwire's avatar mattwire

Support future recurring start date on backend forms

parent 04a957b3
......@@ -141,7 +141,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
* @return bool
*/
public function supportsFutureRecurStartDate() {
return FALSE;
return TRUE;
}
/**
......@@ -661,6 +661,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
'default_payment_method' => $stripePaymentMethod,
'metadata' => ['Description' => $params['description']],
'expand' => ['latest_invoice.payment_intent'],
'billing_cycle_anchor' => $this->getRecurBillingCycleDay($params),
];
// Create the stripe subscription for the customer
......@@ -705,6 +706,15 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
return $this->endDoPayment($params, $newParams);
}
private function getRecurBillingCycleDay($params) {
if (empty($params['receive_date'])) {
return strtotime('now');
}
else {
return strtotime($params['receive_date']);
}
}
/**
* This performs the processing and recording of the paymentIntent for both recurring and non-recurring payments
* @param array $params
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment