public function tearDown() {
$this->eventDelete($this->_eventId);
- $this->quickCleanup(
- array(
- 'civicrm_contact',
- 'civicrm_contribution',
- 'civicrm_participant',
- 'civicrm_participant_payment',
- 'civicrm_line_item',
- 'civicrm_financial_item',
- 'civicrm_financial_trxn',
- 'civicrm_price_set',
- 'civicrm_entity_financial_trxn',
- ),
- TRUE
- );
+ $this->quickCleanUpFinancialEntities();
}
/**
]
);
$contributionID = $result['contribution']['id'];
- extract($result);
// check payment info
- $paymentInfo = CRM_Contribute_BAO_Contribution::getPaymentInfo($participant['id'], 'event');
+ $paymentInfo = CRM_Contribute_BAO_Contribution::getPaymentInfo($result['participant']['id'], 'event');
$this->assertEquals(round($paymentInfo['total']), $feeAmt, 'Total amount recorded is not proper');
$this->assertEquals(round($paymentInfo['paid']), $amtPaid, 'Amount paid is not proper');
$this->assertEquals(round($paymentInfo['balance']), $feeAmt, 'Balance amount is not proper');
$form->testSubmit($submitParams);
// check payment info again and see if the payment is completed
- $paymentInfo = CRM_Contribute_BAO_Contribution::getPaymentInfo($participant['id'], 'event');
+ $paymentInfo = CRM_Contribute_BAO_Contribution::getPaymentInfo($result['participant']['id'], 'event');
$this->assertEquals(round($paymentInfo['total']), $feeAmt, 'Total amount recorded is not proper');
$this->assertEquals(round($paymentInfo['paid']), $feeAmt, 'Amount paid is not proper');
$this->assertEquals(round($paymentInfo['balance']), 0, 'Balance amount is not proper');
$amtPaid = 80;
$result = $this->addParticipantWithPayment($feeAmt, $amtPaid);
$contributionID = $result['contribution']['id'];
- extract($result);
//Complete the partial payment.
$submittedValues = array(
'total_amount' => 20,
'payment_instrument_id' => 3,
);
- CRM_Contribute_BAO_Contribution::recordAdditionalPayment($contributionID, $submittedValues, 'owed', $participant['id']);
+ CRM_Contribute_BAO_Contribution::recordAdditionalPayment($contributionID, $submittedValues, 'owed', $result['participant']['id']);
//Change selection to a lower amount.
$params['price_2'] = 50;
- CRM_Price_BAO_LineItem::changeFeeSelections($params, $participant['id'], 'participant', $contributionID, $feeBlock, $lineItem, $feeAmt);
+ CRM_Price_BAO_LineItem::changeFeeSelections($params, $result['participant']['id'], 'participant', $contributionID, $result['feeBlock'], $result['lineItem']);
//Record a refund of the remaining amount.
$submittedValues['total_amount'] = 50;
- CRM_Contribute_BAO_Contribution::recordAdditionalPayment($contributionID, $submittedValues, 'refund', $participant['id']);
- $paymentInfo = CRM_Contribute_BAO_Contribution::getPaymentInfo($participant['id'], 'event', TRUE);
+ CRM_Contribute_BAO_Contribution::recordAdditionalPayment($contributionID, $submittedValues, 'refund', $result['participant']['id']);
+ $paymentInfo = CRM_Contribute_BAO_Contribution::getPaymentInfo($result['participant']['id'], 'event', TRUE);
$transaction = $paymentInfo['transaction'];
//Assert all transaction(owed and refund) are listed on view payments.