+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
* @param array $params
*
* @return array
- * Array of newly created PaymentProcessor property values.
*/
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);
}
function civicrm_api3_payment_processor_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
+
+
+/**
+ * Set default getlist parameters.
+ *
+ * @see _civicrm_api3_generic_getlist_defaults
+ *
+ * @param array $request
+ *
+ * @return array
+ */
+function _civicrm_api3_payment_processor_getlist_defaults(&$request) {
+ return array(
+ 'description_field' => array(
+ 'payment_processor_type_id',
+ 'description',
+ ),
+ 'params' => array(
+ 'is_test' => 0,
+ 'is_active' => 1,
+ ),
+ );
+}