'campaign_id',
'receive_date',
'receipt_date',
+ 'contribution_status_id',
);
if (self::isSingleLineItem($primaryContributionID)) {
$inputContributionWhiteList[] = 'financial_type_id';
elseif (!empty($contribution->_relatedObjects['membership'])) {
$input['skipLineItem'] = TRUE;
$input['contribution_mode'] = 'membership';
- $contribution->contribution_status_id = $completedContributionStatusID;
+ $contribution->contribution_status_id = $contributionParams['contribution_status_id'];
$contribution->trxn_id = CRM_Utils_Array::value('trxn_id', $input);
$contribution->receive_date = CRM_Utils_Date::isoToMysql($contribution->receive_date);
}
$input['trxn_id'] = $contribution->trxn_id;
$input['trxn_date'] = isset($contribution->trxn_date) ? $contribution->trxn_date : NULL;
$input['receipt_update'] = $params['receipt_update'];
+ $input['contribution_status_id'] = $contribution->contribution_status_id;
// CRM_Contribute_BAO_Contribution::composeMessageArray expects mysql formatted date
$objects['contribution']->receive_date = CRM_Utils_Date::isoToMysql($objects['contribution']->receive_date);
}
unset($contribution->id, $contribution->receive_date, $contribution->invoice_id);
- $contribution->contribution_status_id = $params['contribution_status_id'];
$contribution->receive_date = $params['receive_date'];
- $passThroughParams = array('trxn_id', 'total_amount', 'campaign_id', 'fee_amount', 'financial_type_id');
+ $passThroughParams = array(
+ 'trxn_id',
+ 'total_amount',
+ 'campaign_id',
+ 'fee_amount',
+ 'financial_type_id',
+ 'contribution_status_id',
+ );
$input = array_intersect_key($params, array_fill_keys($passThroughParams, NULL));
$params = _ipn_process_transaction($params, $contribution, $input, $ids, $original_contribution);
'id' => $contribution['id'],
));
$contribution = $this->callAPISuccess('contribution', 'getsingle', array('id' => $contribution['id']));
+ $this->assertEquals('SSF', $contribution['contribution_source']);
$this->assertEquals('Completed', $contribution['contribution_status']);
$this->assertEquals(date('Y-m-d'), date('Y-m-d', strtotime($contribution['receipt_date'])));
$mut->checkMailLog(array(
'Receipt - Contribution',
'Please print this confirmation for your records.',
+ 'May 11th, 2012',
));
$mut->stop();
}
$this->callAPISuccessGetCount('Contribution', array('contribution_test' => 1), 2);
}
+ /**
+ * Test repeat contribution passed in status.
+ */
+ public function testRepeatTransactionPassedInStatus() {
+ $originalContribution = $this->setUpRepeatTransaction();
+
+ $this->callAPISuccess('contribution', 'repeattransaction', array(
+ 'original_contribution_id' => $originalContribution['id'],
+ 'contribution_status_id' => 'Pending',
+ 'trxn_id' => uniqid(),
+ ));
+ $this->callAPISuccessGetCount('Contribution', array('contribution_status_id' => 2), 1);
+ }
+
/**
* Test repeat contribution accepts recur_id instead of original_contribution_id.
*/