Commit ffcbe024 authored by mattwire's avatar mattwire

Fix issue with future start date for memberships when it is 'now'

parent fa52c827
......@@ -728,8 +728,14 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
*/
private function getRecurBillingCycleDay($params) {
if (isset($params['receive_date'])) {
return strtotime($params['receive_date']);
$receiveDateTimestamp = strtotime($params['receive_date']);
// If `receive_date` was set to "now" it will be in the past (by a few seconds) by the time we actually send it to Stripe.
if ($receiveDateTimestamp > strtotime('now')) {
// We've specified a receive_date in the future, use it!
return $receiveDateTimestamp;
}
}
// Either we had no receive_date or receive_date was in the past (or "now" when form was submitted).
return NULL;
}
......
......@@ -14,7 +14,7 @@
<author>Matthew Wire (MJW Consulting)</author>
<email>mjw@mjwconsult.co.uk</email>
</maintainer>
<releaseDate>2020-07-18</releaseDate>
<releaseDate>2020-07-31</releaseDate>
<version>6.5-dev</version>
<develStage>alpha</develStage>
<compatibility>
......
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