$contribution->trxn_id = $input['trxn_id'];
$contribution->receive_date = CRM_Utils_Date::isoToMysql($contribution->receive_date);
$contribution->thankyou_date = CRM_Utils_Date::isoToMysql($contribution->thankyou_date);
+ $contribution->receipt_date = CRM_Utils_Date::isoToMysql($contribution->receipt_date);
$contribution->cancel_date = 'null';
if (CRM_Utils_Array::value('check_number', $input)) {
$mut->stop();
}
+ /**
+ * CRM-14151
+ * Test completing a transaction via the API
+ *
+ * For wierd caching-y reasons this test performs differently in isolation than with other
+ * tests.
+ */
+ function testCompleteTransactionWithReceiptDateSet() {
+ $mut = new CiviMailUtils( $this, true );
+ $this->createLoggedInUser();
+ $params = array_merge($this->_params, array('contribution_status_id' => 1,'receipt_date' => 'now'));
+ $contribution = $this->callAPISuccess('contribution','create', $params);
+ $apiResult = $this->callAPISuccess('contribution', 'completetransaction', array(
+ 'id' => $contribution['id'],
+ )
+ );
+ $contribution = $this->callAPISuccess('contribution', 'get', array('id' => $contribution['id'], 'sequential' => 1,));
+ $this->assertEquals('Completed', $contribution['values'][0]['contribution_status']);
+ $mut->checkMailLog(array(
+ 'Receipt - Contribution',
+ 'Please print this confirmation for your records.',
+ ));
+ $mut->stop();
+ }
+
/**
* Test completing a transaction with an event via the API
*