id]); return civicrm_api3_create_success($relType, $params, 'payment_processor_type', 'create', $payProcType); } /** * Adjust Metadata for Create action * * The metadata is used for setting defaults, documentation & validation * @param array $params array or parameters determined by getfields */ function _civicrm_api3_payment_processor_type_create_spec(&$params) { $params['billing_mode']['api.required'] = 1; $params['class_name']['api.required'] = 1; $params['is_active']['api.default'] = 1; $params['is_recur']['api.default'] = FALSE; // FIXME bool support // $params['is_recur']['api.required'] = 1; $params['name']['api.required'] = 1; $params['title']['api.required'] = 1; } /** * Function to get all payment_processor type * retruns An array of PaymentProcessor_type * @access public * {@getfields PaymentProcessorType_get} * @example PaymentProcessorTypeGet.php */ function civicrm_api3_payment_processor_type_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); } /** * Delete a payment_processor type delete * * @param id of payment_processor type $id * * @return array API Result Array * {@getfields PaymentProcessorType_delete} * @static void * @access public */ function civicrm_api3_payment_processor_type_delete($params) { if ($params['id'] != NULL && !CRM_Utils_Rule::integer($params['id'])) { return civicrm_api3_create_error('Invalid value for payment processor type ID'); } $payProcTypeBAO = new CRM_Financial_BAO_PaymentProcessorType(); $result = $payProcTypeBAO->del($params['id']); if (!$result) { return civicrm_api3_create_error('Could not delete payment processor type'); } return civicrm_api3_create_success($result, $params, 'payment_processor_type', 'delete', $payProcTypeBAO); }