*/
function civicrm_api3_payment_create(&$params) {
// Check if it is an update
- if (CRM_Utils_Array::value ('id', $params)) {
+ if (CRM_Utils_Array::value('id', $params)) {
$amount = $params['total_amount'];
civicrm_api3('Payment', 'cancel', $params);
$params['total_amount'] = $amount;
/**
* Test cancel payment api
- */
+ */
public function testCancelPayment() {
list($lineItems, $contribution) = $this->createParticipantWithContribution();
$payment = $this->callAPIAndDocument('payment', 'get', $params, __FUNCTION__, __FILE__);
$this->assertEquals(2, $payment['count']);
$amounts = array(-150.00, 150.00);
- foreach($payment['values'] as $value) {
+ foreach ($payment['values'] as $value) {
$this->assertEquals($value['total_amount'], array_pop($amounts), 'Mismatch total amount');
}