$financialTypeId = $contribution['financial_type_id'];
$feeFinancialAccount = CRM_Contribute_PseudoConstant::getRelationalFinancialAccount($financialTypeId, 'Expense Account is');
- if ($paymentBalance == 0 && $info['payLater']) {
- // @todo - review - this looks very unlikely to be correct.
- // the balance should be correct based on payment transactions not
- // assumptions.
- $paymentBalance = $total;
- }
-
$info['total'] = $total;
$info['paid'] = $total - $paymentBalance;
$info['balance'] = $paymentBalance;
* - event = [.... full event details......]
* - contribution = ['id' => x],
* - payment = [payment info + payment summary info]
+ * @throws \CiviCRM_API3_Exception
*/
protected static function loadRelatedEntities($id) {
$entities = [];
/**
* Test the submit function that completes the partially paid Contribution with multiple payments.
+ *
+ * @throws \CRM_Core_Exception
*/
public function testMultiplePaymentForPartiallyPaidContributionWithOneCreditCardPayment() {
$mut = new CiviMailUtils($this, TRUE);
/**
* Test the submit function that completes the pending pay later Contribution using Credit Card.
+ *
+ * @throws \CRM_Core_Exception
*/
public function testAddPaymentUsingCreditCardForPendingPayLaterContribution() {
+ $mut = new CiviMailUtils($this, TRUE);
$this->createContribution('Pending');
// pay additional amount by using Credit Card
- $this->submitPayment(100, 'live');
+ $this->submitPayment(100, 'live', TRUE);
$this->checkResults([100], 1);
+
+ $mut->checkMailLog([
+ 'A payment has been received',
+ 'Total Fees: $ 100.00',
+ 'This Payment Amount: $ 100.00',
+ 'Balance Owed: $ 0.00 ',
+ 'Paid By: Credit Card',
+ '***********1111',
+ 'Billing Name and Address',
+ 'Vancouver, AE 1321312',
+ 'Expires: May 2025',
+
+ ]);
+ $mut->stop();
+ $mut->clearMessages();
}
/**