* @throws \CiviCRM_API3_Exception
*/
public static function updateOnNewPayment($recurringContributionID, $paymentStatus, $effectiveDate) {
- if (empty($effectiveDate)) {
- $effectiveDate = date('Y-m-d');
- }
+
+ $effectiveDate = $effectiveDate ? date('Y-m-d', strtotime($effectiveDate)) : date('Y-m-d');
if (!in_array($paymentStatus, array('Completed', 'Failed'))) {
return;
}
*/
public function testSupportFinancialTypeChange() {
$contributionRecur = $this->callAPISuccess('contribution_recur', 'create', $this->_params);
- $contribution = $this->callAPISuccess('contribution', 'create', array(
+ $this->callAPISuccess('contribution', 'create', array(
'contribution_recur_id' => $contributionRecur['id'],
'total_amount' => '3.00',
'financial_type_id' => 1,
'currency' => 'USD',
'contact_id' => $this->individualCreate(),
'contribution_status_id' => 1,
- 'recieve_date' => 'yesterday',
+ 'receive_date' => 'yesterday',
));
$this->assertTrue(CRM_Contribute_BAO_ContributionRecur::supportsFinancialTypeChange($contributionRecur['id']));
}
'receive_date' => '2012-02-29',
'expected' => '2012-03-29 00:00:00',
);
+ $result['receive_date_includes_time']['2012-01-01-1-month'] = array(
+ 'data' => array(
+ 'start_date' => '2012-01-01',
+ 'frequency_interval' => 1,
+ 'frequency_unit' => 'month',
+ 'next_sched_contribution_date' => '2012-02-29',
+ ),
+ 'receive_date' => '2012-02-29 16:00:00',
+ 'expected' => '2012-03-29 00:00:00',
+ );
return $result;
}