'trxn_id' => CRM_Utils_Array::value('trxn_id', $result),
'payment_processor_id' => $this->_paymentProcessor['id'],
'is_transactional' => FALSE,
+ 'fee_amount' => CRM_Utils_Array::value('fee_amount', $result),
)
);
}
'billing_mode' => 1,
));
$dummyPP = Civi\Payment\System::singleton()->getById($paymentProcessor2ID);
- $dummyPP->setDoDirectPaymentResult(array('payment_status_id' => 1, 'trxn_id' => 'create_first_success'));
+ $dummyPP->setDoDirectPaymentResult(array(
+ 'payment_status_id' => 1,
+ 'trxn_id' => 'create_first_success',
+ 'fee_amount' => .85,
+ ));
$this->callAPISuccess('ContributionPage', 'create', array(
'id' => $this->_ids['contribution_page'],
'payment_processor' => array($paymentProcessor2ID, $this->_ids['payment_processor']),
);
$this->callAPISuccess('contribution_page', 'submit', $submitParams);
- $this->callAPISuccess('contribution', 'getsingle', array(
+ $contribution = $this->callAPISuccess('contribution', 'getsingle', array(
'contribution_page_id' => $this->_ids['contribution_page'],
'contribution_status_id' => 1,
));
+ $this->assertEquals('create_first_success', $contribution['trxn_id']);
+ $this->assertEquals(10, $contribution['total_amount']);
+ $this->assertEquals(.85, $contribution['fee_amount']);
+ $this->assertEquals(9.15, $contribution['net_amount']);
}
+
/**
* Test submit with a membership block in place.
*/