$params = $this->getContributionData();
$this->assertTrue($form->testProcessContribution($params));
$result = $this->callAPISuccess('contribution', 'get', ['return' => 'total_amount']);
- $this->assertEquals(2, $result['count']);
+ $this->assertEquals(3, $result['count']);
foreach ($result['values'] as $contribution) {
$this->assertEquals($this->callAPISuccess('line_item', 'getvalue', [
'contribution_id' => $contribution['id'],
]), $contribution['total_amount']);
}
+ $checkResult = $this->callAPISuccess('Contribution', 'get', ['check_number' => ['IS NOT NULL' => 1]]);
+ $this->assertEquals(1, $checkResult['count']);
+ $entityFinancialTrxn = $this->callAPISuccess('EntityFinancialTrxn', 'get', ['entity_table' => 'civicrm_contribution', 'entity_id' => $checkResult['id']]);
+ $financialTrxn = $this->callAPISuccess('FinancialTrxn', 'get', ['id' => $entityFinancialTrxn['values'][$entityFinancialTrxn['id']]['financial_trxn_id']]);
+ $this->assertEquals('1234', $financialTrxn['values'][$financialTrxn['id']]['check_number']);
}
/**
'check_number' => NULL,
'contribution_status_id' => 1,
],
+ 3 => [
+ 'financial_type' => 1,
+ 'total_amount' => $this->formatMoneyInput(1500.15),
+ 'receive_date' => '2013-07-24',
+ 'receive_date_time' => NULL,
+ 'payment_instrument' => 4,
+ 'contribution_check_number' => '1234',
+ 'contribution_status_id' => 1,
+ ],
],
- 'actualBatchTotal' => $this->formatMoneyInput(3000.30),
+ 'actualBatchTotal' => $this->formatMoneyInput(4500.45),
];
}