Merge pull request #10988 from jmcclelland/CRM-21194
[civicrm-core.git] / api / v3 / PaymentProcessorType.php
index 363436faac233dd186e9b0266255038c0a0f6045..9c2799650fcc805560e39d27403358f9a519d239 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015                                |
+ | Copyright CiviCRM LLC (c) 2004-2017                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  * @return array
  */
 function civicrm_api3_payment_processor_type_create($params) {
-  if (isset($params['id']) && !CRM_Utils_Rule::integer($params['id'])) {
-    return civicrm_api3_create_error('Invalid value for payment_processor type ID');
-  }
-
-  $paymentProcessorType = CRM_Financial_BAO_PaymentProcessorType::create($params);
-
-  $relType = array();
-
-  _civicrm_api3_object_to_array($paymentProcessorType, $relType[$paymentProcessorType->id]);
-
-  return civicrm_api3_create_success($relType, $params, 'PaymentProcessorType', 'create', $paymentProcessorType);
+  return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'PaymentProcessorType');
 }
 
 /**