<?php
-// $Id$
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
*
*/
-/**
- * Include utility functions
- */
-require_once 'CRM/Pledge/BAO/PledgePayment.php';
-
/**
* Add or update a plege payment. Pledge Payment API doesn't actually add a pledge
* if the request is to 'create' and 'id' is not passed in
function civicrm_api3_pledge_payment_create($params) {
$paymentParams = $params;
- if (empty($params['id']) && !CRM_Utils_Array::value('option.create_new', $params)) {
+ if (empty($params['id']) && empty($params['option.create_new'])) {
$paymentDetails = CRM_Pledge_BAO_PledgePayment::getOldestPledgePayment($params['pledge_id']);
if (empty($paymentDetails)) {
return civicrm_api3_create_error("There are no unmatched payment on this pledge. Pass in the pledge_payment id to specify one or 'option.create_new' to create one");