Merge pull request #17720 from alifrumin/5.27.0-releasenotes
[civicrm-core.git] / CRM / Financial / DAO / PaymentProcessor.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Financial/PaymentProcessor.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:cf330d3d3e18960b1e32a3001d8cd038)
10 */
11
12 /**
13 * Database access object for the PaymentProcessor entity.
14 */
15 class CRM_Financial_DAO_PaymentProcessor extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_payment_processor';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 public static $_log = FALSE;
30
31 /**
32 * Payment Processor ID
33 *
34 * @var int
35 */
36 public $id;
37
38 /**
39 * Which Domain is this match entry for
40 *
41 * @var int
42 */
43 public $domain_id;
44
45 /**
46 * Payment Processor Name.
47 *
48 * @var string
49 */
50 public $name;
51
52 /**
53 * Payment Processor Descriptive Name.
54 *
55 * @var string
56 */
57 public $title;
58
59 /**
60 * Payment Processor Description.
61 *
62 * @var string
63 */
64 public $description;
65
66 /**
67 * @var int
68 */
69 public $payment_processor_type_id;
70
71 /**
72 * Is this processor active?
73 *
74 * @var bool
75 */
76 public $is_active;
77
78 /**
79 * Is this processor the default?
80 *
81 * @var bool
82 */
83 public $is_default;
84
85 /**
86 * Is this processor for a test site?
87 *
88 * @var bool
89 */
90 public $is_test;
91
92 /**
93 * @var string
94 */
95 public $user_name;
96
97 /**
98 * @var string
99 */
100 public $password;
101
102 /**
103 * @var text
104 */
105 public $signature;
106
107 /**
108 * @var string
109 */
110 public $url_site;
111
112 /**
113 * @var string
114 */
115 public $url_api;
116
117 /**
118 * @var string
119 */
120 public $url_recur;
121
122 /**
123 * @var string
124 */
125 public $url_button;
126
127 /**
128 * @var string
129 */
130 public $subject;
131
132 /**
133 * @var string
134 */
135 public $class_name;
136
137 /**
138 * Billing Mode (deprecated)
139 *
140 * @var int
141 */
142 public $billing_mode;
143
144 /**
145 * Can process recurring contributions
146 *
147 * @var bool
148 */
149 public $is_recur;
150
151 /**
152 * Payment Type: Credit or Debit (deprecated)
153 *
154 * @var int
155 */
156 public $payment_type;
157
158 /**
159 * Payment Instrument ID
160 *
161 * @var int
162 */
163 public $payment_instrument_id;
164
165 /**
166 * array of accepted credit card types
167 *
168 * @var text
169 */
170 public $accepted_credit_cards;
171
172 /**
173 * Class constructor.
174 */
175 public function __construct() {
176 $this->__table = 'civicrm_payment_processor';
177 parent::__construct();
178 }
179
180 /**
181 * Returns foreign keys and entity references.
182 *
183 * @return array
184 * [CRM_Core_Reference_Interface]
185 */
186 public static function getReferenceColumns() {
187 if (!isset(Civi::$statics[__CLASS__]['links'])) {
188 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
189 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id');
190 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'payment_processor_type_id', 'civicrm_payment_processor_type', 'id');
191 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
192 }
193 return Civi::$statics[__CLASS__]['links'];
194 }
195
196 /**
197 * Returns all the column names of this table
198 *
199 * @return array
200 */
201 public static function &fields() {
202 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
203 Civi::$statics[__CLASS__]['fields'] = [
204 'id' => [
205 'name' => 'id',
206 'type' => CRM_Utils_Type::T_INT,
207 'title' => ts('Payment Processor ID'),
208 'description' => ts('Payment Processor ID'),
209 'required' => TRUE,
210 'where' => 'civicrm_payment_processor.id',
211 'table_name' => 'civicrm_payment_processor',
212 'entity' => 'PaymentProcessor',
213 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
214 'localizable' => 0,
215 ],
216 'domain_id' => [
217 'name' => 'domain_id',
218 'type' => CRM_Utils_Type::T_INT,
219 'title' => ts('Payment Processor Domain'),
220 'description' => ts('Which Domain is this match entry for'),
221 'required' => TRUE,
222 'where' => 'civicrm_payment_processor.domain_id',
223 'table_name' => 'civicrm_payment_processor',
224 'entity' => 'PaymentProcessor',
225 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
226 'localizable' => 0,
227 'FKClassName' => 'CRM_Core_DAO_Domain',
228 'pseudoconstant' => [
229 'table' => 'civicrm_domain',
230 'keyColumn' => 'id',
231 'labelColumn' => 'name',
232 ],
233 ],
234 'name' => [
235 'name' => 'name',
236 'type' => CRM_Utils_Type::T_STRING,
237 'title' => ts('Payment Processor'),
238 'description' => ts('Payment Processor Name.'),
239 'maxlength' => 64,
240 'size' => CRM_Utils_Type::BIG,
241 'where' => 'civicrm_payment_processor.name',
242 'table_name' => 'civicrm_payment_processor',
243 'entity' => 'PaymentProcessor',
244 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
245 'localizable' => 0,
246 'html' => [
247 'type' => 'Text',
248 ],
249 ],
250 'title' => [
251 'name' => 'title',
252 'type' => CRM_Utils_Type::T_STRING,
253 'title' => ts('Payment Processor Title'),
254 'description' => ts('Payment Processor Descriptive Name.'),
255 'maxlength' => 127,
256 'size' => CRM_Utils_Type::HUGE,
257 'where' => 'civicrm_payment_processor.title',
258 'table_name' => 'civicrm_payment_processor',
259 'entity' => 'PaymentProcessor',
260 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
261 'localizable' => 1,
262 'html' => [
263 'type' => 'Text',
264 ],
265 ],
266 'description' => [
267 'name' => 'description',
268 'type' => CRM_Utils_Type::T_STRING,
269 'title' => ts('Processor Description'),
270 'description' => ts('Payment Processor Description.'),
271 'maxlength' => 255,
272 'size' => CRM_Utils_Type::HUGE,
273 'where' => 'civicrm_payment_processor.description',
274 'table_name' => 'civicrm_payment_processor',
275 'entity' => 'PaymentProcessor',
276 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
277 'localizable' => 0,
278 'html' => [
279 'type' => 'Text',
280 ],
281 ],
282 'payment_processor_type_id' => [
283 'name' => 'payment_processor_type_id',
284 'type' => CRM_Utils_Type::T_INT,
285 'title' => ts('Payment Processor Type ID'),
286 'required' => TRUE,
287 'where' => 'civicrm_payment_processor.payment_processor_type_id',
288 'table_name' => 'civicrm_payment_processor',
289 'entity' => 'PaymentProcessor',
290 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
291 'localizable' => 0,
292 'FKClassName' => 'CRM_Financial_DAO_PaymentProcessorType',
293 'pseudoconstant' => [
294 'table' => 'civicrm_payment_processor_type',
295 'keyColumn' => 'id',
296 'labelColumn' => 'title',
297 ],
298 ],
299 'is_active' => [
300 'name' => 'is_active',
301 'type' => CRM_Utils_Type::T_BOOLEAN,
302 'title' => ts('Processor is Active?'),
303 'description' => ts('Is this processor active?'),
304 'where' => 'civicrm_payment_processor.is_active',
305 'default' => '1',
306 'table_name' => 'civicrm_payment_processor',
307 'entity' => 'PaymentProcessor',
308 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
309 'localizable' => 0,
310 ],
311 'is_default' => [
312 'name' => 'is_default',
313 'type' => CRM_Utils_Type::T_BOOLEAN,
314 'title' => ts('Processor Is Default?'),
315 'description' => ts('Is this processor the default?'),
316 'where' => 'civicrm_payment_processor.is_default',
317 'default' => '0',
318 'table_name' => 'civicrm_payment_processor',
319 'entity' => 'PaymentProcessor',
320 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
321 'localizable' => 0,
322 ],
323 'is_test' => [
324 'name' => 'is_test',
325 'type' => CRM_Utils_Type::T_BOOLEAN,
326 'title' => ts('Is Test Processor?'),
327 'description' => ts('Is this processor for a test site?'),
328 'where' => 'civicrm_payment_processor.is_test',
329 'default' => '0',
330 'table_name' => 'civicrm_payment_processor',
331 'entity' => 'PaymentProcessor',
332 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
333 'localizable' => 0,
334 ],
335 'user_name' => [
336 'name' => 'user_name',
337 'type' => CRM_Utils_Type::T_STRING,
338 'title' => ts('User Name'),
339 'maxlength' => 255,
340 'size' => CRM_Utils_Type::HUGE,
341 'where' => 'civicrm_payment_processor.user_name',
342 'table_name' => 'civicrm_payment_processor',
343 'entity' => 'PaymentProcessor',
344 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
345 'localizable' => 0,
346 'html' => [
347 'type' => 'Text',
348 ],
349 ],
350 'password' => [
351 'name' => 'password',
352 'type' => CRM_Utils_Type::T_STRING,
353 'title' => ts('Password'),
354 'maxlength' => 255,
355 'size' => CRM_Utils_Type::HUGE,
356 'where' => 'civicrm_payment_processor.password',
357 'table_name' => 'civicrm_payment_processor',
358 'entity' => 'PaymentProcessor',
359 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
360 'localizable' => 0,
361 'html' => [
362 'type' => 'Password',
363 ],
364 ],
365 'signature' => [
366 'name' => 'signature',
367 'type' => CRM_Utils_Type::T_TEXT,
368 'title' => ts('Signature'),
369 'rows' => 4,
370 'cols' => 40,
371 'where' => 'civicrm_payment_processor.signature',
372 'table_name' => 'civicrm_payment_processor',
373 'entity' => 'PaymentProcessor',
374 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
375 'localizable' => 0,
376 'html' => [
377 'type' => 'TextArea',
378 ],
379 ],
380 'url_site' => [
381 'name' => 'url_site',
382 'type' => CRM_Utils_Type::T_STRING,
383 'title' => ts('Site URL'),
384 'maxlength' => 255,
385 'size' => CRM_Utils_Type::HUGE,
386 'where' => 'civicrm_payment_processor.url_site',
387 'table_name' => 'civicrm_payment_processor',
388 'entity' => 'PaymentProcessor',
389 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
390 'localizable' => 0,
391 'html' => [
392 'type' => 'Text',
393 ],
394 ],
395 'url_api' => [
396 'name' => 'url_api',
397 'type' => CRM_Utils_Type::T_STRING,
398 'title' => ts('API URL'),
399 'maxlength' => 255,
400 'size' => CRM_Utils_Type::HUGE,
401 'where' => 'civicrm_payment_processor.url_api',
402 'table_name' => 'civicrm_payment_processor',
403 'entity' => 'PaymentProcessor',
404 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
405 'localizable' => 0,
406 'html' => [
407 'type' => 'Text',
408 ],
409 ],
410 'url_recur' => [
411 'name' => 'url_recur',
412 'type' => CRM_Utils_Type::T_STRING,
413 'title' => ts('Recurring Payments URL'),
414 'maxlength' => 255,
415 'size' => CRM_Utils_Type::HUGE,
416 'where' => 'civicrm_payment_processor.url_recur',
417 'table_name' => 'civicrm_payment_processor',
418 'entity' => 'PaymentProcessor',
419 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
420 'localizable' => 0,
421 'html' => [
422 'type' => 'Text',
423 ],
424 ],
425 'url_button' => [
426 'name' => 'url_button',
427 'type' => CRM_Utils_Type::T_STRING,
428 'title' => ts('Button URL'),
429 'maxlength' => 255,
430 'size' => CRM_Utils_Type::HUGE,
431 'where' => 'civicrm_payment_processor.url_button',
432 'table_name' => 'civicrm_payment_processor',
433 'entity' => 'PaymentProcessor',
434 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
435 'localizable' => 0,
436 'html' => [
437 'type' => 'Text',
438 ],
439 ],
440 'subject' => [
441 'name' => 'subject',
442 'type' => CRM_Utils_Type::T_STRING,
443 'title' => ts('Subject'),
444 'maxlength' => 255,
445 'size' => CRM_Utils_Type::HUGE,
446 'where' => 'civicrm_payment_processor.subject',
447 'table_name' => 'civicrm_payment_processor',
448 'entity' => 'PaymentProcessor',
449 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
450 'localizable' => 0,
451 'html' => [
452 'type' => 'Text',
453 ],
454 ],
455 'class_name' => [
456 'name' => 'class_name',
457 'type' => CRM_Utils_Type::T_STRING,
458 'title' => ts('Suffix for PHP class name implementation'),
459 'maxlength' => 255,
460 'size' => CRM_Utils_Type::HUGE,
461 'where' => 'civicrm_payment_processor.class_name',
462 'table_name' => 'civicrm_payment_processor',
463 'entity' => 'PaymentProcessor',
464 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
465 'localizable' => 0,
466 ],
467 'billing_mode' => [
468 'name' => 'billing_mode',
469 'type' => CRM_Utils_Type::T_INT,
470 'title' => ts('Processor Billing Mode'),
471 'description' => ts('Billing Mode (deprecated)'),
472 'required' => TRUE,
473 'where' => 'civicrm_payment_processor.billing_mode',
474 'table_name' => 'civicrm_payment_processor',
475 'entity' => 'PaymentProcessor',
476 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
477 'localizable' => 0,
478 ],
479 'is_recur' => [
480 'name' => 'is_recur',
481 'type' => CRM_Utils_Type::T_BOOLEAN,
482 'title' => ts('Processor Supports Recurring?'),
483 'description' => ts('Can process recurring contributions'),
484 'where' => 'civicrm_payment_processor.is_recur',
485 'table_name' => 'civicrm_payment_processor',
486 'entity' => 'PaymentProcessor',
487 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
488 'localizable' => 0,
489 ],
490 'payment_type' => [
491 'name' => 'payment_type',
492 'type' => CRM_Utils_Type::T_INT,
493 'title' => ts('Payment Type'),
494 'description' => ts('Payment Type: Credit or Debit (deprecated)'),
495 'where' => 'civicrm_payment_processor.payment_type',
496 'default' => '1',
497 'table_name' => 'civicrm_payment_processor',
498 'entity' => 'PaymentProcessor',
499 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
500 'localizable' => 0,
501 ],
502 'payment_instrument_id' => [
503 'name' => 'payment_instrument_id',
504 'type' => CRM_Utils_Type::T_INT,
505 'title' => ts('Payment Method'),
506 'description' => ts('Payment Instrument ID'),
507 'where' => 'civicrm_payment_processor.payment_instrument_id',
508 'default' => '1',
509 'table_name' => 'civicrm_payment_processor',
510 'entity' => 'PaymentProcessor',
511 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
512 'localizable' => 0,
513 'pseudoconstant' => [
514 'optionGroupName' => 'payment_instrument',
515 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
516 ],
517 ],
518 'accepted_credit_cards' => [
519 'name' => 'accepted_credit_cards',
520 'type' => CRM_Utils_Type::T_TEXT,
521 'title' => ts('Accepted Credit Cards'),
522 'description' => ts('array of accepted credit card types'),
523 'where' => 'civicrm_payment_processor.accepted_credit_cards',
524 'default' => 'NULL',
525 'table_name' => 'civicrm_payment_processor',
526 'entity' => 'PaymentProcessor',
527 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
528 'localizable' => 0,
529 'serialize' => self::SERIALIZE_JSON,
530 ],
531 ];
532 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
533 }
534 return Civi::$statics[__CLASS__]['fields'];
535 }
536
537 /**
538 * Return a mapping from field-name to the corresponding key (as used in fields()).
539 *
540 * @return array
541 * Array(string $name => string $uniqueName).
542 */
543 public static function &fieldKeys() {
544 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
545 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
546 }
547 return Civi::$statics[__CLASS__]['fieldKeys'];
548 }
549
550 /**
551 * Returns the names of this table
552 *
553 * @return string
554 */
555 public static function getTableName() {
556 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
557 }
558
559 /**
560 * Returns if this table needs to be logged
561 *
562 * @return bool
563 */
564 public function getLog() {
565 return self::$_log;
566 }
567
568 /**
569 * Returns the list of fields that can be imported
570 *
571 * @param bool $prefix
572 *
573 * @return array
574 */
575 public static function &import($prefix = FALSE) {
576 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'payment_processor', $prefix, []);
577 return $r;
578 }
579
580 /**
581 * Returns the list of fields that can be exported
582 *
583 * @param bool $prefix
584 *
585 * @return array
586 */
587 public static function &export($prefix = FALSE) {
588 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'payment_processor', $prefix, []);
589 return $r;
590 }
591
592 /**
593 * Returns the list of indices
594 *
595 * @param bool $localize
596 *
597 * @return array
598 */
599 public static function indices($localize = TRUE) {
600 $indices = [
601 'UI_name_test_domain_id' => [
602 'name' => 'UI_name_test_domain_id',
603 'field' => [
604 0 => 'name',
605 1 => 'is_test',
606 2 => 'domain_id',
607 ],
608 'localizable' => FALSE,
609 'unique' => TRUE,
610 'sig' => 'civicrm_payment_processor::1::name::is_test::domain_id',
611 ],
612 ];
613 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
614 }
615
616 }