Avoid CiviCRM running full drupal cache flush, as this results in CiviCRM clobbering...
[civicrm-core.git] / api / v3 / PaymentProcessor.php
index 177b882b11aefc2ac37b6025fceafea1bfe95db0..e7718589d95218664ffe61ceeb18ab084c39f6e3 100644 (file)
  * @param array $params
  *
  * @return array
+ *   API result array
  */
 function civicrm_api3_payment_processor_create($params) {
+  if (empty($params['id']) && empty($params['payment_instrument_id'])) {
+    $params['payment_instrument_id'] = civicrm_api3('PaymentProcessorType', 'getvalue', array(
+      'id' => $params['payment_processor_type_id'],
+      'return' => 'payment_instrument_id',
+    ));
+  }
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
@@ -62,7 +69,7 @@ function _civicrm_api3_payment_processor_create_spec(&$params) {
  * @param array $params
  *
  * @return array
- *   API result Array
+ *   API result array
  */
 function civicrm_api3_payment_processor_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -75,7 +82,7 @@ function civicrm_api3_payment_processor_delete($params) {
  *   Array of name/value pairs.
  *
  * @return array
- *   details of found PaymentProcessor
+ *   API result array
  */
 function civicrm_api3_payment_processor_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);