'financial_account_id' => $financialAccount,
'contact_id' => CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain', CRM_Core_Config::domainID(), 'contact_id'),
'created_date' => date('YmdHis'),
- 'transaction_date' => date('YmdHis'),
+ 'transaction_date' => $params['trxnParams']['trxn_date'],
'amount' => $amount,
'description' => 'Fee',
'status_id' => CRM_Core_PseudoConstant::getKey('CRM_Financial_BAO_FinancialItem', 'status_id', 'Paid'),
];
$contribution = $this->callAPISuccess('contribution', 'create', $params);
+ $financialItems = $this->callAPISuccess('FinancialItem', 'get', []);
+ foreach ($financialItems['values'] as $financialItem) {
+ $this->assertEquals(date('Y-m-d H:i:s', strtotime($contribution['values'][$contribution['id']]['receive_date'])), date('Y-m-d H:i:s', strtotime($financialItem['transaction_date'])));
+ }
$lineItems = $this->callAPISuccess('line_item', 'get', [
'entity_id' => $contribution['id'],
'entity_table' => 'civicrm_contribution',