Merge pull request #6378 from johanv/CRM-15991-permission_delete_relationship
[civicrm-core.git] / api / v3 / PaymentProcessorType.php
index 34035ef1c45b825571134a52b7f07b502a3247df..8ad42cc0ef64220aa7bc1979b9e84fbe4a24ca20 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -29,7 +29,6 @@
  * This api exposes CiviCRM payment processor types.
  *
  * @package CiviCRM_APIv3
- * @subpackage API_Contact
  */
 
 /**
@@ -51,7 +50,7 @@ function civicrm_api3_payment_processor_type_create($params) {
 
   _civicrm_api3_object_to_array($paymentProcessorType, $relType[$paymentProcessorType->id]);
 
-  return civicrm_api3_create_success($relType, $params, 'payment_processor_type', 'create', $paymentProcessorType);
+  return civicrm_api3_create_success($relType, $params, 'PaymentProcessorType', 'create', $paymentProcessorType);
 }
 
 /**
@@ -60,7 +59,7 @@ function civicrm_api3_payment_processor_type_create($params) {
  * The metadata is used for setting defaults, documentation & validation.
  *
  * @param array $params
- *   Array or parameters determined by getfields.
+ *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_payment_processor_type_create_spec(&$params) {
   $params['billing_mode']['api.required'] = 1;
@@ -70,6 +69,7 @@ function _civicrm_api3_payment_processor_type_create_spec(&$params) {
   // FIXME bool support // $params['is_recur']['api.required'] = 1;
   $params['name']['api.required'] = 1;
   $params['title']['api.required'] = 1;
+  $params['payment_instrument_id']['api.default'] = 'Credit Card';
 }
 
 /**
@@ -101,5 +101,5 @@ function civicrm_api3_payment_processor_type_delete($params) {
   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);
+  return civicrm_api3_create_success($result, $params, 'PaymentProcessorType', 'delete', $payProcTypeBAO);
 }