* @throws \CRM_Core_Exception
*/
public function testCreateGetFieldsWithCustom(): void {
- $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__);
- $idsContact = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, 'ContactTest.php');
+ $ids = $this->entityCustomGroupWithSingleFieldCreate('ContributionCustomFields', __FILE__);
+ $idsContact = $this->entityCustomGroupWithSingleFieldCreate('ContactCustomFields', 'ContactTest.php');
$result = $this->callAPISuccess('Contribution', 'getfields', []);
$this->assertArrayHasKey('custom_' . $ids['custom_field_id'], $result['values']);
$this->assertArrayNotHasKey('custom_' . $idsContact['custom_field_id'], $result['values']);
/**
* Function tests that financial records are updated when Payment Instrument is changed.
*/
- public function testCreateUpdateContributionPaymentInstrument() {
+ public function testCreateUpdateContributionPaymentInstrument(): void {
$instrumentId = $this->_addPaymentInstrument();
$contribParams = [
'contact_id' => $this->_individualId,
'id' => $contribution['id'],
'payment_instrument_id' => $instrumentId,
]);
- $contribution = $this->callAPISuccess('contribution', 'create', $newParams);
+ $contribution = $this->callAPISuccess('Contribution', 'create', $newParams);
$this->assertAPISuccess($contribution);
$this->checkFinancialTrxnPaymentInstrumentChange($contribution['id'], 4, $instrumentId);
// cleanup - delete created payment instrument
- $this->_deletedAddedPaymentInstrument();
+ $this->deletedAddedPaymentInstrument();
}
/**
$this->checkFinancialTrxnPaymentInstrumentChange($contribution['id'], 4, $instrumentId, -100);
// cleanup - delete created payment instrument
- $this->_deletedAddedPaymentInstrument();
+ $this->deletedAddedPaymentInstrument();
}
/**
/**
* CRM-14151 - Test completing a transaction via the API.
*/
- public function testCompleteTransactionWithReceiptDateSet() {
+ public function testCompleteTransactionWithReceiptDateSet(): void {
$this->swapMessageTemplateForTestTemplate();
$mut = new CiviMailUtils($this, TRUE);
$this->createLoggedInUser();
*
* If passed in it will override the default from contribution page.
*
+ * @throws \API_Exception
* @throws \CRM_Core_Exception
*/
public function testCompleteTransactionWithEmailReceiptInputTrue(): void {
// Create a Contribution Page with is_email_receipt = FALSE
$contributionPageID = $this->createQuickConfigContributionPage($contributionPageParams);
$this->_params['contribution_page_id'] = $contributionPageID;
- $params = array_merge($this->_params, ['contribution_status_id' => 2, 'receipt_date' => 'now']);
- $contribution = $this->callAPISuccess('contribution', 'create', $params);
- // Complete the transaction overriding is_email_receipt to = TRUE
- $this->callAPISuccess('contribution', 'completetransaction', [
+ $params = array_merge($this->_params, ['contribution_status_id' => 2, 'receipt_date' => 'now', 'amount_level' => 'amount entered']);
+ $contribution = $this->callAPISuccess('Contribution', 'create', $params);
+ // Complete the transaction overriding is_email_receipt to = TRUE.
+ $this->callAPISuccess('Contribution', 'completetransaction', [
'id' => $contribution['id'],
'is_email_receipt' => 1,
]);
$mut->checkMailLog([
'Contribution Information',
+ 'amount entered',
]);
$mut->stop();
}
return $optionValue['values'][$optionValue['id']]['value'];
}
- public function _deletedAddedPaymentInstrument() {
+ public function deletedAddedPaymentInstrument() {
$result = $this->callAPISuccess('OptionValue', 'get', [
'option_group_id' => 'payment_instrument',
'name' => 'Test Card',