3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * This api exposes CiviCRM Payment Token records.
15 * @note Contribute component must be enabled.
17 * @package CiviCRM_APIv3
21 * Create/update Payment Token.
23 * This API is used to create new campaign or update any of the existing
24 * In case of updating existing campaign, id of that particular campaign must
25 * be in $params array.
27 * @param array $params
31 function civicrm_api3_payment_token_create($params) {
32 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'PaymentToken');
36 * Adjust Metadata for Create action.
38 * The metadata is used for setting defaults, documentation & validation.
40 * @param array $params
41 * Array of parameters determined by getfields.
43 function _civicrm_api3_payment_token_create_spec(&$params) {
44 $params['token']['api.required'] = 1;
45 $params['contact_id']['api.required'] = 1;
46 $params['payment_processor_id']['api.required'] = 1;
47 $params['created_id']['api.default'] = 'user_contact_id';
48 $params['created_date']['api.default'] = 'now';
52 * Returns array of campaigns matching a set of one or more properties.
54 * @param array $params
58 * Array of matching campaigns
60 function civicrm_api3_payment_token_get($params) {
61 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__
), $params, TRUE, 'PaymentToken');
65 * Delete an existing payment token.
67 * This method is used to delete any existing payment token.
68 * Id of the payment token to be deleted is required field in $params array
70 * @param array $params
71 * array containing id of the group to be deleted
75 function civicrm_api3_payment_token_delete($params) {
76 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__
), $params);