Completed
Branch master (fb79b8)
by
unknown
05:33
created
admin_pages/registration_form/Registration_Form_Admin_Page.core.php 2 patches
Indentation   +746 added lines, -746 removed lines patch added patch discarded remove patch
@@ -17,697 +17,697 @@  discard block
 block discarded – undo
17 17
  */
18 18
 class Registration_Form_Admin_Page extends EE_Admin_Page
19 19
 {
20
-    /**
21
-     * holds the specific question object for the question details screen
22
-     */
23
-    protected ?EE_Question $_question = null;
24
-
25
-    /**
26
-     * holds the specific question group object for the question group details screen
27
-     */
28
-    protected ?EE_Question_Group $_question_group = null;
29
-
30
-    protected EEM_Question $_question_model;
31
-
32
-    protected EEM_Question_Group $_question_group_model;
33
-
34
-
35
-    /**
36
-     * @Constructor
37
-     * @param bool $routing indicate whether we want to just load the object and handle routing or just load the object.
38
-     * @throws EE_Error
39
-     * @throws ReflectionException
40
-     */
41
-    public function __construct($routing = true)
42
-    {
43
-        require_once(EE_MODELS . 'EEM_Question.model.php');
44
-        require_once(EE_MODELS . 'EEM_Question_Group.model.php');
45
-        $this->_question_model       = EEM_Question::instance();
46
-        $this->_question_group_model = EEM_Question_Group::instance();
47
-        parent::__construct($routing);
48
-    }
49
-
50
-
51
-    protected function _init_page_props()
52
-    {
53
-        $this->page_slug        = REGISTRATION_FORM_PG_SLUG;
54
-        $this->page_label       = esc_html__('Registration Form', 'event_espresso');
55
-        $this->_admin_base_url  = REGISTRATION_FORM_ADMIN_URL;
56
-        $this->_admin_base_path = REGISTRATION_FORM_ADMIN;
57
-    }
58
-
59
-
60
-    protected function _ajax_hooks()
61
-    {
62
-    }
63
-
64
-
65
-    protected function _define_page_props()
66
-    {
67
-        $this->_admin_page_title = esc_html__('Registration Form', 'event_espresso');
68
-        $this->_labels           = [
69
-            'buttons'    => [
70
-                'edit_question' => esc_html__('Edit Question', 'event_espresso'),
71
-            ],
72
-            'publishbox' => [
73
-                'edit_question' => esc_html__('Edit Question', 'event_espresso'),
74
-            ],
75
-        ];
76
-    }
77
-
78
-
79
-    /**
80
-     *_set_page_routes
81
-     */
82
-    protected function _set_page_routes()
83
-    {
84
-        $qst_id             =
85
-            ! empty($this->_req_data['QST_ID'])
86
-                ? $this->_req_data['QST_ID']
87
-                : 0;
88
-        $this->_page_routes = [
89
-            'default' => [
90
-                'func'       => [$this, '_questions_overview_list_table'],
91
-                'capability' => 'ee_read_questions',
92
-            ],
93
-
94
-            'edit_question' => [
95
-                'func'       => [$this, '_edit_question'],
96
-                'capability' => 'ee_edit_question',
97
-                'obj_id'     => $qst_id,
98
-                'args'       => ['edit'],
99
-            ],
100
-
101
-            'question_groups' => [
102
-                'func'       => [$this, '_questions_groups_preview'],
103
-                'capability' => 'ee_read_question_groups',
104
-            ],
105
-
106
-            'update_question' => [
107
-                'func'       => [$this, '_insert_or_update_question'],
108
-                'args'       => ['new_question' => false],
109
-                'capability' => 'ee_edit_question',
110
-                'obj_id'     => $qst_id,
111
-                'noheader'   => true,
112
-            ],
113
-        ];
114
-    }
115
-
116
-
117
-    protected function _set_page_config()
118
-    {
119
-        $this->_page_config = [
120
-            'default' => [
121
-                'nav'           => [
122
-                    'label' => esc_html__('Questions', 'event_espresso'),
123
-                    'icon'  => 'dashicons-editor-help',
124
-                    'order' => 10,
125
-                ],
126
-                'list_table'    => 'Registration_Form_Questions_Admin_List_Table',
127
-                'metaboxes'     => $this->_default_espresso_metaboxes,
128
-                'help_tabs'     => [
129
-                    'registration_form_questions_overview_help_tab'                           => [
130
-                        'title'    => esc_html__('Questions Overview', 'event_espresso'),
131
-                        'filename' => 'registration_form_questions_overview',
132
-                    ],
133
-                    'registration_form_questions_overview_table_column_headings_help_tab'     => [
134
-                        'title'    => esc_html__('Questions Overview Table Column Headings', 'event_espresso'),
135
-                        'filename' => 'registration_form_questions_overview_table_column_headings',
136
-                    ],
137
-                    'registration_form_questions_overview_views_bulk_actions_search_help_tab' => [
138
-                        'title'    => esc_html__('Question Overview Views & Bulk Actions & Search', 'event_espresso'),
139
-                        'filename' => 'registration_form_questions_overview_views_bulk_actions_search',
140
-                    ],
141
-                ],
142
-                'require_nonce' => false,
143
-            ],
144
-
145
-            'question_groups' => [
146
-                'nav'           => [
147
-                    'label' => esc_html__('Question Groups', 'event_espresso'),
148
-                    'icon'  => 'dashicons-forms',
149
-                    'order' => 20,
150
-                ],
151
-                'metaboxes'     => $this->_default_espresso_metaboxes,
152
-                'help_tabs'     => [
153
-                    'registration_form_question_groups_help_tab' => [
154
-                        'title'    => esc_html__('Question Groups', 'event_espresso'),
155
-                        'filename' => 'registration_form_question_groups',
156
-                    ],
157
-                ],
158
-                'require_nonce' => false,
159
-            ],
160
-
161
-            'edit_question' => [
162
-                'nav'           => [
163
-                    'label'      => esc_html__('Edit Question', 'event_espresso'),
164
-                    'icon'       => 'dashicons-edit-large',
165
-                    'order'      => 15,
166
-                    'persistent' => false,
167
-                    'url'        => isset($this->_req_data['question_id'])
168
-                        ? add_query_arg(
169
-                            ['question_id' => $this->_req_data['question_id']],
170
-                            $this->_current_page_view_url
171
-                        )
172
-                        : $this->_admin_base_url,
173
-                ],
174
-                'metaboxes'     => array_merge($this->_default_espresso_metaboxes, ['_publish_post_box']),
175
-                'help_tabs'     => [
176
-                    'registration_form_edit_question_group_help_tab' => [
177
-                        'title'    => esc_html__('Edit Question', 'event_espresso'),
178
-                        'filename' => 'registration_form_edit_question',
179
-                    ],
180
-                ],
181
-                'require_nonce' => false,
182
-            ],
183
-        ];
184
-    }
185
-
186
-
187
-    protected function _add_screen_options()
188
-    {
189
-        // todo
190
-    }
191
-
192
-
193
-    protected function _add_screen_options_default()
194
-    {
195
-        $page_title              = $this->_admin_page_title;
196
-        $this->_admin_page_title = esc_html__('Questions', 'event_espresso');
197
-        $this->_per_page_screen_option();
198
-        $this->_admin_page_title = $page_title;
199
-    }
200
-
201
-
202
-    protected function _add_screen_options_question_groups()
203
-    {
204
-        $page_title              = $this->_admin_page_title;
205
-        $this->_admin_page_title = esc_html__('Question Groups', 'event_espresso');
206
-        $this->_per_page_screen_option();
207
-        $this->_admin_page_title = $page_title;
208
-    }
209
-
210
-
211
-    // none of the below group are currently used for Event Categories
212
-    protected function _add_feature_pointers()
213
-    {
214
-    }
215
-
216
-
217
-    public function load_scripts_styles()
218
-    {
219
-        wp_register_style(
220
-            'espresso_registration',
221
-            REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.css',
222
-            [EspressoLegacyAdminAssetManager::CSS_HANDLE_EE_ADMIN],
223
-            EVENT_ESPRESSO_VERSION
224
-        );
225
-        wp_enqueue_style('espresso_registration');
226
-    }
227
-
228
-
229
-    public function admin_init()
230
-    {
231
-    }
232
-
233
-
234
-    public function admin_notices()
235
-    {
236
-    }
237
-
238
-
239
-    public function admin_footer_scripts()
240
-    {
241
-    }
242
-
243
-
244
-    public function load_scripts_styles_default()
245
-    {
246
-    }
247
-
248
-
249
-    public function load_scripts_styles_add_question()
250
-    {
251
-        $this->load_scripts_styles_question_details();
252
-    }
253
-
254
-
255
-    public function load_scripts_styles_edit_question()
256
-    {
257
-        $this->load_scripts_styles_question_details();
258
-    }
259
-
260
-
261
-    /**
262
-     * Loads the JS required for adding or editing a question
263
-     */
264
-    protected function load_scripts_styles_question_details()
265
-    {
266
-        $this->load_scripts_styles_forms();
267
-        wp_register_script(
268
-            'espresso_registration_form_single',
269
-            REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.js',
270
-            ['jquery-ui-sortable'],
271
-            EVENT_ESPRESSO_VERSION,
272
-            true
273
-        );
274
-        wp_enqueue_script('espresso_registration_form_single');
275
-        wp_localize_script(
276
-            'espresso_registration_form_single',
277
-            'ee_question_data',
278
-            [
279
-                'question_types_with_max'    => $this->_question_model->questionTypesWithMaxLength(),
280
-                'question_type_with_options' => $this->_question_model->question_types_with_options(),
281
-            ]
282
-        );
283
-    }
284
-
285
-
286
-    public function recaptcha_info_help_tab()
287
-    {
288
-        EEH_Template::display_template(REGISTRATION_FORM_TEMPLATE_PATH . 'recaptcha_info_help_tab.template.php');
289
-    }
290
-
291
-
292
-    public function load_scripts_styles_forms()
293
-    {
294
-        // styles
295
-        wp_enqueue_style('espresso-ui-theme');
296
-        // scripts
297
-        wp_enqueue_script('ee_admin_js');
298
-    }
299
-
300
-
301
-    protected function _set_list_table_views_default()
302
-    {
303
-        $this->_views = [
304
-            'all' => [
305
-                'slug'  => 'all',
306
-                'label' => esc_html__('View All Questions', 'event_espresso'),
307
-                'count' => 0,
308
-            ],
309
-        ];
310
-
311
-        if (
312
-            $this->capabilities->current_user_can(
313
-                'ee_delete_questions',
314
-                'espresso_registration_form_trash_questions'
315
-            )
316
-        ) {
317
-            $this->_views['trash'] = [
318
-                'slug'  => 'trash',
319
-                'label' => esc_html__('Trash', 'event_espresso'),
320
-                'count' => 0,
321
-            ];
322
-        }
323
-    }
324
-
325
-
326
-    /**
327
-     * This just previews the question groups tab that comes in caffeinated.
328
-     *
329
-     * @return void html
330
-     * @throws EE_Error
331
-     */
332
-    protected function _questions_groups_preview()
333
-    {
334
-        $this->_admin_page_title              = esc_html__('Question Groups (Preview)', 'event_espresso');
335
-        $this->_template_args['preview_img']  =
336
-            '<img src="' . REGISTRATION_FORM_ASSETS_URL . 'caf_reg_form_preview.jpg" alt="'
337
-            . esc_attr__(
338
-                'Preview Question Groups Overview List Table screenshot',
339
-                'event_espresso'
340
-            ) . '" />';
341
-        $this->_template_args['preview_text'] = '<strong>'
342
-            . esc_html__(
343
-                'Question Groups is a feature that is only available in the premium version of Event Espresso 4 which is available with a support license purchase on EventEspresso.com. With the Question Groups feature you are able to create new question groups, edit existing question groups, and create and edit new questions and add them to question groups.',
344
-                'event_espresso'
345
-            ) . '</strong>';
346
-        $this->display_admin_caf_preview_page('question_groups_tab');
347
-    }
348
-
349
-
350
-    /**
351
-     * Extracts the question field's values from the POST request to update or insert them
352
-     *
353
-     * @param EEM_Base $model
354
-     * @return array where each key is the name of a model's field/db column, and each value is its value.
355
-     * @throws EE_Error
356
-     * @throws ReflectionException
357
-     */
358
-    protected function _set_column_values_for(EEM_Base $model): array
359
-    {
360
-        $column_values = [];
361
-        // some initial checks for proper values.
362
-        $QST_ID = $this->request->getRequestParam('QST_ID', 0, DataType::INT);
363
-        // if QST_admin_only, then no matter what QST_required is we disable.
364
-        $QST_admin_only = $this->request->getRequestParam('QST_admin_only', false, DataType::BOOL);
365
-        if ($QST_admin_only) {
366
-            $this->request->setRequestParam('QST_required', false);
367
-        }
368
-        // if the question shouldn't have a max length, don't let them set one
369
-        if (
370
-            ! (
371
-                $this->request->requestParamIsSet('QST_type')
372
-                && $this->request->requestParamIsSet('QST_max')
373
-            ) || ! in_array(
374
-                $this->request->getRequestParam('QST_type', '', DataType::STRING),
375
-                $this->_question_model->questionTypesWithMaxLength(),
376
-                true
377
-            )
378
-        ) {
379
-            // they're not allowed to set the max
380
-            $this->request->unSetRequestParam('QST_max', true);
381
-        }
382
-        foreach ($model->field_settings() as $fieldName => $settings) {
383
-            switch($fieldName) {
384
-                case 'QSG_identifier':
385
-                    // basically if QSG_identifier is empty or not set
386
-                    if (! $this->request->getRequestParam('QSG_identifier', '', DataType::STRING)) {
387
-                        $QSG_name                    = $this->request->getRequestParam('QSG_name', '', DataType::STRING);
388
-                        $column_values[ $fieldName ] = sanitize_title($QSG_name) . '-' . uniqid('', true);
389
-                    }
390
-                    break;
391
-
392
-                case 'QST_display_text':
393
-                        $column_values[ $fieldName ] = $this->request->getRequestParam('QST_display_text', '', DataType::HTML);
394
-                    break;
395
-
396
-                case 'QST_admin_label':
397
-                    if (! $this->request->getRequestParam('QST_admin_label', '', DataType::STRING)) {
398
-                        // the admin label is blank, use a slug version of the question text
399
-                        $QST_text                    = $this->request->getRequestParam('QST_display_text', '', DataType::STRING);
400
-                        $column_values[ $fieldName ] = sanitize_title(wp_trim_words($QST_text, 10));
401
-                    } else {
402
-                        // admin label set, use it
403
-                        $column_values[ $fieldName ] = $this->request->getRequestParam('QST_admin_label', '', DataType::STRING);
404
-                    }
405
-                    break;
406
-
407
-                case 'QST_admin_only':
408
-                    $column_values[ $fieldName ] = $QST_admin_only;
409
-                    break;
410
-
411
-                case 'QST_max':
412
-                    $qst_system = $this->_question_model->get_var(
413
-                        [ [ 'QST_ID' => $QST_ID ] ],
414
-                        'QST_system'
415
-                    );
416
-
417
-                    $max_max = $this->_question_model->absolute_max_for_system_question((string) $qst_system);
418
-                    $QST_max = $this->request->getRequestParam('QST_max', 0, DataType::INT);
419
-                    if ($QST_max === 0 || $QST_max > $max_max) {
420
-                        $column_values[ $fieldName ] = $max_max;
421
-                    }
422
-                    break;
423
-
424
-                default:
425
-                    // only add a property to the array if it's not null (otherwise the model should just use the default value)
426
-                    if ($this->request->requestParamIsSet($fieldName)) {
427
-                        // convert the schema type to the appropriate data type
428
-                        $schema_type = DataType::convertModelFieldSchemaType($settings->getSchemaType());
429
-                        $column_values[ $fieldName ] = $this->request->getRequestParam($fieldName, null, $schema_type);
430
-                    }
431
-            }
432
-        }
433
-        // validation for this data to be performed by the model before insertion.
434
-        return $column_values;
435
-    }
436
-
437
-
438
-    /**
439
-     *_questions_overview_list_table
440
-     *
441
-     * @throws EE_Error
442
-     */
443
-    protected function _questions_overview_list_table()
444
-    {
445
-        $this->_search_btn_label = esc_html__('Questions', 'event_espresso');
446
-        $this->display_admin_list_table_page_with_sidebar();
447
-    }
448
-
449
-
450
-    /**
451
-     * _edit_question
452
-     *
453
-     * @throws EE_Error
454
-     * @throws ReflectionException
455
-     */
456
-    protected function _edit_question()
457
-    {
458
-        $ID = isset($this->_req_data['QST_ID']) && ! empty($this->_req_data['QST_ID'])
459
-            ? absint($this->_req_data['QST_ID'])
460
-            : false;
461
-
462
-        switch ($this->_req_action) {
463
-            case 'add_question':
464
-                $this->_admin_page_title = esc_html__('Add Question', 'event_espresso');
465
-                break;
466
-            case 'edit_question':
467
-                $this->_admin_page_title = esc_html__('Edit Question', 'event_espresso');
468
-                break;
469
-            default:
470
-                $this->_admin_page_title = ucwords(str_replace('_', ' ', $this->_req_action));
471
-        }
472
-
473
-        // add PRC_ID to title if editing
474
-        $this->_admin_page_title =
475
-            $ID
476
-                ? $this->_admin_page_title . ' # ' . $ID
477
-                : $this->_admin_page_title;
478
-        if ($ID) {
479
-            $question                 = $this->_question_model->get_one_by_ID($ID);
480
-            $additional_hidden_fields = ['QST_ID' => ['type' => 'hidden', 'value' => $ID]];
481
-            $this->_set_add_edit_form_tags('update_question', $additional_hidden_fields);
482
-        } else {
483
-            $question = EE_Question::new_instance();
484
-            $question->set_order_to_latest();
485
-            $this->_set_add_edit_form_tags('insert_question');
486
-        }
487
-        if ($question->system_ID() === EEM_Attendee::system_question_phone) {
488
-            $question_types = array_intersect_key(
489
-                $this->_question_model->allowed_question_types(),
490
-                array_flip(
491
-                    [
492
-                        EEM_Question::QST_type_text,
493
-                        EEM_Question::QST_type_us_phone,
494
-                    ]
495
-                )
496
-            );
497
-        } else {
498
-            $question_types = $question->has_answers()
499
-                ? $this->_question_model->question_types_in_same_category($question->type())
500
-                : $this->_question_model->allowed_question_types();
501
-        }
502
-        $this->_template_args['QST_ID']                     = $ID;
503
-        $this->_template_args['question']                   = $question;
504
-        $this->_template_args['question_types']             = $question_types;
505
-        $this->_template_args['max_max']                    =
506
-            $this->_question_model->absolute_max_for_system_question(
507
-                $question->system_ID()
508
-            );
509
-        $this->_template_args['question_type_descriptions'] = $this->_get_question_type_descriptions();
510
-        $this->_set_publish_post_box_vars('id', $ID);
511
-        $this->_template_args['admin_page_content'] = EEH_Template::display_template(
512
-            REGISTRATION_FORM_TEMPLATE_PATH . 'questions_main_meta_box.template.php',
513
-            $this->_template_args,
514
-            true
515
-        );
516
-
517
-        // the details template wrapper
518
-        $this->display_admin_page_with_sidebar();
519
-    }
520
-
521
-
522
-    /**
523
-     * @return string
524
-     * @throws EE_Error
525
-     * @throws ReflectionException
526
-     */
527
-    protected function _get_question_type_descriptions(): string
528
-    {
529
-        EE_Registry::instance()->load_helper('HTML');
530
-        $descriptions               = '';
531
-        $question_type_descriptions = $this->_question_model->question_descriptions();
532
-        foreach ($question_type_descriptions as $type => $question_type_description) {
533
-            if ($type == 'HTML_TEXTAREA') {
534
-                $html                      = new EE_Simple_HTML_Validation_Strategy();
535
-                $question_type_description .= sprintf(
536
-                    esc_html__('%1$s(allowed tags: %2$s)', 'event_espresso'),
537
-                    '<br/>',
538
-                    $html->get_list_of_allowed_tags()
539
-                );
540
-            }
541
-            $descriptions .= EEH_HTML::p(
542
-                $question_type_description,
543
-                'question_type_description-' . $type,
544
-                'question_type_description description',
545
-                'display:none;'
546
-            );
547
-        }
548
-        return $descriptions;
549
-    }
550
-
551
-
552
-    /**
553
-     * @param bool $new_question
554
-     * @throws EE_Error
555
-     * @throws ReflectionException
556
-     */
557
-    protected function _insert_or_update_question(bool $new_question = true)
558
-    {
559
-        $set_column_values = $this->_set_column_values_for($this->_question_model);
560
-        if ($new_question) {
561
-            $question    = EE_Question::new_instance($set_column_values);
562
-            $action_desc = 'added';
563
-        } else {
564
-            $question = $this->_question_model->get_one_by_ID(
565
-                $this->request->getRequestParam('QST_ID', 0, DataType::INT)
566
-            );
567
-            foreach ($set_column_values as $field => $new_value) {
568
-                $question->set($field, $new_value);
569
-            }
570
-            $action_desc = 'updated';
571
-        }
572
-        $success = $question->save();
573
-        $ID      = $question->ID();
574
-        if ($ID && $question->should_have_question_options()) {
575
-            // save the related options
576
-            // trash removed options, save old ones
577
-            // get list of all options
578
-            $options          = $question->options();
579
-            $question_options = $this->request->getRequestParam('question_options', [], DataType::HTML, true);
580
-            $QSO_default      = $this->request->getRequestParam('QSO_default', null, DataType::INT);
581
-            if (! empty($options)) {
582
-                foreach ($options as $option_ID => $option) {
583
-                    $option_req_index = $this->_get_option_req_data_index($option_ID);
584
-                    if ($option_req_index !== false) {
585
-                        $question_options[ $option_req_index ]['QSO_default'] = $option_req_index === $QSO_default;
586
-                        $option->save($question_options[ $option_req_index ]);
587
-                    } else {
588
-                        // not found, remove it
589
-                        $option->delete();
590
-                    }
591
-                }
592
-            }
593
-            // save new related options
594
-            foreach ($question_options as $index => $option_req_data) {
595
-                // skip $index that is from our sample
596
-                if ($index === 'xxcountxx') {
597
-                    continue;
598
-                }
599
-                // note we allow saving blank options.
600
-                if (empty($option_req_data['QSO_ID'])) {
601
-                    // no ID! save it!
602
-                    $new_option = EE_Question_Option::new_instance(
603
-                        [
604
-                            'QSO_value'   => $option_req_data['QSO_value'],
605
-                            'QSO_desc'    => $option_req_data['QSO_desc'],
606
-                            'QSO_default' => $index === $QSO_default,
607
-                            'QSO_order'   => $option_req_data['QSO_order'],
608
-                            'QST_ID'      => $question->ID(),
609
-                        ]
610
-                    );
611
-                    $new_option->save();
612
-                }
613
-            }
614
-        }
615
-
616
-        $success = apply_filters(
617
-            'FHEE__Registration_Form_Admin_Page___insert_or_update_question__success',
618
-            (int) $success,
619
-            $question,
620
-            $this
621
-        );
622
-
623
-        $query_args = ['action' => 'edit_question', 'QST_ID' => $ID];
624
-        if ($success !== 0) {
625
-            $msg = $new_question
626
-                ? sprintf(
627
-                    esc_html__('The %s has been created', 'event_espresso'),
628
-                    $this->_question_model->item_name()
629
-                )
630
-                : sprintf(
631
-                    esc_html__('The %s has been updated', 'event_espresso'),
632
-                    $this->_question_model->item_name()
633
-                );
634
-            EE_Error::add_success($msg);
635
-        }
636
-
637
-        $this->_redirect_after_action(false, '', $action_desc, $query_args, true);
638
-    }
639
-
640
-
641
-    /**
642
-     * Upon saving a question, there should be an array of 'question_options'. This array is index numerically, but not
643
-     * by ID
644
-     * (this is done because new question options don't have an ID, but we may want to add multiple simultaneously).
645
-     * So, this function gets the index in that request data array called question_options. Returns FALSE if not found.
646
-     *
647
-     * @param int $ID of the question option to find
648
-     * @return int index in question_options array if successful, FALSE if unsuccessful
649
-     */
650
-    protected function _get_option_req_data_index(int $ID)
651
-    {
652
-        $req_data_for_question_options = $this->_req_data['question_options'];
653
-        foreach ($req_data_for_question_options as $num => $option_data) {
654
-            if (array_key_exists('QSO_ID', $option_data) && (int) $option_data['QSO_ID'] === $ID) {
655
-                return $num;
656
-            }
657
-        }
658
-        return false;
659
-    }
660
-
661
-
662
-
663
-
664
-    /* QUERIES */
665
-    /**
666
-     * For internal use in getting all the query parameters
667
-     * (because it's pretty well the same between question, question groups,
668
-     * and for both when searching for trashed and untrashed ones)
669
-     *
670
-     * @param EEM_Base $model either EEM_Question or EEM_Question_Group
671
-     * @param int      $per_page
672
-     * @param int      $current_page
673
-     * @return array model query params,
674
-     * @see https://github.com/eventespresso/event-espresso-core/tree/master/docs/G--Model-System/model-query-params.md
675
-     */
676
-    protected function get_query_params(EEM_Base $model, int $per_page = 10, int $current_page = 10): array
677
-    {
678
-        $query_params             = [];
679
-        $offset                   = ($current_page - 1) * $per_page;
680
-        $query_params['limit']    = [$offset, $per_page];
681
-
682
-        $order  = (isset($this->_req_data['order']) && ! empty($this->_req_data['order']))
683
-            ? $this->_req_data['order']
684
-            : 'ASC';
685
-
686
-        $orderby_field = $model instanceof EEM_Question ? 'QST_ID' : 'QSG_order';
687
-
688
-        $field_to_order_by = empty($this->_req_data['orderby']) ? $orderby_field : $this->_req_data['orderby'];
689
-
690
-        $query_params['order_by'] = [$field_to_order_by => $order];
691
-
692
-        $search_string = array_key_exists('s', $this->_req_data) ? $this->_req_data['s'] : null;
693
-        if (! empty($search_string)) {
694
-            if ($model instanceof EEM_Question_Group) {
695
-                $query_params[0] = [
696
-                    'OR' => [
697
-                        'QSG_name' => ['LIKE', "%$search_string%"],
698
-                        'QSG_desc' => ['LIKE', "%$search_string%"],
699
-                    ],
700
-                ];
701
-            } else {
702
-                $query_params[0] = [
703
-                    'QST_display_text' => ['LIKE', "%$search_string%"],
704
-                ];
705
-            }
706
-        }
707
-
708
-        // capability checks (just leaving this commented out for reference because
709
-        // it illustrates some complicated query params that could be useful when fully implemented)
710
-        /*if ( $model instanceof EEM_Question_Group ) {
20
+	/**
21
+	 * holds the specific question object for the question details screen
22
+	 */
23
+	protected ?EE_Question $_question = null;
24
+
25
+	/**
26
+	 * holds the specific question group object for the question group details screen
27
+	 */
28
+	protected ?EE_Question_Group $_question_group = null;
29
+
30
+	protected EEM_Question $_question_model;
31
+
32
+	protected EEM_Question_Group $_question_group_model;
33
+
34
+
35
+	/**
36
+	 * @Constructor
37
+	 * @param bool $routing indicate whether we want to just load the object and handle routing or just load the object.
38
+	 * @throws EE_Error
39
+	 * @throws ReflectionException
40
+	 */
41
+	public function __construct($routing = true)
42
+	{
43
+		require_once(EE_MODELS . 'EEM_Question.model.php');
44
+		require_once(EE_MODELS . 'EEM_Question_Group.model.php');
45
+		$this->_question_model       = EEM_Question::instance();
46
+		$this->_question_group_model = EEM_Question_Group::instance();
47
+		parent::__construct($routing);
48
+	}
49
+
50
+
51
+	protected function _init_page_props()
52
+	{
53
+		$this->page_slug        = REGISTRATION_FORM_PG_SLUG;
54
+		$this->page_label       = esc_html__('Registration Form', 'event_espresso');
55
+		$this->_admin_base_url  = REGISTRATION_FORM_ADMIN_URL;
56
+		$this->_admin_base_path = REGISTRATION_FORM_ADMIN;
57
+	}
58
+
59
+
60
+	protected function _ajax_hooks()
61
+	{
62
+	}
63
+
64
+
65
+	protected function _define_page_props()
66
+	{
67
+		$this->_admin_page_title = esc_html__('Registration Form', 'event_espresso');
68
+		$this->_labels           = [
69
+			'buttons'    => [
70
+				'edit_question' => esc_html__('Edit Question', 'event_espresso'),
71
+			],
72
+			'publishbox' => [
73
+				'edit_question' => esc_html__('Edit Question', 'event_espresso'),
74
+			],
75
+		];
76
+	}
77
+
78
+
79
+	/**
80
+	 *_set_page_routes
81
+	 */
82
+	protected function _set_page_routes()
83
+	{
84
+		$qst_id             =
85
+			! empty($this->_req_data['QST_ID'])
86
+				? $this->_req_data['QST_ID']
87
+				: 0;
88
+		$this->_page_routes = [
89
+			'default' => [
90
+				'func'       => [$this, '_questions_overview_list_table'],
91
+				'capability' => 'ee_read_questions',
92
+			],
93
+
94
+			'edit_question' => [
95
+				'func'       => [$this, '_edit_question'],
96
+				'capability' => 'ee_edit_question',
97
+				'obj_id'     => $qst_id,
98
+				'args'       => ['edit'],
99
+			],
100
+
101
+			'question_groups' => [
102
+				'func'       => [$this, '_questions_groups_preview'],
103
+				'capability' => 'ee_read_question_groups',
104
+			],
105
+
106
+			'update_question' => [
107
+				'func'       => [$this, '_insert_or_update_question'],
108
+				'args'       => ['new_question' => false],
109
+				'capability' => 'ee_edit_question',
110
+				'obj_id'     => $qst_id,
111
+				'noheader'   => true,
112
+			],
113
+		];
114
+	}
115
+
116
+
117
+	protected function _set_page_config()
118
+	{
119
+		$this->_page_config = [
120
+			'default' => [
121
+				'nav'           => [
122
+					'label' => esc_html__('Questions', 'event_espresso'),
123
+					'icon'  => 'dashicons-editor-help',
124
+					'order' => 10,
125
+				],
126
+				'list_table'    => 'Registration_Form_Questions_Admin_List_Table',
127
+				'metaboxes'     => $this->_default_espresso_metaboxes,
128
+				'help_tabs'     => [
129
+					'registration_form_questions_overview_help_tab'                           => [
130
+						'title'    => esc_html__('Questions Overview', 'event_espresso'),
131
+						'filename' => 'registration_form_questions_overview',
132
+					],
133
+					'registration_form_questions_overview_table_column_headings_help_tab'     => [
134
+						'title'    => esc_html__('Questions Overview Table Column Headings', 'event_espresso'),
135
+						'filename' => 'registration_form_questions_overview_table_column_headings',
136
+					],
137
+					'registration_form_questions_overview_views_bulk_actions_search_help_tab' => [
138
+						'title'    => esc_html__('Question Overview Views & Bulk Actions & Search', 'event_espresso'),
139
+						'filename' => 'registration_form_questions_overview_views_bulk_actions_search',
140
+					],
141
+				],
142
+				'require_nonce' => false,
143
+			],
144
+
145
+			'question_groups' => [
146
+				'nav'           => [
147
+					'label' => esc_html__('Question Groups', 'event_espresso'),
148
+					'icon'  => 'dashicons-forms',
149
+					'order' => 20,
150
+				],
151
+				'metaboxes'     => $this->_default_espresso_metaboxes,
152
+				'help_tabs'     => [
153
+					'registration_form_question_groups_help_tab' => [
154
+						'title'    => esc_html__('Question Groups', 'event_espresso'),
155
+						'filename' => 'registration_form_question_groups',
156
+					],
157
+				],
158
+				'require_nonce' => false,
159
+			],
160
+
161
+			'edit_question' => [
162
+				'nav'           => [
163
+					'label'      => esc_html__('Edit Question', 'event_espresso'),
164
+					'icon'       => 'dashicons-edit-large',
165
+					'order'      => 15,
166
+					'persistent' => false,
167
+					'url'        => isset($this->_req_data['question_id'])
168
+						? add_query_arg(
169
+							['question_id' => $this->_req_data['question_id']],
170
+							$this->_current_page_view_url
171
+						)
172
+						: $this->_admin_base_url,
173
+				],
174
+				'metaboxes'     => array_merge($this->_default_espresso_metaboxes, ['_publish_post_box']),
175
+				'help_tabs'     => [
176
+					'registration_form_edit_question_group_help_tab' => [
177
+						'title'    => esc_html__('Edit Question', 'event_espresso'),
178
+						'filename' => 'registration_form_edit_question',
179
+					],
180
+				],
181
+				'require_nonce' => false,
182
+			],
183
+		];
184
+	}
185
+
186
+
187
+	protected function _add_screen_options()
188
+	{
189
+		// todo
190
+	}
191
+
192
+
193
+	protected function _add_screen_options_default()
194
+	{
195
+		$page_title              = $this->_admin_page_title;
196
+		$this->_admin_page_title = esc_html__('Questions', 'event_espresso');
197
+		$this->_per_page_screen_option();
198
+		$this->_admin_page_title = $page_title;
199
+	}
200
+
201
+
202
+	protected function _add_screen_options_question_groups()
203
+	{
204
+		$page_title              = $this->_admin_page_title;
205
+		$this->_admin_page_title = esc_html__('Question Groups', 'event_espresso');
206
+		$this->_per_page_screen_option();
207
+		$this->_admin_page_title = $page_title;
208
+	}
209
+
210
+
211
+	// none of the below group are currently used for Event Categories
212
+	protected function _add_feature_pointers()
213
+	{
214
+	}
215
+
216
+
217
+	public function load_scripts_styles()
218
+	{
219
+		wp_register_style(
220
+			'espresso_registration',
221
+			REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.css',
222
+			[EspressoLegacyAdminAssetManager::CSS_HANDLE_EE_ADMIN],
223
+			EVENT_ESPRESSO_VERSION
224
+		);
225
+		wp_enqueue_style('espresso_registration');
226
+	}
227
+
228
+
229
+	public function admin_init()
230
+	{
231
+	}
232
+
233
+
234
+	public function admin_notices()
235
+	{
236
+	}
237
+
238
+
239
+	public function admin_footer_scripts()
240
+	{
241
+	}
242
+
243
+
244
+	public function load_scripts_styles_default()
245
+	{
246
+	}
247
+
248
+
249
+	public function load_scripts_styles_add_question()
250
+	{
251
+		$this->load_scripts_styles_question_details();
252
+	}
253
+
254
+
255
+	public function load_scripts_styles_edit_question()
256
+	{
257
+		$this->load_scripts_styles_question_details();
258
+	}
259
+
260
+
261
+	/**
262
+	 * Loads the JS required for adding or editing a question
263
+	 */
264
+	protected function load_scripts_styles_question_details()
265
+	{
266
+		$this->load_scripts_styles_forms();
267
+		wp_register_script(
268
+			'espresso_registration_form_single',
269
+			REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.js',
270
+			['jquery-ui-sortable'],
271
+			EVENT_ESPRESSO_VERSION,
272
+			true
273
+		);
274
+		wp_enqueue_script('espresso_registration_form_single');
275
+		wp_localize_script(
276
+			'espresso_registration_form_single',
277
+			'ee_question_data',
278
+			[
279
+				'question_types_with_max'    => $this->_question_model->questionTypesWithMaxLength(),
280
+				'question_type_with_options' => $this->_question_model->question_types_with_options(),
281
+			]
282
+		);
283
+	}
284
+
285
+
286
+	public function recaptcha_info_help_tab()
287
+	{
288
+		EEH_Template::display_template(REGISTRATION_FORM_TEMPLATE_PATH . 'recaptcha_info_help_tab.template.php');
289
+	}
290
+
291
+
292
+	public function load_scripts_styles_forms()
293
+	{
294
+		// styles
295
+		wp_enqueue_style('espresso-ui-theme');
296
+		// scripts
297
+		wp_enqueue_script('ee_admin_js');
298
+	}
299
+
300
+
301
+	protected function _set_list_table_views_default()
302
+	{
303
+		$this->_views = [
304
+			'all' => [
305
+				'slug'  => 'all',
306
+				'label' => esc_html__('View All Questions', 'event_espresso'),
307
+				'count' => 0,
308
+			],
309
+		];
310
+
311
+		if (
312
+			$this->capabilities->current_user_can(
313
+				'ee_delete_questions',
314
+				'espresso_registration_form_trash_questions'
315
+			)
316
+		) {
317
+			$this->_views['trash'] = [
318
+				'slug'  => 'trash',
319
+				'label' => esc_html__('Trash', 'event_espresso'),
320
+				'count' => 0,
321
+			];
322
+		}
323
+	}
324
+
325
+
326
+	/**
327
+	 * This just previews the question groups tab that comes in caffeinated.
328
+	 *
329
+	 * @return void html
330
+	 * @throws EE_Error
331
+	 */
332
+	protected function _questions_groups_preview()
333
+	{
334
+		$this->_admin_page_title              = esc_html__('Question Groups (Preview)', 'event_espresso');
335
+		$this->_template_args['preview_img']  =
336
+			'<img src="' . REGISTRATION_FORM_ASSETS_URL . 'caf_reg_form_preview.jpg" alt="'
337
+			. esc_attr__(
338
+				'Preview Question Groups Overview List Table screenshot',
339
+				'event_espresso'
340
+			) . '" />';
341
+		$this->_template_args['preview_text'] = '<strong>'
342
+			. esc_html__(
343
+				'Question Groups is a feature that is only available in the premium version of Event Espresso 4 which is available with a support license purchase on EventEspresso.com. With the Question Groups feature you are able to create new question groups, edit existing question groups, and create and edit new questions and add them to question groups.',
344
+				'event_espresso'
345
+			) . '</strong>';
346
+		$this->display_admin_caf_preview_page('question_groups_tab');
347
+	}
348
+
349
+
350
+	/**
351
+	 * Extracts the question field's values from the POST request to update or insert them
352
+	 *
353
+	 * @param EEM_Base $model
354
+	 * @return array where each key is the name of a model's field/db column, and each value is its value.
355
+	 * @throws EE_Error
356
+	 * @throws ReflectionException
357
+	 */
358
+	protected function _set_column_values_for(EEM_Base $model): array
359
+	{
360
+		$column_values = [];
361
+		// some initial checks for proper values.
362
+		$QST_ID = $this->request->getRequestParam('QST_ID', 0, DataType::INT);
363
+		// if QST_admin_only, then no matter what QST_required is we disable.
364
+		$QST_admin_only = $this->request->getRequestParam('QST_admin_only', false, DataType::BOOL);
365
+		if ($QST_admin_only) {
366
+			$this->request->setRequestParam('QST_required', false);
367
+		}
368
+		// if the question shouldn't have a max length, don't let them set one
369
+		if (
370
+			! (
371
+				$this->request->requestParamIsSet('QST_type')
372
+				&& $this->request->requestParamIsSet('QST_max')
373
+			) || ! in_array(
374
+				$this->request->getRequestParam('QST_type', '', DataType::STRING),
375
+				$this->_question_model->questionTypesWithMaxLength(),
376
+				true
377
+			)
378
+		) {
379
+			// they're not allowed to set the max
380
+			$this->request->unSetRequestParam('QST_max', true);
381
+		}
382
+		foreach ($model->field_settings() as $fieldName => $settings) {
383
+			switch($fieldName) {
384
+				case 'QSG_identifier':
385
+					// basically if QSG_identifier is empty or not set
386
+					if (! $this->request->getRequestParam('QSG_identifier', '', DataType::STRING)) {
387
+						$QSG_name                    = $this->request->getRequestParam('QSG_name', '', DataType::STRING);
388
+						$column_values[ $fieldName ] = sanitize_title($QSG_name) . '-' . uniqid('', true);
389
+					}
390
+					break;
391
+
392
+				case 'QST_display_text':
393
+						$column_values[ $fieldName ] = $this->request->getRequestParam('QST_display_text', '', DataType::HTML);
394
+					break;
395
+
396
+				case 'QST_admin_label':
397
+					if (! $this->request->getRequestParam('QST_admin_label', '', DataType::STRING)) {
398
+						// the admin label is blank, use a slug version of the question text
399
+						$QST_text                    = $this->request->getRequestParam('QST_display_text', '', DataType::STRING);
400
+						$column_values[ $fieldName ] = sanitize_title(wp_trim_words($QST_text, 10));
401
+					} else {
402
+						// admin label set, use it
403
+						$column_values[ $fieldName ] = $this->request->getRequestParam('QST_admin_label', '', DataType::STRING);
404
+					}
405
+					break;
406
+
407
+				case 'QST_admin_only':
408
+					$column_values[ $fieldName ] = $QST_admin_only;
409
+					break;
410
+
411
+				case 'QST_max':
412
+					$qst_system = $this->_question_model->get_var(
413
+						[ [ 'QST_ID' => $QST_ID ] ],
414
+						'QST_system'
415
+					);
416
+
417
+					$max_max = $this->_question_model->absolute_max_for_system_question((string) $qst_system);
418
+					$QST_max = $this->request->getRequestParam('QST_max', 0, DataType::INT);
419
+					if ($QST_max === 0 || $QST_max > $max_max) {
420
+						$column_values[ $fieldName ] = $max_max;
421
+					}
422
+					break;
423
+
424
+				default:
425
+					// only add a property to the array if it's not null (otherwise the model should just use the default value)
426
+					if ($this->request->requestParamIsSet($fieldName)) {
427
+						// convert the schema type to the appropriate data type
428
+						$schema_type = DataType::convertModelFieldSchemaType($settings->getSchemaType());
429
+						$column_values[ $fieldName ] = $this->request->getRequestParam($fieldName, null, $schema_type);
430
+					}
431
+			}
432
+		}
433
+		// validation for this data to be performed by the model before insertion.
434
+		return $column_values;
435
+	}
436
+
437
+
438
+	/**
439
+	 *_questions_overview_list_table
440
+	 *
441
+	 * @throws EE_Error
442
+	 */
443
+	protected function _questions_overview_list_table()
444
+	{
445
+		$this->_search_btn_label = esc_html__('Questions', 'event_espresso');
446
+		$this->display_admin_list_table_page_with_sidebar();
447
+	}
448
+
449
+
450
+	/**
451
+	 * _edit_question
452
+	 *
453
+	 * @throws EE_Error
454
+	 * @throws ReflectionException
455
+	 */
456
+	protected function _edit_question()
457
+	{
458
+		$ID = isset($this->_req_data['QST_ID']) && ! empty($this->_req_data['QST_ID'])
459
+			? absint($this->_req_data['QST_ID'])
460
+			: false;
461
+
462
+		switch ($this->_req_action) {
463
+			case 'add_question':
464
+				$this->_admin_page_title = esc_html__('Add Question', 'event_espresso');
465
+				break;
466
+			case 'edit_question':
467
+				$this->_admin_page_title = esc_html__('Edit Question', 'event_espresso');
468
+				break;
469
+			default:
470
+				$this->_admin_page_title = ucwords(str_replace('_', ' ', $this->_req_action));
471
+		}
472
+
473
+		// add PRC_ID to title if editing
474
+		$this->_admin_page_title =
475
+			$ID
476
+				? $this->_admin_page_title . ' # ' . $ID
477
+				: $this->_admin_page_title;
478
+		if ($ID) {
479
+			$question                 = $this->_question_model->get_one_by_ID($ID);
480
+			$additional_hidden_fields = ['QST_ID' => ['type' => 'hidden', 'value' => $ID]];
481
+			$this->_set_add_edit_form_tags('update_question', $additional_hidden_fields);
482
+		} else {
483
+			$question = EE_Question::new_instance();
484
+			$question->set_order_to_latest();
485
+			$this->_set_add_edit_form_tags('insert_question');
486
+		}
487
+		if ($question->system_ID() === EEM_Attendee::system_question_phone) {
488
+			$question_types = array_intersect_key(
489
+				$this->_question_model->allowed_question_types(),
490
+				array_flip(
491
+					[
492
+						EEM_Question::QST_type_text,
493
+						EEM_Question::QST_type_us_phone,
494
+					]
495
+				)
496
+			);
497
+		} else {
498
+			$question_types = $question->has_answers()
499
+				? $this->_question_model->question_types_in_same_category($question->type())
500
+				: $this->_question_model->allowed_question_types();
501
+		}
502
+		$this->_template_args['QST_ID']                     = $ID;
503
+		$this->_template_args['question']                   = $question;
504
+		$this->_template_args['question_types']             = $question_types;
505
+		$this->_template_args['max_max']                    =
506
+			$this->_question_model->absolute_max_for_system_question(
507
+				$question->system_ID()
508
+			);
509
+		$this->_template_args['question_type_descriptions'] = $this->_get_question_type_descriptions();
510
+		$this->_set_publish_post_box_vars('id', $ID);
511
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(
512
+			REGISTRATION_FORM_TEMPLATE_PATH . 'questions_main_meta_box.template.php',
513
+			$this->_template_args,
514
+			true
515
+		);
516
+
517
+		// the details template wrapper
518
+		$this->display_admin_page_with_sidebar();
519
+	}
520
+
521
+
522
+	/**
523
+	 * @return string
524
+	 * @throws EE_Error
525
+	 * @throws ReflectionException
526
+	 */
527
+	protected function _get_question_type_descriptions(): string
528
+	{
529
+		EE_Registry::instance()->load_helper('HTML');
530
+		$descriptions               = '';
531
+		$question_type_descriptions = $this->_question_model->question_descriptions();
532
+		foreach ($question_type_descriptions as $type => $question_type_description) {
533
+			if ($type == 'HTML_TEXTAREA') {
534
+				$html                      = new EE_Simple_HTML_Validation_Strategy();
535
+				$question_type_description .= sprintf(
536
+					esc_html__('%1$s(allowed tags: %2$s)', 'event_espresso'),
537
+					'<br/>',
538
+					$html->get_list_of_allowed_tags()
539
+				);
540
+			}
541
+			$descriptions .= EEH_HTML::p(
542
+				$question_type_description,
543
+				'question_type_description-' . $type,
544
+				'question_type_description description',
545
+				'display:none;'
546
+			);
547
+		}
548
+		return $descriptions;
549
+	}
550
+
551
+
552
+	/**
553
+	 * @param bool $new_question
554
+	 * @throws EE_Error
555
+	 * @throws ReflectionException
556
+	 */
557
+	protected function _insert_or_update_question(bool $new_question = true)
558
+	{
559
+		$set_column_values = $this->_set_column_values_for($this->_question_model);
560
+		if ($new_question) {
561
+			$question    = EE_Question::new_instance($set_column_values);
562
+			$action_desc = 'added';
563
+		} else {
564
+			$question = $this->_question_model->get_one_by_ID(
565
+				$this->request->getRequestParam('QST_ID', 0, DataType::INT)
566
+			);
567
+			foreach ($set_column_values as $field => $new_value) {
568
+				$question->set($field, $new_value);
569
+			}
570
+			$action_desc = 'updated';
571
+		}
572
+		$success = $question->save();
573
+		$ID      = $question->ID();
574
+		if ($ID && $question->should_have_question_options()) {
575
+			// save the related options
576
+			// trash removed options, save old ones
577
+			// get list of all options
578
+			$options          = $question->options();
579
+			$question_options = $this->request->getRequestParam('question_options', [], DataType::HTML, true);
580
+			$QSO_default      = $this->request->getRequestParam('QSO_default', null, DataType::INT);
581
+			if (! empty($options)) {
582
+				foreach ($options as $option_ID => $option) {
583
+					$option_req_index = $this->_get_option_req_data_index($option_ID);
584
+					if ($option_req_index !== false) {
585
+						$question_options[ $option_req_index ]['QSO_default'] = $option_req_index === $QSO_default;
586
+						$option->save($question_options[ $option_req_index ]);
587
+					} else {
588
+						// not found, remove it
589
+						$option->delete();
590
+					}
591
+				}
592
+			}
593
+			// save new related options
594
+			foreach ($question_options as $index => $option_req_data) {
595
+				// skip $index that is from our sample
596
+				if ($index === 'xxcountxx') {
597
+					continue;
598
+				}
599
+				// note we allow saving blank options.
600
+				if (empty($option_req_data['QSO_ID'])) {
601
+					// no ID! save it!
602
+					$new_option = EE_Question_Option::new_instance(
603
+						[
604
+							'QSO_value'   => $option_req_data['QSO_value'],
605
+							'QSO_desc'    => $option_req_data['QSO_desc'],
606
+							'QSO_default' => $index === $QSO_default,
607
+							'QSO_order'   => $option_req_data['QSO_order'],
608
+							'QST_ID'      => $question->ID(),
609
+						]
610
+					);
611
+					$new_option->save();
612
+				}
613
+			}
614
+		}
615
+
616
+		$success = apply_filters(
617
+			'FHEE__Registration_Form_Admin_Page___insert_or_update_question__success',
618
+			(int) $success,
619
+			$question,
620
+			$this
621
+		);
622
+
623
+		$query_args = ['action' => 'edit_question', 'QST_ID' => $ID];
624
+		if ($success !== 0) {
625
+			$msg = $new_question
626
+				? sprintf(
627
+					esc_html__('The %s has been created', 'event_espresso'),
628
+					$this->_question_model->item_name()
629
+				)
630
+				: sprintf(
631
+					esc_html__('The %s has been updated', 'event_espresso'),
632
+					$this->_question_model->item_name()
633
+				);
634
+			EE_Error::add_success($msg);
635
+		}
636
+
637
+		$this->_redirect_after_action(false, '', $action_desc, $query_args, true);
638
+	}
639
+
640
+
641
+	/**
642
+	 * Upon saving a question, there should be an array of 'question_options'. This array is index numerically, but not
643
+	 * by ID
644
+	 * (this is done because new question options don't have an ID, but we may want to add multiple simultaneously).
645
+	 * So, this function gets the index in that request data array called question_options. Returns FALSE if not found.
646
+	 *
647
+	 * @param int $ID of the question option to find
648
+	 * @return int index in question_options array if successful, FALSE if unsuccessful
649
+	 */
650
+	protected function _get_option_req_data_index(int $ID)
651
+	{
652
+		$req_data_for_question_options = $this->_req_data['question_options'];
653
+		foreach ($req_data_for_question_options as $num => $option_data) {
654
+			if (array_key_exists('QSO_ID', $option_data) && (int) $option_data['QSO_ID'] === $ID) {
655
+				return $num;
656
+			}
657
+		}
658
+		return false;
659
+	}
660
+
661
+
662
+
663
+
664
+	/* QUERIES */
665
+	/**
666
+	 * For internal use in getting all the query parameters
667
+	 * (because it's pretty well the same between question, question groups,
668
+	 * and for both when searching for trashed and untrashed ones)
669
+	 *
670
+	 * @param EEM_Base $model either EEM_Question or EEM_Question_Group
671
+	 * @param int      $per_page
672
+	 * @param int      $current_page
673
+	 * @return array model query params,
674
+	 * @see https://github.com/eventespresso/event-espresso-core/tree/master/docs/G--Model-System/model-query-params.md
675
+	 */
676
+	protected function get_query_params(EEM_Base $model, int $per_page = 10, int $current_page = 10): array
677
+	{
678
+		$query_params             = [];
679
+		$offset                   = ($current_page - 1) * $per_page;
680
+		$query_params['limit']    = [$offset, $per_page];
681
+
682
+		$order  = (isset($this->_req_data['order']) && ! empty($this->_req_data['order']))
683
+			? $this->_req_data['order']
684
+			: 'ASC';
685
+
686
+		$orderby_field = $model instanceof EEM_Question ? 'QST_ID' : 'QSG_order';
687
+
688
+		$field_to_order_by = empty($this->_req_data['orderby']) ? $orderby_field : $this->_req_data['orderby'];
689
+
690
+		$query_params['order_by'] = [$field_to_order_by => $order];
691
+
692
+		$search_string = array_key_exists('s', $this->_req_data) ? $this->_req_data['s'] : null;
693
+		if (! empty($search_string)) {
694
+			if ($model instanceof EEM_Question_Group) {
695
+				$query_params[0] = [
696
+					'OR' => [
697
+						'QSG_name' => ['LIKE', "%$search_string%"],
698
+						'QSG_desc' => ['LIKE', "%$search_string%"],
699
+					],
700
+				];
701
+			} else {
702
+				$query_params[0] = [
703
+					'QST_display_text' => ['LIKE', "%$search_string%"],
704
+				];
705
+			}
706
+		}
707
+
708
+		// capability checks (just leaving this commented out for reference because
709
+		// it illustrates some complicated query params that could be useful when fully implemented)
710
+		/*if ( $model instanceof EEM_Question_Group ) {
711 711
             if (
712 712
                 ! $this->capabilities->current_user_can(
713 713
                     'edit_others_question_groups',
@@ -747,59 +747,59 @@  discard block
 block discarded – undo
747 747
             }
748 748
         }/**/
749 749
 
750
-        return $query_params;
751
-    }
752
-
753
-
754
-    /**
755
-     * @param int  $per_page
756
-     * @param int  $current_page
757
-     * @param bool $count
758
-     * @return EE_Question[]|int
759
-     * @throws EE_Error
760
-     * @throws ReflectionException
761
-     */
762
-    public function get_questions(int $per_page = 10, int $current_page = 1, bool $count = false)
763
-    {
764
-        $query_params = $this->get_query_params($this->_question_model, $per_page, $current_page);
765
-        if ($count) {
766
-            $where = isset($query_params[0]) ? [$query_params[0]] : [];
767
-            return $this->_question_model->count($where);
768
-        }
769
-        return $this->_question_model->get_all($query_params);
770
-    }
771
-
772
-
773
-    /**
774
-     * @param int  $per_page
775
-     * @param int  $current_page
776
-     * @param bool $count
777
-     * @return EE_Soft_Delete_Base_Class[]|int
778
-     * @throws EE_Error
779
-     */
780
-    public function get_trashed_questions(int $per_page, int $current_page = 1, bool $count = false)
781
-    {
782
-        $query_params = $this->get_query_params($this->_question_model, $per_page, $current_page);
783
-        $where        = isset($query_params[0]) ? [$query_params[0]] : [];
784
-        return $count
785
-            ? $this->_question_model->count_deleted($where)
786
-            : $this->_question_model->get_all_deleted($query_params);
787
-    }
788
-
789
-
790
-    /**
791
-     * @param int  $per_page
792
-     * @param int  $current_page
793
-     * @param bool $count
794
-     * @return EE_Question_Group[]|int
795
-     * @throws EE_Error
796
-     * @throws ReflectionException
797
-     */
798
-    public function get_question_groups(int $per_page, int $current_page = 1, bool $count = false)
799
-    {
800
-        // note: this a subclass of EEM_Soft_Delete_Base, so this is actually only getting non-trashed items
801
-        return $this->_question_group_model->get_all(
802
-            $this->get_query_params($this->_question_group_model, $per_page, $current_page)
803
-        );
804
-    }
750
+		return $query_params;
751
+	}
752
+
753
+
754
+	/**
755
+	 * @param int  $per_page
756
+	 * @param int  $current_page
757
+	 * @param bool $count
758
+	 * @return EE_Question[]|int
759
+	 * @throws EE_Error
760
+	 * @throws ReflectionException
761
+	 */
762
+	public function get_questions(int $per_page = 10, int $current_page = 1, bool $count = false)
763
+	{
764
+		$query_params = $this->get_query_params($this->_question_model, $per_page, $current_page);
765
+		if ($count) {
766
+			$where = isset($query_params[0]) ? [$query_params[0]] : [];
767
+			return $this->_question_model->count($where);
768
+		}
769
+		return $this->_question_model->get_all($query_params);
770
+	}
771
+
772
+
773
+	/**
774
+	 * @param int  $per_page
775
+	 * @param int  $current_page
776
+	 * @param bool $count
777
+	 * @return EE_Soft_Delete_Base_Class[]|int
778
+	 * @throws EE_Error
779
+	 */
780
+	public function get_trashed_questions(int $per_page, int $current_page = 1, bool $count = false)
781
+	{
782
+		$query_params = $this->get_query_params($this->_question_model, $per_page, $current_page);
783
+		$where        = isset($query_params[0]) ? [$query_params[0]] : [];
784
+		return $count
785
+			? $this->_question_model->count_deleted($where)
786
+			: $this->_question_model->get_all_deleted($query_params);
787
+	}
788
+
789
+
790
+	/**
791
+	 * @param int  $per_page
792
+	 * @param int  $current_page
793
+	 * @param bool $count
794
+	 * @return EE_Question_Group[]|int
795
+	 * @throws EE_Error
796
+	 * @throws ReflectionException
797
+	 */
798
+	public function get_question_groups(int $per_page, int $current_page = 1, bool $count = false)
799
+	{
800
+		// note: this a subclass of EEM_Soft_Delete_Base, so this is actually only getting non-trashed items
801
+		return $this->_question_group_model->get_all(
802
+			$this->get_query_params($this->_question_group_model, $per_page, $current_page)
803
+		);
804
+	}
805 805
 }
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function __construct($routing = true)
42 42
     {
43
-        require_once(EE_MODELS . 'EEM_Question.model.php');
44
-        require_once(EE_MODELS . 'EEM_Question_Group.model.php');
43
+        require_once(EE_MODELS.'EEM_Question.model.php');
44
+        require_once(EE_MODELS.'EEM_Question_Group.model.php');
45 45
         $this->_question_model       = EEM_Question::instance();
46 46
         $this->_question_group_model = EEM_Question_Group::instance();
47 47
         parent::__construct($routing);
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      */
82 82
     protected function _set_page_routes()
83 83
     {
84
-        $qst_id             =
84
+        $qst_id =
85 85
             ! empty($this->_req_data['QST_ID'])
86 86
                 ? $this->_req_data['QST_ID']
87 87
                 : 0;
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
     {
219 219
         wp_register_style(
220 220
             'espresso_registration',
221
-            REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.css',
221
+            REGISTRATION_FORM_ASSETS_URL.'espresso_registration_form_admin.css',
222 222
             [EspressoLegacyAdminAssetManager::CSS_HANDLE_EE_ADMIN],
223 223
             EVENT_ESPRESSO_VERSION
224 224
         );
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
         $this->load_scripts_styles_forms();
267 267
         wp_register_script(
268 268
             'espresso_registration_form_single',
269
-            REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.js',
269
+            REGISTRATION_FORM_ASSETS_URL.'espresso_registration_form_admin.js',
270 270
             ['jquery-ui-sortable'],
271 271
             EVENT_ESPRESSO_VERSION,
272 272
             true
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 
286 286
     public function recaptcha_info_help_tab()
287 287
     {
288
-        EEH_Template::display_template(REGISTRATION_FORM_TEMPLATE_PATH . 'recaptcha_info_help_tab.template.php');
288
+        EEH_Template::display_template(REGISTRATION_FORM_TEMPLATE_PATH.'recaptcha_info_help_tab.template.php');
289 289
     }
290 290
 
291 291
 
@@ -333,16 +333,16 @@  discard block
 block discarded – undo
333 333
     {
334 334
         $this->_admin_page_title              = esc_html__('Question Groups (Preview)', 'event_espresso');
335 335
         $this->_template_args['preview_img']  =
336
-            '<img src="' . REGISTRATION_FORM_ASSETS_URL . 'caf_reg_form_preview.jpg" alt="'
336
+            '<img src="'.REGISTRATION_FORM_ASSETS_URL.'caf_reg_form_preview.jpg" alt="'
337 337
             . esc_attr__(
338 338
                 'Preview Question Groups Overview List Table screenshot',
339 339
                 'event_espresso'
340
-            ) . '" />';
340
+            ).'" />';
341 341
         $this->_template_args['preview_text'] = '<strong>'
342 342
             . esc_html__(
343 343
                 'Question Groups is a feature that is only available in the premium version of Event Espresso 4 which is available with a support license purchase on EventEspresso.com. With the Question Groups feature you are able to create new question groups, edit existing question groups, and create and edit new questions and add them to question groups.',
344 344
                 'event_espresso'
345
-            ) . '</strong>';
345
+            ).'</strong>';
346 346
         $this->display_admin_caf_preview_page('question_groups_tab');
347 347
     }
348 348
 
@@ -380,44 +380,44 @@  discard block
 block discarded – undo
380 380
             $this->request->unSetRequestParam('QST_max', true);
381 381
         }
382 382
         foreach ($model->field_settings() as $fieldName => $settings) {
383
-            switch($fieldName) {
383
+            switch ($fieldName) {
384 384
                 case 'QSG_identifier':
385 385
                     // basically if QSG_identifier is empty or not set
386
-                    if (! $this->request->getRequestParam('QSG_identifier', '', DataType::STRING)) {
386
+                    if ( ! $this->request->getRequestParam('QSG_identifier', '', DataType::STRING)) {
387 387
                         $QSG_name                    = $this->request->getRequestParam('QSG_name', '', DataType::STRING);
388
-                        $column_values[ $fieldName ] = sanitize_title($QSG_name) . '-' . uniqid('', true);
388
+                        $column_values[$fieldName] = sanitize_title($QSG_name).'-'.uniqid('', true);
389 389
                     }
390 390
                     break;
391 391
 
392 392
                 case 'QST_display_text':
393
-                        $column_values[ $fieldName ] = $this->request->getRequestParam('QST_display_text', '', DataType::HTML);
393
+                        $column_values[$fieldName] = $this->request->getRequestParam('QST_display_text', '', DataType::HTML);
394 394
                     break;
395 395
 
396 396
                 case 'QST_admin_label':
397
-                    if (! $this->request->getRequestParam('QST_admin_label', '', DataType::STRING)) {
397
+                    if ( ! $this->request->getRequestParam('QST_admin_label', '', DataType::STRING)) {
398 398
                         // the admin label is blank, use a slug version of the question text
399 399
                         $QST_text                    = $this->request->getRequestParam('QST_display_text', '', DataType::STRING);
400
-                        $column_values[ $fieldName ] = sanitize_title(wp_trim_words($QST_text, 10));
400
+                        $column_values[$fieldName] = sanitize_title(wp_trim_words($QST_text, 10));
401 401
                     } else {
402 402
                         // admin label set, use it
403
-                        $column_values[ $fieldName ] = $this->request->getRequestParam('QST_admin_label', '', DataType::STRING);
403
+                        $column_values[$fieldName] = $this->request->getRequestParam('QST_admin_label', '', DataType::STRING);
404 404
                     }
405 405
                     break;
406 406
 
407 407
                 case 'QST_admin_only':
408
-                    $column_values[ $fieldName ] = $QST_admin_only;
408
+                    $column_values[$fieldName] = $QST_admin_only;
409 409
                     break;
410 410
 
411 411
                 case 'QST_max':
412 412
                     $qst_system = $this->_question_model->get_var(
413
-                        [ [ 'QST_ID' => $QST_ID ] ],
413
+                        [['QST_ID' => $QST_ID]],
414 414
                         'QST_system'
415 415
                     );
416 416
 
417 417
                     $max_max = $this->_question_model->absolute_max_for_system_question((string) $qst_system);
418 418
                     $QST_max = $this->request->getRequestParam('QST_max', 0, DataType::INT);
419 419
                     if ($QST_max === 0 || $QST_max > $max_max) {
420
-                        $column_values[ $fieldName ] = $max_max;
420
+                        $column_values[$fieldName] = $max_max;
421 421
                     }
422 422
                     break;
423 423
 
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
                     if ($this->request->requestParamIsSet($fieldName)) {
427 427
                         // convert the schema type to the appropriate data type
428 428
                         $schema_type = DataType::convertModelFieldSchemaType($settings->getSchemaType());
429
-                        $column_values[ $fieldName ] = $this->request->getRequestParam($fieldName, null, $schema_type);
429
+                        $column_values[$fieldName] = $this->request->getRequestParam($fieldName, null, $schema_type);
430 430
                     }
431 431
             }
432 432
         }
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
         // add PRC_ID to title if editing
474 474
         $this->_admin_page_title =
475 475
             $ID
476
-                ? $this->_admin_page_title . ' # ' . $ID
476
+                ? $this->_admin_page_title.' # '.$ID
477 477
                 : $this->_admin_page_title;
478 478
         if ($ID) {
479 479
             $question                 = $this->_question_model->get_one_by_ID($ID);
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
         $this->_template_args['question_type_descriptions'] = $this->_get_question_type_descriptions();
510 510
         $this->_set_publish_post_box_vars('id', $ID);
511 511
         $this->_template_args['admin_page_content'] = EEH_Template::display_template(
512
-            REGISTRATION_FORM_TEMPLATE_PATH . 'questions_main_meta_box.template.php',
512
+            REGISTRATION_FORM_TEMPLATE_PATH.'questions_main_meta_box.template.php',
513 513
             $this->_template_args,
514 514
             true
515 515
         );
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
         $question_type_descriptions = $this->_question_model->question_descriptions();
532 532
         foreach ($question_type_descriptions as $type => $question_type_description) {
533 533
             if ($type == 'HTML_TEXTAREA') {
534
-                $html                      = new EE_Simple_HTML_Validation_Strategy();
534
+                $html = new EE_Simple_HTML_Validation_Strategy();
535 535
                 $question_type_description .= sprintf(
536 536
                     esc_html__('%1$s(allowed tags: %2$s)', 'event_espresso'),
537 537
                     '<br/>',
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
             }
541 541
             $descriptions .= EEH_HTML::p(
542 542
                 $question_type_description,
543
-                'question_type_description-' . $type,
543
+                'question_type_description-'.$type,
544 544
                 'question_type_description description',
545 545
                 'display:none;'
546 546
             );
@@ -578,12 +578,12 @@  discard block
 block discarded – undo
578 578
             $options          = $question->options();
579 579
             $question_options = $this->request->getRequestParam('question_options', [], DataType::HTML, true);
580 580
             $QSO_default      = $this->request->getRequestParam('QSO_default', null, DataType::INT);
581
-            if (! empty($options)) {
581
+            if ( ! empty($options)) {
582 582
                 foreach ($options as $option_ID => $option) {
583 583
                     $option_req_index = $this->_get_option_req_data_index($option_ID);
584 584
                     if ($option_req_index !== false) {
585
-                        $question_options[ $option_req_index ]['QSO_default'] = $option_req_index === $QSO_default;
586
-                        $option->save($question_options[ $option_req_index ]);
585
+                        $question_options[$option_req_index]['QSO_default'] = $option_req_index === $QSO_default;
586
+                        $option->save($question_options[$option_req_index]);
587 587
                     } else {
588 588
                         // not found, remove it
589 589
                         $option->delete();
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
         $offset                   = ($current_page - 1) * $per_page;
680 680
         $query_params['limit']    = [$offset, $per_page];
681 681
 
682
-        $order  = (isset($this->_req_data['order']) && ! empty($this->_req_data['order']))
682
+        $order = (isset($this->_req_data['order']) && ! empty($this->_req_data['order']))
683 683
             ? $this->_req_data['order']
684 684
             : 'ASC';
685 685
 
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
         $query_params['order_by'] = [$field_to_order_by => $order];
691 691
 
692 692
         $search_string = array_key_exists('s', $this->_req_data) ? $this->_req_data['s'] : null;
693
-        if (! empty($search_string)) {
693
+        if ( ! empty($search_string)) {
694 694
             if ($model instanceof EEM_Question_Group) {
695 695
                 $query_params[0] = [
696 696
                     'OR' => [
Please login to merge, or discard this patch.
PaymentMethods/PayPalCommerce/tools/logging/PayPalLogger.php 1 patch
Indentation   +154 added lines, -154 removed lines patch added patch discarded remove patch
@@ -19,149 +19,149 @@  discard block
 block discarded – undo
19 19
  */
20 20
 class PayPalLogger
21 21
 {
22
-    /**
23
-     * Log an error, return a json message and maybe exit.
24
-     *
25
-     * @param string                 $error_message
26
-     * @param array                  $data
27
-     * @param EE_Payment_Method|null $paypal_pm
28
-     * @param mixed             $object_logged
29
-     * @param bool                   $return_json Should we echo json and exit
30
-     * @param bool                   $popup_log
31
-     * @param bool                   $show_alert  Show an alert on the front end or not
32
-     * @return void
33
-     */
34
-    public static function errorLogAndExit(
35
-        string $error_message = '',
36
-        array $data = [],
37
-        ?EE_Payment_Method $paypal_pm = null,
38
-        bool $return_json = true,
39
-        bool $popup_log = false,
40
-        bool $show_alert = false,
41
-        $object_logged = null
42
-    ): void {
43
-        PayPalLogger::errorLog($error_message, $data, $paypal_pm, $popup_log, $object_logged);
44
-        // Do we echo json and exit or just close the window ?
45
-        if ($return_json) {
46
-            PayPalLogger::exitWithJson($error_message, $show_alert);
47
-        }
48
-        if ($popup_log) {
49
-            PayPalLogger::logInWindow($error_message);
50
-        }
51
-        PayPalLogger::closeWindowAndExit();
52
-    }
22
+	/**
23
+	 * Log an error, return a json message and maybe exit.
24
+	 *
25
+	 * @param string                 $error_message
26
+	 * @param array                  $data
27
+	 * @param EE_Payment_Method|null $paypal_pm
28
+	 * @param mixed             $object_logged
29
+	 * @param bool                   $return_json Should we echo json and exit
30
+	 * @param bool                   $popup_log
31
+	 * @param bool                   $show_alert  Show an alert on the front end or not
32
+	 * @return void
33
+	 */
34
+	public static function errorLogAndExit(
35
+		string $error_message = '',
36
+		array $data = [],
37
+		?EE_Payment_Method $paypal_pm = null,
38
+		bool $return_json = true,
39
+		bool $popup_log = false,
40
+		bool $show_alert = false,
41
+		$object_logged = null
42
+	): void {
43
+		PayPalLogger::errorLog($error_message, $data, $paypal_pm, $popup_log, $object_logged);
44
+		// Do we echo json and exit or just close the window ?
45
+		if ($return_json) {
46
+			PayPalLogger::exitWithJson($error_message, $show_alert);
47
+		}
48
+		if ($popup_log) {
49
+			PayPalLogger::logInWindow($error_message);
50
+		}
51
+		PayPalLogger::closeWindowAndExit();
52
+	}
53 53
 
54 54
 
55
-    /**
56
-     * Log an error, return a json message.
57
-     *
58
-     * @param string                 $error_message
59
-     * @param array                  $data
60
-     * @param EE_Payment_Method|null $paypal_pm
61
-     * @param mixed                  $object_logged
62
-     * @param bool                   $popup_log
63
-     * @return bool
64
-     */
65
-    public static function errorLog(
66
-        string $error_message = '',
67
-        array $data = [],
68
-        ?EE_Payment_Method $paypal_pm = null,
69
-        bool $popup_log = false,
70
-        $object_logged = null
71
-    ): bool {
72
-        $default_msg = 'PayPal Commerce error';
73
-        if ($data) {
74
-            $data        = PayPalLogger::cleanDataArray($data);
75
-            $default_msg = $error_message;
76
-        }
77
-        try {
78
-            if (! $paypal_pm instanceof EE_Payment_Method) {
79
-                // Default to the standard PP Commerce PM.
80
-                $paypal_pm = EEM_Payment_Method::instance()->get_one_by_slug(Domain::PM_SLUG);
81
-            }
82
-            $paypal_gateway = $paypal_pm->type_obj()->get_gateway();
83
-            if ($paypal_gateway instanceof EE_Gateway) {
84
-                $paypal_gateway->log([$default_msg, $data], $object_logged);
85
-            }
86
-            if ($popup_log) {
87
-                PayPalLogger::logInWindow(json_encode($data));
88
-            }
89
-        } catch (ReflectionException | EE_Error $error) {
90
-            new ExceptionLogger($error);
91
-            return false;
92
-        }
93
-        // Yes, always return true.
94
-        return true;
95
-    }
55
+	/**
56
+	 * Log an error, return a json message.
57
+	 *
58
+	 * @param string                 $error_message
59
+	 * @param array                  $data
60
+	 * @param EE_Payment_Method|null $paypal_pm
61
+	 * @param mixed                  $object_logged
62
+	 * @param bool                   $popup_log
63
+	 * @return bool
64
+	 */
65
+	public static function errorLog(
66
+		string $error_message = '',
67
+		array $data = [],
68
+		?EE_Payment_Method $paypal_pm = null,
69
+		bool $popup_log = false,
70
+		$object_logged = null
71
+	): bool {
72
+		$default_msg = 'PayPal Commerce error';
73
+		if ($data) {
74
+			$data        = PayPalLogger::cleanDataArray($data);
75
+			$default_msg = $error_message;
76
+		}
77
+		try {
78
+			if (! $paypal_pm instanceof EE_Payment_Method) {
79
+				// Default to the standard PP Commerce PM.
80
+				$paypal_pm = EEM_Payment_Method::instance()->get_one_by_slug(Domain::PM_SLUG);
81
+			}
82
+			$paypal_gateway = $paypal_pm->type_obj()->get_gateway();
83
+			if ($paypal_gateway instanceof EE_Gateway) {
84
+				$paypal_gateway->log([$default_msg, $data], $object_logged);
85
+			}
86
+			if ($popup_log) {
87
+				PayPalLogger::logInWindow(json_encode($data));
88
+			}
89
+		} catch (ReflectionException | EE_Error $error) {
90
+			new ExceptionLogger($error);
91
+			return false;
92
+		}
93
+		// Yes, always return true.
94
+		return true;
95
+	}
96 96
 
97 97
 
98
-    /**
99
-     * Clean the array of data from sensitive information.
100
-     *
101
-     * @param array $data
102
-     * @return array
103
-     */
104
-    private static function cleanDataArray(array $data): array
105
-    {
106
-        $sensitive_data = [
107
-            'access_token',
108
-            'refresh_token',
109
-            'nonce',
110
-            'seller_nonce',
111
-            'client_secret',
112
-            Domain::API_KEY_AUTH_CODE,
113
-            'Authorization',
114
-            'merchantIdInPayPal',
115
-        ];
116
-        foreach ($data as $key => $value) {
117
-            if (is_string($value)) {
118
-                // Json encoded ?
119
-                $value = json_decode($value) ?? $value;
120
-            }
121
-            $value = is_array($value) ? PayPalLogger::cleanDataArray($value) : $value;
122
-            // Validate the data type. Some objects won't encode easily, so try getting from them some basic info.
123
-            if (is_object($value)) {
124
-                $obj_vars = get_object_vars($value);
125
-                $value    = ! empty($obj_vars) ? PayPalLogger::cleanDataArray($obj_vars) : get_class($value);
126
-            }
127
-            if (is_string($key) && in_array($key, $sensitive_data)) {
128
-                $data[ $key ] = empty($value) ? '**empty**' : '**hidden**';
129
-            } else {
130
-                $data[ $key ] = $value;
131
-            }
132
-        }
133
-        return $data;
134
-    }
98
+	/**
99
+	 * Clean the array of data from sensitive information.
100
+	 *
101
+	 * @param array $data
102
+	 * @return array
103
+	 */
104
+	private static function cleanDataArray(array $data): array
105
+	{
106
+		$sensitive_data = [
107
+			'access_token',
108
+			'refresh_token',
109
+			'nonce',
110
+			'seller_nonce',
111
+			'client_secret',
112
+			Domain::API_KEY_AUTH_CODE,
113
+			'Authorization',
114
+			'merchantIdInPayPal',
115
+		];
116
+		foreach ($data as $key => $value) {
117
+			if (is_string($value)) {
118
+				// Json encoded ?
119
+				$value = json_decode($value) ?? $value;
120
+			}
121
+			$value = is_array($value) ? PayPalLogger::cleanDataArray($value) : $value;
122
+			// Validate the data type. Some objects won't encode easily, so try getting from them some basic info.
123
+			if (is_object($value)) {
124
+				$obj_vars = get_object_vars($value);
125
+				$value    = ! empty($obj_vars) ? PayPalLogger::cleanDataArray($obj_vars) : get_class($value);
126
+			}
127
+			if (is_string($key) && in_array($key, $sensitive_data)) {
128
+				$data[ $key ] = empty($value) ? '**empty**' : '**hidden**';
129
+			} else {
130
+				$data[ $key ] = $value;
131
+			}
132
+		}
133
+		return $data;
134
+	}
135 135
 
136 136
 
137
-    /**
138
-     * Return error message as json allowing to show an alert on the front-end.
139
-     *
140
-     * @param string $error_message
141
-     * @param bool   $show_alert
142
-     * @return void
143
-     */
144
-    public static function exitWithJson(string $error_message = '', bool $show_alert = false)
145
-    {
146
-        wp_send_json(
147
-            [
148
-                'error'   => $error_message,
149
-                'message' => $error_message,
150
-                'alert'   => $show_alert,
151
-            ]
152
-        );
153
-    }
137
+	/**
138
+	 * Return error message as json allowing to show an alert on the front-end.
139
+	 *
140
+	 * @param string $error_message
141
+	 * @param bool   $show_alert
142
+	 * @return void
143
+	 */
144
+	public static function exitWithJson(string $error_message = '', bool $show_alert = false)
145
+	{
146
+		wp_send_json(
147
+			[
148
+				'error'   => $error_message,
149
+				'message' => $error_message,
150
+				'alert'   => $show_alert,
151
+			]
152
+		);
153
+	}
154 154
 
155 155
 
156
-    /**
157
-     * Close the OAuth window with JS.
158
-     *
159
-     * @param string $message
160
-     * @return void
161
-     */
162
-    public static function logInWindow(string $message): void
163
-    {
164
-        $js_out = '<script type="text/javascript">
156
+	/**
157
+	 * Close the OAuth window with JS.
158
+	 *
159
+	 * @param string $message
160
+	 * @return void
161
+	 */
162
+	public static function logInWindow(string $message): void
163
+	{
164
+		$js_out = '<script type="text/javascript">
165 165
                 if (window.opener) {
166 166
                     try {
167 167
                         window.opener.console.log("' . $message . '");
@@ -170,22 +170,22 @@  discard block
 block discarded – undo
170 170
                     }
171 171
                 }
172 172
             </script>';
173
-        echo $js_out;
174
-        wp_die();
175
-    }
173
+		echo $js_out;
174
+		wp_die();
175
+	}
176 176
 
177 177
 
178
-    /**
179
-     * Close the JS opened auth window.
180
-     *
181
-     * @param string $message
182
-     * @return void
183
-     */
184
-    public static function closeWindowAndExit(string $message = ''): void
185
-    {
186
-        $js_out = '<script type="text/javascript">';
187
-        if (! empty($message)) {
188
-            $js_out .= '
178
+	/**
179
+	 * Close the JS opened auth window.
180
+	 *
181
+	 * @param string $message
182
+	 * @return void
183
+	 */
184
+	public static function closeWindowAndExit(string $message = ''): void
185
+	{
186
+		$js_out = '<script type="text/javascript">';
187
+		if (! empty($message)) {
188
+			$js_out .= '
189 189
                 if (window.opener) {
190 190
                     try {
191 191
                         window.opener.console.log("' . $message . '");
@@ -194,11 +194,11 @@  discard block
 block discarded – undo
194 194
                     }
195 195
                 }
196 196
             ';
197
-        }
198
-        $js_out .= 'window.opener = self;
197
+		}
198
+		$js_out .= 'window.opener = self;
199 199
             window.close();
200 200
             </script>';
201
-        echo $js_out;
202
-        wp_die();
203
-    }
201
+		echo $js_out;
202
+		wp_die();
203
+	}
204 204
 }
Please login to merge, or discard this patch.
PaymentMethods/PayPalCommerce/PayPalCheckout/forms/BillingForm.php 1 patch
Indentation   +571 added lines, -571 removed lines patch added patch discarded remove patch
@@ -37,575 +37,575 @@
 block discarded – undo
37 37
  */
38 38
 class BillingForm extends EE_Billing_Attendee_Info_Form
39 39
 {
40
-    protected EE_Payment_Method $paypal_pmt;
41
-
42
-    protected ?EE_Transaction $transaction = null;
43
-
44
-    protected string $checkout_type;
45
-
46
-    /**
47
-     * Filepath to template files
48
-     *
49
-     * @var string $template_path
50
-     */
51
-    protected string $template_path;
52
-
53
-
54
-    /**
55
-     * Class constructor.
56
-     *
57
-     * @param EE_Payment_Method    $payment_method
58
-     * @param array                $options
59
-     * @throws EE_Error
60
-     * @throws ReflectionException
61
-     */
62
-    public function __construct(EE_Payment_Method $payment_method, array $options)
63
-    {
64
-        $this->paypal_pmt    = $payment_method;
65
-        // Can't be too careful.
66
-        $this->transaction   = $options['transaction'] ?? null;
67
-        $this->template_path = $options['template_path'] ?? '';
68
-        $this->checkout_type = $payment_method->get_extra_meta(
69
-            Domain::META_KEY_CHECKOUT_TYPE,
70
-            true,
71
-            'express_checkout'
72
-        );
73
-        $pm_slug             = $payment_method->slug();
74
-        $parameters          = array_replace_recursive(
75
-            $options,
76
-            [
77
-                'name'        => 'PayPalCommerceBillingForm',
78
-                'html_id'     => 'pp-' . $pm_slug . '-billing-form',
79
-                'html_class'  => 'pp_commerce_billing_form',
80
-                'subsections' => [
81
-                    'eea_paypal_commerce_token' => new EE_Hidden_Input(
82
-                        [
83
-                            'html_id'   => 'eea-paypal-commerce-token',
84
-                            'html_name' => 'EEA_paymentToken',
85
-                            'default'   => '',
86
-                        ]
87
-                    ),
88
-                    'pp_order_nonce'            => new EE_Hidden_Input(
89
-                        [
90
-                            'html_id'   => 'eea-' . $pm_slug . '-order-nonce',
91
-                            'html_name' => 'pp_order_nonce',
92
-                            'default'   => '',
93
-                        ]
94
-                    ),
95
-                    'pp_order_id'               => new EE_Hidden_Input(
96
-                        [
97
-                            'html_id'   => 'eea-' . $pm_slug . '-order-id',
98
-                            'html_name' => 'pp_order_id',
99
-                            'default'   => '',
100
-                        ]
101
-                    ),
102
-                    'pp_order_status'           => new EE_Hidden_Input(
103
-                        [
104
-                            'html_id'   => 'eea-' . $pm_slug . '-order-status',
105
-                            'html_name' => 'pp_order_status',
106
-                            'default'   => '',
107
-                        ]
108
-                    ),
109
-                ],
110
-            ]
111
-        );
112
-        // Add data tags to the PP script.
113
-        add_filter('script_loader_tag', [$this, 'addDataTagsToScript'], 10, 2);
114
-        parent::__construct($payment_method, $parameters);
115
-        // Add and exclude other sections.
116
-        $this->addPaymentSections();
117
-        // Additional actions and/or filters.
118
-        $this->loadActionsAndFilters();
119
-    }
120
-
121
-
122
-    /**
123
-     * Add PayPal payment sections.
124
-     *
125
-     * @return void
126
-     * @throws EE_Error
127
-     * @throws ReflectionException
128
-     */
129
-    public function addPaymentSections(): void
130
-    {
131
-        // Exclude the default billing form fields.
132
-        $this->exclude(
133
-            [
134
-                'first_name',
135
-                'last_name',
136
-                'email',
137
-            ]
138
-        );
139
-        // Add PayPal Hosted Fields.
140
-        if (! empty($this->checkout_type) && $this->checkout_type !== 'express_checkout') {
141
-            $this->addAdvancedCardFields();
142
-        }
143
-        // Add payment types separator, if both are enabled.
144
-        if ($this->checkout_type === 'all') {
145
-            $this->addTypesSeparator();
146
-        }
147
-        // Add PayPal Buttons section.
148
-        if ($this->checkout_type !== 'ppcp') {
149
-            $this->add_subsections(
150
-                [
151
-                    'paypal_commerce_pm_form' => $this->addPayPalCheckout(),
152
-                ]
153
-            );
154
-        }
155
-        // Exclude the rest billing form fields if the payment type is express checkout.
156
-        if ($this->checkout_type === 'express_checkout') {
157
-            $this->exclude(
158
-                [
159
-                    'address',
160
-                    'address2',
161
-                    'state',
162
-                    'phone',
163
-                    'city',
164
-                    'country',
165
-                    'zip',
166
-                ]
167
-            );
168
-            // Remove the Info subsection.
169
-            add_filter('FHEE__EE_Form_Section_Proper___construct__options_array', [$this, 'excludeInfoSubsection']);
170
-        }
171
-        $this->add_subsections(
172
-            [
173
-                'debug_content' => $this->addDebugContent($this->paypal_pmt),
174
-            ]
175
-        );
176
-    }
177
-
178
-
179
-    /**
180
-     * Additional actions and/or filters.
181
-     *
182
-     * @return void
183
-     */
184
-    public function loadActionsAndFilters(): void
185
-    {
186
-        add_filter(
187
-            'FHEE__EE_SPCO_Reg_Step_Payment_Options___get_billing_form_for_payment_method__billing_form',
188
-            [__CLASS__, 'excludeBillingFormFields'],
189
-            10,
190
-            2
191
-        );
192
-    }
193
-
194
-
195
-    /**
196
-     * Filter out billing form fields if pay button was used.
197
-     *
198
-     * @param EE_Billing_Info_Form $billing_form
199
-     * @param EE_Payment_Method    $payment_method
200
-     * @return EE_Billing_Info_Form
201
-     */
202
-    public static function excludeBillingFormFields(
203
-        EE_Billing_Info_Form $billing_form,
204
-        EE_Payment_Method $payment_method
205
-    ): EE_Billing_Info_Form {
206
-        $request        = LoaderFactory::getShared(Request::class);
207
-        $request_params = $request->requestParams();
208
-        // Only the PPC billing form.
209
-        if (! $billing_form instanceof BillingForm) {
210
-            return $billing_form;
211
-        }
212
-        // Make sure the billing form subsections have correct names.
213
-        $inputs = $billing_form->inputs_in_subsections();
214
-        if (
215
-            ! empty($request_params['process_form_submission'])
216
-            && $request_params['process_form_submission'] === '1'
217
-            && ! empty($request_params['eep_ppc_skip_form_validation'])
218
-        ) {
219
-            // Hide card info fields.
220
-            $billing_form->exclude(
221
-                [
222
-                    'pp_name_on_card',
223
-                    'address',
224
-                    'address2',
225
-                    'state',
226
-                    'phone',
227
-                    'city',
228
-                    'country',
229
-                    'zip',
230
-                ]
231
-            );
232
-        }
233
-        return $billing_form;
234
-    }
235
-
236
-
237
-    /**
238
-     * Add advanced card & debit card fields.
239
-     *
240
-     * @return void
241
-     * @throws EE_Error|ReflectionException
242
-     */
243
-    public function addAdvancedCardFields(): void
244
-    {
245
-        $pm_slug = $this->paypal_pmt->slug();
246
-        $this->add_subsections(
247
-            [
248
-                'pp_card_number'     => new EE_Form_Section_HTML(
249
-                    EEH_HTML::label(
250
-                        esc_html__('Card Number', 'event_espresso'),
251
-                        "$pm_slug-card-number-lbl",
252
-                        "$pm_slug-card-fields",
253
-                        "",
254
-                        'for="' . $pm_slug . '-card-number"'
255
-                    ) .
256
-                    EEH_HTML::p(
257
-                        "",
258
-                        "$pm_slug-card-number",
259
-                        "card_field $pm_slug-card-fields"
260
-                    )
261
-                ),
262
-                'pp_expiration_date' => new EE_Form_Section_HTML(
263
-                    EEH_HTML::label(
264
-                        esc_html__('Expiration Date', 'event_espresso'),
265
-                        "$pm_slug-expiration-date-lbl",
266
-                        "$pm_slug-card-fields",
267
-                        "",
268
-                        'for="' . $pm_slug . '-expiration-date"'
269
-                    ) .
270
-                    EEH_HTML::p(
271
-                        "",
272
-                        "$pm_slug-expiration-date",
273
-                        "card_field $pm_slug-card-fields"
274
-                    )
275
-                ),
276
-                'pp_card_cvv'        => new EE_Form_Section_HTML(
277
-                    EEH_HTML::label(
278
-                        esc_html__('CVV', 'event_espresso'),
279
-                        "$pm_slug-cvv-lbl",
280
-                        "$pm_slug-card-fields",
281
-                        "",
282
-                        'for="' . $pm_slug . '-cvv"'
283
-                    ) .
284
-                    EEH_HTML::p(
285
-                        "",
286
-                        "$pm_slug-cvv",
287
-                        "card_field $pm_slug-card-fields"
288
-                    )
289
-                ),
290
-                'pp_name_on_card'    => new EE_Text_Input(
291
-                    [
292
-                        'html_label_text' => esc_html__('Name On Card', 'event_espresso'),
293
-                        'html_id'         => $pm_slug . '-card-holder-name',
294
-                        'html_name'       => 'card-holder-name',
295
-                        'html_class'      => '',
296
-                        'required'        => true,
297
-                    ]
298
-                ),
299
-            ]
300
-        );
301
-        // Add the submit button at the end.
302
-        $this->add_subsections(
303
-            [
304
-                'pp_cc_submit' => new EE_Submit_Input(
305
-                    [
306
-                        'html_label_text' => esc_html__('Submit', 'event_espresso'),
307
-                        'html_id'         => $pm_slug,
308
-                        'html_class'      => 'eep-ppc-btn',
309
-                    ]
310
-                ),
311
-            ],
312
-            'phone',
313
-            false
314
-        );
315
-    }
316
-
317
-
318
-    /**
319
-     * Add advanced card & debit card fields.
320
-     *
321
-     * @return void
322
-     * @throws EE_Error|ReflectionException
323
-     */
324
-    public function addTypesSeparator(): void
325
-    {
326
-        $this->add_subsections(
327
-            [
328
-                'pp_payment_types_separator' => new EE_Form_Section_HTML(
329
-                    EEH_HTML::div(
330
-                        EEH_HTML::div(
331
-                            ' ',
332
-                            'eep-' . $this->paypal_pmt->slug() . '-payments-separator',
333
-                            'eep-ppc-separator-line eep-left-floating'
334
-                        ) .
335
-                        EEH_HTML::div(
336
-                            esc_html__(' or ', 'event_espresso'),
337
-                            'eep-' . $this->paypal_pmt->slug() . '-separator-text',
338
-                            'eep-ppc-separator-text1 eep-mid-floating'
339
-                        ) . EEH_HTML::div(
340
-                            ' ',
341
-                            'eep-' . $this->paypal_pmt->slug() . '-payments-separator',
342
-                            'eep-ppc-separator-line eep-right-floating'
343
-                        ),
344
-                        'eep-ppc-separator-holder',
345
-                        'eep-ppc-separator-holder'
346
-                    )
347
-                ),
348
-            ]
349
-        );
350
-    }
351
-
352
-
353
-    /**
354
-     * Exclude the info subsection from the PPC checkout form.
355
-     *
356
-     * @param array $options_array
357
-     * @return array
358
-     * @throws EE_Error
359
-     * @throws ReflectionException
360
-     */
361
-    public function excludeInfoSubsection(array $options_array): array
362
-    {
363
-        if (
364
-            ! empty($options_array['html_id'])
365
-            && $options_array['html_id'] === 'spco-payment-method-info-' . $this->paypal_pmt->slug()
366
-        ) {
367
-            if (! empty($options_array['subsections']) && isset($options_array['subsections']['info'])) {
368
-                unset($options_array['subsections']['info']);
369
-            }
370
-        }
371
-        return $options_array;
372
-    }
373
-
374
-
375
-    /**
376
-     * Possibly adds debug content to PayPal commerce billing form.
377
-     *
378
-     * @param EE_Payment_Method $paypal_pm
379
-     * @return EE_Form_Section_Base
380
-     * @throws EE_Error|ReflectionException
381
-     */
382
-    public function addDebugContent(EE_Payment_Method $paypal_pm): EE_Form_Section_Base
383
-    {
384
-        if ($paypal_pm->debug_mode()) {
385
-            return new EE_Form_Section_Proper(
386
-                [
387
-                    'layout_strategy' => new EE_Template_Layout(
388
-                        [
389
-                            'layout_template_file' => $this->template_path . 'debugInfo.template.php',
390
-                            'template_args'        => [],
391
-                        ]
392
-                    ),
393
-                ]
394
-            );
395
-        }
396
-        return new EE_Form_Section_HTML();
397
-    }
398
-
399
-
400
-    /**
401
-     * Add PayPal checkout buttons.
402
-     *
403
-     * @return EE_Form_Section_Proper
404
-     * @throws EE_Error
405
-     * @throws ReflectionException
406
-     * @throws Exception
407
-     */
408
-    public function addPayPalCheckout(): EE_Form_Section_Proper
409
-    {
410
-        $template_args['pm_slug']     = $this->paypal_pmt->slug();
411
-        return new EE_Form_Section_Proper(
412
-            [
413
-                'layout_strategy' => new EE_Template_Layout(
414
-                    [
415
-                        'layout_template_file' => $this->template_path . 'paymentButtons.template.php',
416
-                        'template_args'        => $template_args,
417
-                    ]
418
-                ),
419
-            ]
420
-        );
421
-    }
422
-
423
-
424
-    /**
425
-     * Load scripts and localize data needed for this form.
426
-     *
427
-     * @param $tag
428
-     * @param $handle
429
-     * @return string
430
-     * @throws EE_Error
431
-     * @throws ReflectionException
432
-     */
433
-    public function addDataTagsToScript($tag, $handle): string
434
-    {
435
-        if ($handle === 'eea_paypal_commerce_js_lib') {
436
-            $bn_code  = PayPalExtraMetaManager::getPmOption($this->_pm_instance, Domain::META_KEY_BN_CODE);
437
-            $response = EED_PayPalCommerce::requestClientToken($this->paypal_pmt);
438
-            if (empty($response['client_token'])) {
439
-                return $tag;
440
-            }
441
-            $client_token = $response['client_token'];
442
-            $attributes   = " data-partner-attribution-id=\"$bn_code\" data-client-token=\"$client_token\"";
443
-            $tag          = str_replace('></script>', $attributes . '></script>', $tag);
444
-        }
445
-        return $tag;
446
-    }
447
-
448
-
449
-    /**
450
-     * Load scripts and localize data needed for this form.
451
-     *
452
-     * @return void
453
-     * @throws EE_Error
454
-     * @throws ReflectionException
455
-     * @throws Exception
456
-     */
457
-    public function enqueue_js(): void
458
-    {
459
-        // Setup default values
460
-        $client_id_key = Domain::META_KEY_CLIENT_ID;
461
-        $merchant_id   = false;
462
-        $funding_options = ['venmo', 'paylater'];
463
-
464
-        // Override the above if thrid party integration
465
-        if (EED_PayPalCommerce::isThirdParty($this->_pm_instance)) {
466
-            $client_id_key = Domain::META_KEY_PARTNER_CLIENT_ID;
467
-            $merchant_id   = PayPalExtraMetaManager::getPmOption(
468
-                $this->_pm_instance,
469
-                Domain::META_KEY_SELLER_MERCHANT_ID
470
-            );
471
-        }
472
-
473
-        // Setup query args
474
-        $url_params            = [
475
-            'client-id'        => PayPalExtraMetaManager::getPmOption($this->_pm_instance, $client_id_key),
476
-            'currency'         => CurrencyManager::currencyCode(),
477
-            'components'       => implode(',', ['buttons','hosted-fields']),
478
-            'intent'           => 'capture',
479
-            'merchant-id'      => $merchant_id,
480
-        ];
481
-
482
-        // Which funding methods are active?
483
-        $enabled_funding = $this->_pm_instance->get_extra_meta(Domain::META_KEY_FUNDING_OPTIONS, true, $funding_options);
484
-
485
-        // Any funding method not enabled should be disabled.
486
-        $disabled_funding = array_diff(
487
-            $funding_options,
488
-            $enabled_funding
489
-        );
490
-
491
-        // Any funding options enabled?
492
-        if (count($enabled_funding) > 0) {
493
-            $url_params['enable-funding'] = implode(',', $enabled_funding);
494
-        }
495
-
496
-        // Any funding options disabled?
497
-        if (count($disabled_funding) > 0) {
498
-            $url_params['disable-funding'] = implode(',', $disabled_funding);
499
-        }
500
-
501
-        // Enqueue the PayPal JS
502
-        wp_enqueue_script(
503
-            'eea_paypal_commerce_js_lib',
504
-            add_query_arg($url_params, 'https://www.paypal.com/sdk/js'),
505
-            [],
506
-            null
507
-        );
508
-
509
-        wp_enqueue_script(
510
-            'eea_paypal_commerce_js',
511
-            EEP_PAYPAL_COMMERCE_URL . 'assets/js/paypal-commerce-payments.js',
512
-            ['eea_paypal_commerce_js_lib'],
513
-            EVENT_ESPRESSO_VERSION,
514
-            true
515
-        );
516
-        // Styles.
517
-        wp_enqueue_style(
518
-            'eea_paypal_checkout_form_styles',
519
-            EEP_PAYPAL_COMMERCE_URL . 'assets' . DS . 'css' . DS . 'eea-paypal-checkout.css',
520
-            [],
521
-            EVENT_ESPRESSO_VERSION
522
-        );
523
-        // Localize the script with our transaction data.
524
-        $parameters = $this->localizeParameters();
525
-        wp_localize_script('eea_paypal_commerce_js', 'eeaPPCommerceParameters', $parameters);
526
-        parent::enqueue_js();
527
-    }
528
-
529
-
530
-    /**
531
-     * Form and return PayPal commerce parameters for script localization.
532
-     *
533
-     * @return array
534
-     * @throws EE_Error
535
-     * @throws ReflectionException
536
-     * @throws Exception
537
-     */
538
-    public function localizeParameters(): array
539
-    {
540
-        // Also tell the script about each instance of this PM.
541
-        $pm_versions            = [];
542
-        $active_payment_methods = EEM_Payment_Method::instance()->get_all_active(
543
-            EEM_Payment_Method::scope_cart,
544
-            [['PMD_slug' => ['LIKE', '%paypalcheckout%']]]
545
-        );
546
-        foreach ($active_payment_methods as $payment_method) {
547
-            $pm_versions[ $payment_method->slug() ] = [
548
-                'pm_slug' => $payment_method->slug(),
549
-            ];
550
-        }
551
-        // Convert money for a display format.
552
-        $decimal_places = CurrencyManager::getDecimalPlaces();
553
-        $org_country    = isset(EE_Registry::instance()->CFG->organization)
554
-        && EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config
555
-            ? EE_Registry::instance()->CFG->organization->CNT_ISO
556
-            : 'US';
557
-        $transaction_id = $this->transaction instanceof EE_Transaction ? $this->transaction->ID() : 0;
558
-        $currency_code  = CurrencyManager::currencyCode();
559
-        return [
560
-            'pm_versions'            => $pm_versions,
561
-            'payment_currency'       => $currency_code,
562
-            'checkout_type'          => $this->checkout_type,
563
-            'currency_sign'          => EE_Registry::instance()->CFG->currency->sign,
564
-            'pp_order_nonce'         => wp_create_nonce(Domain::CAPTURE_ORDER_NONCE_NAME),
565
-            // The transaction ID is only used for logging errors.
566
-            'txn_id'                 => $transaction_id,
567
-            'org_country'            => $org_country,
568
-            'decimal_places'         => $decimal_places,
569
-            'site_name'              => get_bloginfo('name'),
570
-            'active_states'          => EED_PayPalCommerce::getActiveStates(),
571
-            'no_spco_error'          => esc_html__(
572
-                'It appears the SDK script was not loaded properly! Please refresh the page and try again or contact support.',
573
-                'event_espresso'
574
-            ),
575
-            'no_pm_error'            => esc_html__(
576
-                'It appears that PayPal Commerce checkout JavaScript was not loaded properly! Please refresh the page and try again or contact support. PayPal Commerce payments can\'t be processed.',
577
-                'event_espresso'
578
-            ),
579
-            'browser_not_supported'  => esc_html__(
580
-                'It appears that this browser is not supported by PayPal scripts. We apologize, but PayPal payments won\'t work in this browser version.',
581
-                'event_espresso'
582
-            ),
583
-            'get_token_error'        => esc_html__(
584
-                'There was an error while trying to get the payment token. Please refresh the page and try again or contact support.',
585
-                'event_espresso'
586
-            ),
587
-            'form_validation_notice' => esc_html__('Billing form information not valid.', 'event_espresso'),
588
-            'no_verification_token'  => esc_html__('Missing the Verification token.', 'event_espresso'),
589
-            'error_response'         => esc_html__('Error response received', 'event_espresso'),
590
-            'payment_error'          => esc_html__(
591
-                'There was an error with this payment. See the logs for details.',
592
-                'event_espresso'
593
-            ),
594
-            'no_order_id'            => esc_html__('No Order ID found.', 'event_espresso'),
595
-            'general_pp_error'       => esc_html__('PayPal form threw an error.', 'event_espresso'),
596
-            'hf_render_error'        => esc_html__('Hosted fields could not be rendered!', 'event_espresso'),
597
-            'pm_capture_error'       => esc_html__('Payment could not be captured!', 'event_espresso'),
598
-            'contact_support_msg'    => sprintf(
599
-                /* translators: %1$s: organization email, %2$s: the transaction ID */
600
-                esc_html__('Please contact support (%1$s) for more details on this transaction #%2$s.', 'event_espresso'),
601
-                EE_Registry::instance()->CFG->organization->get_pretty('email'),
602
-                $transaction_id
603
-            ),
604
-            'not_acdc_eligible'      => esc_html__(
605
-                'This merchant is not eligible for Advanced Card Fields checkout type.',
606
-                'event_espresso'
607
-            ),
608
-            'processor_response'     => esc_html__('Processor response: ', 'event_espresso'),
609
-        ];
610
-    }
40
+	protected EE_Payment_Method $paypal_pmt;
41
+
42
+	protected ?EE_Transaction $transaction = null;
43
+
44
+	protected string $checkout_type;
45
+
46
+	/**
47
+	 * Filepath to template files
48
+	 *
49
+	 * @var string $template_path
50
+	 */
51
+	protected string $template_path;
52
+
53
+
54
+	/**
55
+	 * Class constructor.
56
+	 *
57
+	 * @param EE_Payment_Method    $payment_method
58
+	 * @param array                $options
59
+	 * @throws EE_Error
60
+	 * @throws ReflectionException
61
+	 */
62
+	public function __construct(EE_Payment_Method $payment_method, array $options)
63
+	{
64
+		$this->paypal_pmt    = $payment_method;
65
+		// Can't be too careful.
66
+		$this->transaction   = $options['transaction'] ?? null;
67
+		$this->template_path = $options['template_path'] ?? '';
68
+		$this->checkout_type = $payment_method->get_extra_meta(
69
+			Domain::META_KEY_CHECKOUT_TYPE,
70
+			true,
71
+			'express_checkout'
72
+		);
73
+		$pm_slug             = $payment_method->slug();
74
+		$parameters          = array_replace_recursive(
75
+			$options,
76
+			[
77
+				'name'        => 'PayPalCommerceBillingForm',
78
+				'html_id'     => 'pp-' . $pm_slug . '-billing-form',
79
+				'html_class'  => 'pp_commerce_billing_form',
80
+				'subsections' => [
81
+					'eea_paypal_commerce_token' => new EE_Hidden_Input(
82
+						[
83
+							'html_id'   => 'eea-paypal-commerce-token',
84
+							'html_name' => 'EEA_paymentToken',
85
+							'default'   => '',
86
+						]
87
+					),
88
+					'pp_order_nonce'            => new EE_Hidden_Input(
89
+						[
90
+							'html_id'   => 'eea-' . $pm_slug . '-order-nonce',
91
+							'html_name' => 'pp_order_nonce',
92
+							'default'   => '',
93
+						]
94
+					),
95
+					'pp_order_id'               => new EE_Hidden_Input(
96
+						[
97
+							'html_id'   => 'eea-' . $pm_slug . '-order-id',
98
+							'html_name' => 'pp_order_id',
99
+							'default'   => '',
100
+						]
101
+					),
102
+					'pp_order_status'           => new EE_Hidden_Input(
103
+						[
104
+							'html_id'   => 'eea-' . $pm_slug . '-order-status',
105
+							'html_name' => 'pp_order_status',
106
+							'default'   => '',
107
+						]
108
+					),
109
+				],
110
+			]
111
+		);
112
+		// Add data tags to the PP script.
113
+		add_filter('script_loader_tag', [$this, 'addDataTagsToScript'], 10, 2);
114
+		parent::__construct($payment_method, $parameters);
115
+		// Add and exclude other sections.
116
+		$this->addPaymentSections();
117
+		// Additional actions and/or filters.
118
+		$this->loadActionsAndFilters();
119
+	}
120
+
121
+
122
+	/**
123
+	 * Add PayPal payment sections.
124
+	 *
125
+	 * @return void
126
+	 * @throws EE_Error
127
+	 * @throws ReflectionException
128
+	 */
129
+	public function addPaymentSections(): void
130
+	{
131
+		// Exclude the default billing form fields.
132
+		$this->exclude(
133
+			[
134
+				'first_name',
135
+				'last_name',
136
+				'email',
137
+			]
138
+		);
139
+		// Add PayPal Hosted Fields.
140
+		if (! empty($this->checkout_type) && $this->checkout_type !== 'express_checkout') {
141
+			$this->addAdvancedCardFields();
142
+		}
143
+		// Add payment types separator, if both are enabled.
144
+		if ($this->checkout_type === 'all') {
145
+			$this->addTypesSeparator();
146
+		}
147
+		// Add PayPal Buttons section.
148
+		if ($this->checkout_type !== 'ppcp') {
149
+			$this->add_subsections(
150
+				[
151
+					'paypal_commerce_pm_form' => $this->addPayPalCheckout(),
152
+				]
153
+			);
154
+		}
155
+		// Exclude the rest billing form fields if the payment type is express checkout.
156
+		if ($this->checkout_type === 'express_checkout') {
157
+			$this->exclude(
158
+				[
159
+					'address',
160
+					'address2',
161
+					'state',
162
+					'phone',
163
+					'city',
164
+					'country',
165
+					'zip',
166
+				]
167
+			);
168
+			// Remove the Info subsection.
169
+			add_filter('FHEE__EE_Form_Section_Proper___construct__options_array', [$this, 'excludeInfoSubsection']);
170
+		}
171
+		$this->add_subsections(
172
+			[
173
+				'debug_content' => $this->addDebugContent($this->paypal_pmt),
174
+			]
175
+		);
176
+	}
177
+
178
+
179
+	/**
180
+	 * Additional actions and/or filters.
181
+	 *
182
+	 * @return void
183
+	 */
184
+	public function loadActionsAndFilters(): void
185
+	{
186
+		add_filter(
187
+			'FHEE__EE_SPCO_Reg_Step_Payment_Options___get_billing_form_for_payment_method__billing_form',
188
+			[__CLASS__, 'excludeBillingFormFields'],
189
+			10,
190
+			2
191
+		);
192
+	}
193
+
194
+
195
+	/**
196
+	 * Filter out billing form fields if pay button was used.
197
+	 *
198
+	 * @param EE_Billing_Info_Form $billing_form
199
+	 * @param EE_Payment_Method    $payment_method
200
+	 * @return EE_Billing_Info_Form
201
+	 */
202
+	public static function excludeBillingFormFields(
203
+		EE_Billing_Info_Form $billing_form,
204
+		EE_Payment_Method $payment_method
205
+	): EE_Billing_Info_Form {
206
+		$request        = LoaderFactory::getShared(Request::class);
207
+		$request_params = $request->requestParams();
208
+		// Only the PPC billing form.
209
+		if (! $billing_form instanceof BillingForm) {
210
+			return $billing_form;
211
+		}
212
+		// Make sure the billing form subsections have correct names.
213
+		$inputs = $billing_form->inputs_in_subsections();
214
+		if (
215
+			! empty($request_params['process_form_submission'])
216
+			&& $request_params['process_form_submission'] === '1'
217
+			&& ! empty($request_params['eep_ppc_skip_form_validation'])
218
+		) {
219
+			// Hide card info fields.
220
+			$billing_form->exclude(
221
+				[
222
+					'pp_name_on_card',
223
+					'address',
224
+					'address2',
225
+					'state',
226
+					'phone',
227
+					'city',
228
+					'country',
229
+					'zip',
230
+				]
231
+			);
232
+		}
233
+		return $billing_form;
234
+	}
235
+
236
+
237
+	/**
238
+	 * Add advanced card & debit card fields.
239
+	 *
240
+	 * @return void
241
+	 * @throws EE_Error|ReflectionException
242
+	 */
243
+	public function addAdvancedCardFields(): void
244
+	{
245
+		$pm_slug = $this->paypal_pmt->slug();
246
+		$this->add_subsections(
247
+			[
248
+				'pp_card_number'     => new EE_Form_Section_HTML(
249
+					EEH_HTML::label(
250
+						esc_html__('Card Number', 'event_espresso'),
251
+						"$pm_slug-card-number-lbl",
252
+						"$pm_slug-card-fields",
253
+						"",
254
+						'for="' . $pm_slug . '-card-number"'
255
+					) .
256
+					EEH_HTML::p(
257
+						"",
258
+						"$pm_slug-card-number",
259
+						"card_field $pm_slug-card-fields"
260
+					)
261
+				),
262
+				'pp_expiration_date' => new EE_Form_Section_HTML(
263
+					EEH_HTML::label(
264
+						esc_html__('Expiration Date', 'event_espresso'),
265
+						"$pm_slug-expiration-date-lbl",
266
+						"$pm_slug-card-fields",
267
+						"",
268
+						'for="' . $pm_slug . '-expiration-date"'
269
+					) .
270
+					EEH_HTML::p(
271
+						"",
272
+						"$pm_slug-expiration-date",
273
+						"card_field $pm_slug-card-fields"
274
+					)
275
+				),
276
+				'pp_card_cvv'        => new EE_Form_Section_HTML(
277
+					EEH_HTML::label(
278
+						esc_html__('CVV', 'event_espresso'),
279
+						"$pm_slug-cvv-lbl",
280
+						"$pm_slug-card-fields",
281
+						"",
282
+						'for="' . $pm_slug . '-cvv"'
283
+					) .
284
+					EEH_HTML::p(
285
+						"",
286
+						"$pm_slug-cvv",
287
+						"card_field $pm_slug-card-fields"
288
+					)
289
+				),
290
+				'pp_name_on_card'    => new EE_Text_Input(
291
+					[
292
+						'html_label_text' => esc_html__('Name On Card', 'event_espresso'),
293
+						'html_id'         => $pm_slug . '-card-holder-name',
294
+						'html_name'       => 'card-holder-name',
295
+						'html_class'      => '',
296
+						'required'        => true,
297
+					]
298
+				),
299
+			]
300
+		);
301
+		// Add the submit button at the end.
302
+		$this->add_subsections(
303
+			[
304
+				'pp_cc_submit' => new EE_Submit_Input(
305
+					[
306
+						'html_label_text' => esc_html__('Submit', 'event_espresso'),
307
+						'html_id'         => $pm_slug,
308
+						'html_class'      => 'eep-ppc-btn',
309
+					]
310
+				),
311
+			],
312
+			'phone',
313
+			false
314
+		);
315
+	}
316
+
317
+
318
+	/**
319
+	 * Add advanced card & debit card fields.
320
+	 *
321
+	 * @return void
322
+	 * @throws EE_Error|ReflectionException
323
+	 */
324
+	public function addTypesSeparator(): void
325
+	{
326
+		$this->add_subsections(
327
+			[
328
+				'pp_payment_types_separator' => new EE_Form_Section_HTML(
329
+					EEH_HTML::div(
330
+						EEH_HTML::div(
331
+							' ',
332
+							'eep-' . $this->paypal_pmt->slug() . '-payments-separator',
333
+							'eep-ppc-separator-line eep-left-floating'
334
+						) .
335
+						EEH_HTML::div(
336
+							esc_html__(' or ', 'event_espresso'),
337
+							'eep-' . $this->paypal_pmt->slug() . '-separator-text',
338
+							'eep-ppc-separator-text1 eep-mid-floating'
339
+						) . EEH_HTML::div(
340
+							' ',
341
+							'eep-' . $this->paypal_pmt->slug() . '-payments-separator',
342
+							'eep-ppc-separator-line eep-right-floating'
343
+						),
344
+						'eep-ppc-separator-holder',
345
+						'eep-ppc-separator-holder'
346
+					)
347
+				),
348
+			]
349
+		);
350
+	}
351
+
352
+
353
+	/**
354
+	 * Exclude the info subsection from the PPC checkout form.
355
+	 *
356
+	 * @param array $options_array
357
+	 * @return array
358
+	 * @throws EE_Error
359
+	 * @throws ReflectionException
360
+	 */
361
+	public function excludeInfoSubsection(array $options_array): array
362
+	{
363
+		if (
364
+			! empty($options_array['html_id'])
365
+			&& $options_array['html_id'] === 'spco-payment-method-info-' . $this->paypal_pmt->slug()
366
+		) {
367
+			if (! empty($options_array['subsections']) && isset($options_array['subsections']['info'])) {
368
+				unset($options_array['subsections']['info']);
369
+			}
370
+		}
371
+		return $options_array;
372
+	}
373
+
374
+
375
+	/**
376
+	 * Possibly adds debug content to PayPal commerce billing form.
377
+	 *
378
+	 * @param EE_Payment_Method $paypal_pm
379
+	 * @return EE_Form_Section_Base
380
+	 * @throws EE_Error|ReflectionException
381
+	 */
382
+	public function addDebugContent(EE_Payment_Method $paypal_pm): EE_Form_Section_Base
383
+	{
384
+		if ($paypal_pm->debug_mode()) {
385
+			return new EE_Form_Section_Proper(
386
+				[
387
+					'layout_strategy' => new EE_Template_Layout(
388
+						[
389
+							'layout_template_file' => $this->template_path . 'debugInfo.template.php',
390
+							'template_args'        => [],
391
+						]
392
+					),
393
+				]
394
+			);
395
+		}
396
+		return new EE_Form_Section_HTML();
397
+	}
398
+
399
+
400
+	/**
401
+	 * Add PayPal checkout buttons.
402
+	 *
403
+	 * @return EE_Form_Section_Proper
404
+	 * @throws EE_Error
405
+	 * @throws ReflectionException
406
+	 * @throws Exception
407
+	 */
408
+	public function addPayPalCheckout(): EE_Form_Section_Proper
409
+	{
410
+		$template_args['pm_slug']     = $this->paypal_pmt->slug();
411
+		return new EE_Form_Section_Proper(
412
+			[
413
+				'layout_strategy' => new EE_Template_Layout(
414
+					[
415
+						'layout_template_file' => $this->template_path . 'paymentButtons.template.php',
416
+						'template_args'        => $template_args,
417
+					]
418
+				),
419
+			]
420
+		);
421
+	}
422
+
423
+
424
+	/**
425
+	 * Load scripts and localize data needed for this form.
426
+	 *
427
+	 * @param $tag
428
+	 * @param $handle
429
+	 * @return string
430
+	 * @throws EE_Error
431
+	 * @throws ReflectionException
432
+	 */
433
+	public function addDataTagsToScript($tag, $handle): string
434
+	{
435
+		if ($handle === 'eea_paypal_commerce_js_lib') {
436
+			$bn_code  = PayPalExtraMetaManager::getPmOption($this->_pm_instance, Domain::META_KEY_BN_CODE);
437
+			$response = EED_PayPalCommerce::requestClientToken($this->paypal_pmt);
438
+			if (empty($response['client_token'])) {
439
+				return $tag;
440
+			}
441
+			$client_token = $response['client_token'];
442
+			$attributes   = " data-partner-attribution-id=\"$bn_code\" data-client-token=\"$client_token\"";
443
+			$tag          = str_replace('></script>', $attributes . '></script>', $tag);
444
+		}
445
+		return $tag;
446
+	}
447
+
448
+
449
+	/**
450
+	 * Load scripts and localize data needed for this form.
451
+	 *
452
+	 * @return void
453
+	 * @throws EE_Error
454
+	 * @throws ReflectionException
455
+	 * @throws Exception
456
+	 */
457
+	public function enqueue_js(): void
458
+	{
459
+		// Setup default values
460
+		$client_id_key = Domain::META_KEY_CLIENT_ID;
461
+		$merchant_id   = false;
462
+		$funding_options = ['venmo', 'paylater'];
463
+
464
+		// Override the above if thrid party integration
465
+		if (EED_PayPalCommerce::isThirdParty($this->_pm_instance)) {
466
+			$client_id_key = Domain::META_KEY_PARTNER_CLIENT_ID;
467
+			$merchant_id   = PayPalExtraMetaManager::getPmOption(
468
+				$this->_pm_instance,
469
+				Domain::META_KEY_SELLER_MERCHANT_ID
470
+			);
471
+		}
472
+
473
+		// Setup query args
474
+		$url_params            = [
475
+			'client-id'        => PayPalExtraMetaManager::getPmOption($this->_pm_instance, $client_id_key),
476
+			'currency'         => CurrencyManager::currencyCode(),
477
+			'components'       => implode(',', ['buttons','hosted-fields']),
478
+			'intent'           => 'capture',
479
+			'merchant-id'      => $merchant_id,
480
+		];
481
+
482
+		// Which funding methods are active?
483
+		$enabled_funding = $this->_pm_instance->get_extra_meta(Domain::META_KEY_FUNDING_OPTIONS, true, $funding_options);
484
+
485
+		// Any funding method not enabled should be disabled.
486
+		$disabled_funding = array_diff(
487
+			$funding_options,
488
+			$enabled_funding
489
+		);
490
+
491
+		// Any funding options enabled?
492
+		if (count($enabled_funding) > 0) {
493
+			$url_params['enable-funding'] = implode(',', $enabled_funding);
494
+		}
495
+
496
+		// Any funding options disabled?
497
+		if (count($disabled_funding) > 0) {
498
+			$url_params['disable-funding'] = implode(',', $disabled_funding);
499
+		}
500
+
501
+		// Enqueue the PayPal JS
502
+		wp_enqueue_script(
503
+			'eea_paypal_commerce_js_lib',
504
+			add_query_arg($url_params, 'https://www.paypal.com/sdk/js'),
505
+			[],
506
+			null
507
+		);
508
+
509
+		wp_enqueue_script(
510
+			'eea_paypal_commerce_js',
511
+			EEP_PAYPAL_COMMERCE_URL . 'assets/js/paypal-commerce-payments.js',
512
+			['eea_paypal_commerce_js_lib'],
513
+			EVENT_ESPRESSO_VERSION,
514
+			true
515
+		);
516
+		// Styles.
517
+		wp_enqueue_style(
518
+			'eea_paypal_checkout_form_styles',
519
+			EEP_PAYPAL_COMMERCE_URL . 'assets' . DS . 'css' . DS . 'eea-paypal-checkout.css',
520
+			[],
521
+			EVENT_ESPRESSO_VERSION
522
+		);
523
+		// Localize the script with our transaction data.
524
+		$parameters = $this->localizeParameters();
525
+		wp_localize_script('eea_paypal_commerce_js', 'eeaPPCommerceParameters', $parameters);
526
+		parent::enqueue_js();
527
+	}
528
+
529
+
530
+	/**
531
+	 * Form and return PayPal commerce parameters for script localization.
532
+	 *
533
+	 * @return array
534
+	 * @throws EE_Error
535
+	 * @throws ReflectionException
536
+	 * @throws Exception
537
+	 */
538
+	public function localizeParameters(): array
539
+	{
540
+		// Also tell the script about each instance of this PM.
541
+		$pm_versions            = [];
542
+		$active_payment_methods = EEM_Payment_Method::instance()->get_all_active(
543
+			EEM_Payment_Method::scope_cart,
544
+			[['PMD_slug' => ['LIKE', '%paypalcheckout%']]]
545
+		);
546
+		foreach ($active_payment_methods as $payment_method) {
547
+			$pm_versions[ $payment_method->slug() ] = [
548
+				'pm_slug' => $payment_method->slug(),
549
+			];
550
+		}
551
+		// Convert money for a display format.
552
+		$decimal_places = CurrencyManager::getDecimalPlaces();
553
+		$org_country    = isset(EE_Registry::instance()->CFG->organization)
554
+		&& EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config
555
+			? EE_Registry::instance()->CFG->organization->CNT_ISO
556
+			: 'US';
557
+		$transaction_id = $this->transaction instanceof EE_Transaction ? $this->transaction->ID() : 0;
558
+		$currency_code  = CurrencyManager::currencyCode();
559
+		return [
560
+			'pm_versions'            => $pm_versions,
561
+			'payment_currency'       => $currency_code,
562
+			'checkout_type'          => $this->checkout_type,
563
+			'currency_sign'          => EE_Registry::instance()->CFG->currency->sign,
564
+			'pp_order_nonce'         => wp_create_nonce(Domain::CAPTURE_ORDER_NONCE_NAME),
565
+			// The transaction ID is only used for logging errors.
566
+			'txn_id'                 => $transaction_id,
567
+			'org_country'            => $org_country,
568
+			'decimal_places'         => $decimal_places,
569
+			'site_name'              => get_bloginfo('name'),
570
+			'active_states'          => EED_PayPalCommerce::getActiveStates(),
571
+			'no_spco_error'          => esc_html__(
572
+				'It appears the SDK script was not loaded properly! Please refresh the page and try again or contact support.',
573
+				'event_espresso'
574
+			),
575
+			'no_pm_error'            => esc_html__(
576
+				'It appears that PayPal Commerce checkout JavaScript was not loaded properly! Please refresh the page and try again or contact support. PayPal Commerce payments can\'t be processed.',
577
+				'event_espresso'
578
+			),
579
+			'browser_not_supported'  => esc_html__(
580
+				'It appears that this browser is not supported by PayPal scripts. We apologize, but PayPal payments won\'t work in this browser version.',
581
+				'event_espresso'
582
+			),
583
+			'get_token_error'        => esc_html__(
584
+				'There was an error while trying to get the payment token. Please refresh the page and try again or contact support.',
585
+				'event_espresso'
586
+			),
587
+			'form_validation_notice' => esc_html__('Billing form information not valid.', 'event_espresso'),
588
+			'no_verification_token'  => esc_html__('Missing the Verification token.', 'event_espresso'),
589
+			'error_response'         => esc_html__('Error response received', 'event_espresso'),
590
+			'payment_error'          => esc_html__(
591
+				'There was an error with this payment. See the logs for details.',
592
+				'event_espresso'
593
+			),
594
+			'no_order_id'            => esc_html__('No Order ID found.', 'event_espresso'),
595
+			'general_pp_error'       => esc_html__('PayPal form threw an error.', 'event_espresso'),
596
+			'hf_render_error'        => esc_html__('Hosted fields could not be rendered!', 'event_espresso'),
597
+			'pm_capture_error'       => esc_html__('Payment could not be captured!', 'event_espresso'),
598
+			'contact_support_msg'    => sprintf(
599
+				/* translators: %1$s: organization email, %2$s: the transaction ID */
600
+				esc_html__('Please contact support (%1$s) for more details on this transaction #%2$s.', 'event_espresso'),
601
+				EE_Registry::instance()->CFG->organization->get_pretty('email'),
602
+				$transaction_id
603
+			),
604
+			'not_acdc_eligible'      => esc_html__(
605
+				'This merchant is not eligible for Advanced Card Fields checkout type.',
606
+				'event_espresso'
607
+			),
608
+			'processor_response'     => esc_html__('Processor response: ', 'event_espresso'),
609
+		];
610
+	}
611 611
 }
Please login to merge, or discard this patch.
PaymentMethods/PayPalCommerce/PayPalCheckout/EEG_PayPalCheckout.gateway.php 2 patches
Indentation   +348 added lines, -348 removed lines patch added patch discarded remove patch
@@ -13,365 +13,365 @@
 block discarded – undo
13 13
  */
14 14
 class EEG_PayPalCheckout extends EE_Onsite_Gateway
15 15
 {
16
-    /**
17
-     * Currencies supported by this gateway.
18
-     *
19
-     * @var array
20
-     */
21
-    protected $_currencies_supported = [
22
-        'AUD',
23
-        'BRL',
24
-        'CAD',
25
-        'CNY',
26
-        'CZK',
27
-        'DKK',
28
-        'EUR',
29
-        'HKD',
30
-        'HUF',
31
-        'ILS',
32
-        'JPY',
33
-        'MYR',
34
-        'MXN',
35
-        'TWD',
36
-        'NZD',
37
-        'NOK',
38
-        'PHP',
39
-        'PLN',
40
-        'GBP',
41
-        'RUB',
42
-        'SGD',
43
-        'SEK',
44
-        'CHF',
45
-        'THB',
46
-        'USD',
47
-    ];
16
+	/**
17
+	 * Currencies supported by this gateway.
18
+	 *
19
+	 * @var array
20
+	 */
21
+	protected $_currencies_supported = [
22
+		'AUD',
23
+		'BRL',
24
+		'CAD',
25
+		'CNY',
26
+		'CZK',
27
+		'DKK',
28
+		'EUR',
29
+		'HKD',
30
+		'HUF',
31
+		'ILS',
32
+		'JPY',
33
+		'MYR',
34
+		'MXN',
35
+		'TWD',
36
+		'NZD',
37
+		'NOK',
38
+		'PHP',
39
+		'PLN',
40
+		'GBP',
41
+		'RUB',
42
+		'SGD',
43
+		'SEK',
44
+		'CHF',
45
+		'THB',
46
+		'USD',
47
+	];
48 48
 
49 49
 
50
-    /**
51
-     * Override the parent.
52
-     *
53
-     * @param EE_Payment|null $payment
54
-     * @param array|null      $billing_info
55
-     * @return EE_Payment
56
-     * @throws EE_Error|ReflectionException
57
-     */
58
-    public function do_direct_payment($payment, $billing_info = null)
59
-    {
60
-        $request         = LoaderFactory::getLoader()->getShared(RequestInterface::class);
61
-        $post_parameters = $request->postParams();
62
-        // Check the payment.
63
-        $payment = $this->validatePayment($payment, $request);
64
-        if ($payment->details() === 'error' && $payment->status() === EEM_Payment::status_id_failed) {
65
-            return $payment;
66
-        }
67
-        $transaction    = $payment->transaction();
68
-        $payment_method = $transaction->payment_method();
69
-        // Get the order details.
70
-        $order_id = $request->getRequestParam('pp_order_id');
71
-        if (! $order_id) {
72
-            return EEG_PayPalCheckout::updatePaymentStatus(
73
-                $payment,
74
-                EEM_Payment::status_id_declined,
75
-                $post_parameters,
76
-                esc_html__('Can\'t charge the Order. The Order ID is missing.', 'event_espresso')
77
-            );
78
-        }
79
-        // Capture the order.
80
-        $capture_status = EED_PayPalCommerce::captureOrder($transaction, $payment_method, $order_id);
81
-        // Check the order status.
82
-        $order_details  = EED_PayPalCommerce::getOrderDetails($order_id, $transaction, $payment_method);
83
-        $order_status   = $this->isOrderCompleted($order_details);
84
-        if (! $order_status['completed']) {
85
-            return EEG_PayPalCheckout::updatePaymentStatus(
86
-                $payment,
87
-                EEM_Payment::status_id_declined,
88
-                $order_details,
89
-                $order_status['message'] ?? ''
90
-            );
91
-        }
92
-        // Looks like all is good. Mark payment as a success.
93
-        $this->saveBillingDetails($payment, $transaction, $order_details, $billing_info);
94
-        return EEG_PayPalCheckout::updatePaymentStatus($payment, EEM_Payment::status_id_approved, $capture_status);
95
-    }
50
+	/**
51
+	 * Override the parent.
52
+	 *
53
+	 * @param EE_Payment|null $payment
54
+	 * @param array|null      $billing_info
55
+	 * @return EE_Payment
56
+	 * @throws EE_Error|ReflectionException
57
+	 */
58
+	public function do_direct_payment($payment, $billing_info = null)
59
+	{
60
+		$request         = LoaderFactory::getLoader()->getShared(RequestInterface::class);
61
+		$post_parameters = $request->postParams();
62
+		// Check the payment.
63
+		$payment = $this->validatePayment($payment, $request);
64
+		if ($payment->details() === 'error' && $payment->status() === EEM_Payment::status_id_failed) {
65
+			return $payment;
66
+		}
67
+		$transaction    = $payment->transaction();
68
+		$payment_method = $transaction->payment_method();
69
+		// Get the order details.
70
+		$order_id = $request->getRequestParam('pp_order_id');
71
+		if (! $order_id) {
72
+			return EEG_PayPalCheckout::updatePaymentStatus(
73
+				$payment,
74
+				EEM_Payment::status_id_declined,
75
+				$post_parameters,
76
+				esc_html__('Can\'t charge the Order. The Order ID is missing.', 'event_espresso')
77
+			);
78
+		}
79
+		// Capture the order.
80
+		$capture_status = EED_PayPalCommerce::captureOrder($transaction, $payment_method, $order_id);
81
+		// Check the order status.
82
+		$order_details  = EED_PayPalCommerce::getOrderDetails($order_id, $transaction, $payment_method);
83
+		$order_status   = $this->isOrderCompleted($order_details);
84
+		if (! $order_status['completed']) {
85
+			return EEG_PayPalCheckout::updatePaymentStatus(
86
+				$payment,
87
+				EEM_Payment::status_id_declined,
88
+				$order_details,
89
+				$order_status['message'] ?? ''
90
+			);
91
+		}
92
+		// Looks like all is good. Mark payment as a success.
93
+		$this->saveBillingDetails($payment, $transaction, $order_details, $billing_info);
94
+		return EEG_PayPalCheckout::updatePaymentStatus($payment, EEM_Payment::status_id_approved, $capture_status);
95
+	}
96 96
 
97 97
 
98
-    /**
99
-     * Validate the Order.
100
-     *
101
-     * @param array|null $order_details
102
-     * @return array ['completed' => {boolean}, 'message' => {string}]
103
-     */
104
-    public static function isOrderCompleted(?array $order_details): array
105
-    {
106
-        $conclusion = [
107
-            'completed' => false,
108
-            'details'   => $order_details,
109
-        ];
110
-        if (! $order_details) {
111
-            $conclusion['message'] = esc_html__(
112
-                'Could not validate this payment. The Order details were empty.',
113
-                'event_espresso'
114
-            );
115
-        } elseif (! empty($order_details['error'])) {
116
-            $conclusion['message'] = $order_details['message'] ?? $order_details['error'];
117
-        } elseif (empty($order_details['status'])) {
118
-            $conclusion['message'] = esc_html__(
119
-                'There was an error with this payment. The status of the Order could not be determined.',
120
-                'event_espresso'
121
-            );
122
-        } elseif ($order_details['purchase_units'][0]['payments']['captures'][0]['status'] !== 'COMPLETED') {
123
-            $conclusion['message'] = esc_html__(
124
-                'This payment was declined or failed validation. Please check the payment and billing information you provided.',
125
-                'event_espresso'
126
-            );
127
-        } elseif ($order_details['status'] !== 'COMPLETED') {
128
-            $conclusion['message'] = esc_html__(
129
-                'There was an error with this payment. Order was not approved.',
130
-                'event_espresso'
131
-            );
132
-        } else {
133
-            // If we didn't fail on the above, the Order should be considered valid.
134
-            $conclusion['completed'] = true;
135
-            $conclusion['message']   = esc_html__('Order Valid.', 'event_espresso');
136
-        }
137
-        return $conclusion;
138
-    }
98
+	/**
99
+	 * Validate the Order.
100
+	 *
101
+	 * @param array|null $order_details
102
+	 * @return array ['completed' => {boolean}, 'message' => {string}]
103
+	 */
104
+	public static function isOrderCompleted(?array $order_details): array
105
+	{
106
+		$conclusion = [
107
+			'completed' => false,
108
+			'details'   => $order_details,
109
+		];
110
+		if (! $order_details) {
111
+			$conclusion['message'] = esc_html__(
112
+				'Could not validate this payment. The Order details were empty.',
113
+				'event_espresso'
114
+			);
115
+		} elseif (! empty($order_details['error'])) {
116
+			$conclusion['message'] = $order_details['message'] ?? $order_details['error'];
117
+		} elseif (empty($order_details['status'])) {
118
+			$conclusion['message'] = esc_html__(
119
+				'There was an error with this payment. The status of the Order could not be determined.',
120
+				'event_espresso'
121
+			);
122
+		} elseif ($order_details['purchase_units'][0]['payments']['captures'][0]['status'] !== 'COMPLETED') {
123
+			$conclusion['message'] = esc_html__(
124
+				'This payment was declined or failed validation. Please check the payment and billing information you provided.',
125
+				'event_espresso'
126
+			);
127
+		} elseif ($order_details['status'] !== 'COMPLETED') {
128
+			$conclusion['message'] = esc_html__(
129
+				'There was an error with this payment. Order was not approved.',
130
+				'event_espresso'
131
+			);
132
+		} else {
133
+			// If we didn't fail on the above, the Order should be considered valid.
134
+			$conclusion['completed'] = true;
135
+			$conclusion['message']   = esc_html__('Order Valid.', 'event_espresso');
136
+		}
137
+		return $conclusion;
138
+	}
139 139
 
140 140
 
141
-    /**
142
-     * Set a payment error and log the data.
143
-     *
144
-     * @param EE_Payment   $payment
145
-     * @param string       $status
146
-     * @param array|string $response_data
147
-     * @param string       $update_message
148
-     * @return EE_Payment
149
-     * @throws EE_Error|ReflectionException
150
-     */
151
-    public static function updatePaymentStatus(
152
-        EE_Payment $payment,
153
-        string $status,
154
-        $response_data,
155
-        string $update_message = ''
156
-    ): EE_Payment {
157
-        $paypal_pm = ! empty($payment->payment_method())
158
-            ? EEM_Payment_Method::instance()->get_one_by_slug($payment->payment_method()->name())
159
-            : null;
160
-        // Is this a successful payment ?
161
-        if ($status === EEM_Payment::status_id_approved) {
162
-            $default_message = esc_html__('Successful payment.', 'event_espresso');
163
-            $amount          = $response_data['purchase_units'][0]['payments']['captures'][0]['amount']['value'] ?? 0;
164
-            // Don't set the amount if there is no info on that with this order.
165
-            if (! empty($amount)) {
166
-                $payment->set_amount((float) $amount);
167
-            }
168
-            $payment->set_txn_id_chq_nmbr(
169
-                $response_data['purchase_units'][0]['payments']['captures'][0]['id'] ?? $response_data['id']
170
-            );
171
-        } else {
172
-            $default_message = sprintf(
173
-                esc_html__(
174
-                    'Your payment could not be processed successfully due to an error.%1$sPlease try again or contact %2$s for assistance.',
175
-                    'event_espresso'
176
-                ),
177
-                '<br/>',
178
-                EE_Registry::instance()->CFG->organization->get_pretty('email')
179
-            );
180
-        }
181
-        // Try getting a better error message from the response.
182
-        $response_message = EEG_PayPalCheckout::getResponseMessage($response_data, $update_message ?: $default_message);
183
-        PayPalLogger::errorLog($response_message, $response_data, $paypal_pm, false, $payment->transaction());
184
-        $payment->set_status($status);
185
-        $payment->set_details($response_message);
186
-        $payment->set_gateway_response($response_message);
187
-        $payment->save();
188
-        return $payment;
189
-    }
141
+	/**
142
+	 * Set a payment error and log the data.
143
+	 *
144
+	 * @param EE_Payment   $payment
145
+	 * @param string       $status
146
+	 * @param array|string $response_data
147
+	 * @param string       $update_message
148
+	 * @return EE_Payment
149
+	 * @throws EE_Error|ReflectionException
150
+	 */
151
+	public static function updatePaymentStatus(
152
+		EE_Payment $payment,
153
+		string $status,
154
+		$response_data,
155
+		string $update_message = ''
156
+	): EE_Payment {
157
+		$paypal_pm = ! empty($payment->payment_method())
158
+			? EEM_Payment_Method::instance()->get_one_by_slug($payment->payment_method()->name())
159
+			: null;
160
+		// Is this a successful payment ?
161
+		if ($status === EEM_Payment::status_id_approved) {
162
+			$default_message = esc_html__('Successful payment.', 'event_espresso');
163
+			$amount          = $response_data['purchase_units'][0]['payments']['captures'][0]['amount']['value'] ?? 0;
164
+			// Don't set the amount if there is no info on that with this order.
165
+			if (! empty($amount)) {
166
+				$payment->set_amount((float) $amount);
167
+			}
168
+			$payment->set_txn_id_chq_nmbr(
169
+				$response_data['purchase_units'][0]['payments']['captures'][0]['id'] ?? $response_data['id']
170
+			);
171
+		} else {
172
+			$default_message = sprintf(
173
+				esc_html__(
174
+					'Your payment could not be processed successfully due to an error.%1$sPlease try again or contact %2$s for assistance.',
175
+					'event_espresso'
176
+				),
177
+				'<br/>',
178
+				EE_Registry::instance()->CFG->organization->get_pretty('email')
179
+			);
180
+		}
181
+		// Try getting a better error message from the response.
182
+		$response_message = EEG_PayPalCheckout::getResponseMessage($response_data, $update_message ?: $default_message);
183
+		PayPalLogger::errorLog($response_message, $response_data, $paypal_pm, false, $payment->transaction());
184
+		$payment->set_status($status);
185
+		$payment->set_details($response_message);
186
+		$payment->set_gateway_response($response_message);
187
+		$payment->save();
188
+		return $payment;
189
+	}
190 190
 
191 191
 
192
-    /**
193
-     * Validate the payment.
194
-     *
195
-     * @param array|string $response_data
196
-     * @param string|null  $message
197
-     * @return string
198
-     */
199
-    public static function getResponseMessage($response_data, ?string $message): string
200
-    {
201
-        $new_message = $message;
202
-        if (is_string($response_data)) {
203
-            // Try to decode.
204
-            $decoded_response = json_decode($response_data, true);
205
-            if ($decoded_response && is_array($decoded_response)) {
206
-                $response_data = $decoded_response;
207
-            }
208
-        }
209
-        if (is_array($response_data)) {
210
-            // Do we have a capture status ?
211
-            if (! empty($response_data['purchase_units']['0']['payments']['captures'][0]['status'])) {
212
-                $new_message .= sprintf(
213
-                    /* translators: 1: <br/><br/>, 2: payment capture status */
214
-                    esc_html__('%1$sPayment capture status: %2$s', 'event_espresso'),
215
-                    '<br/><br/>',
216
-                    $response_data['purchase_units']['0']['payments']['captures'][0]['status']
217
-                );
218
-            }
219
-            if (
220
-                ! empty($response_data['purchase_units']['0']['payments']['captures'][0]['processor_response'])
221
-                && is_array($response_data['purchase_units']['0']['payments']['captures'][0]['processor_response'])
222
-            ) {
223
-                $new_message .= sprintf(
224
-                    /* translators: 1: <br/><br/> */
225
-                    esc_html__('%1$sProcessor responded: ', 'event_espresso'),
226
-                    '<br/><br/>'
227
-                );
228
-                $processor_response = $response_data['purchase_units']['0']['payments']['captures'][0]['processor_response'];
229
-                $iteration = 1;
230
-                $foreach_count = count($processor_response);
231
-                foreach ($processor_response as $key => $value) {
232
-                    $new_message .= " $key: $value";
233
-                    $new_message .= $iteration < $foreach_count ? ', ' : '.';
234
-                    $iteration++;
235
-                }
236
-            }
237
-            if (
238
-                ! empty($response_data['details'][0]['description'])
239
-                && ! empty($response_data['details'][0]['issue'])
240
-            ) {
241
-                $iteration = 1;
242
-                $new_message .= sprintf(
243
-                    /* translators: 1: <br/><br/> */
244
-                    esc_html__('%1$sError details: ', 'event_espresso'),
245
-                    '<br/><br/>'
246
-                );
247
-                $foreach_count = count($response_data['details'][0]);
248
-                foreach ($response_data['details'][0] as $key => $value) {
249
-                    $new_message .= "$key: $value";
250
-                    $new_message .= $iteration < $foreach_count ? ', ' : '';
251
-                    $iteration++;
252
-                }
253
-            }
254
-        }
255
-        return $new_message;
256
-    }
192
+	/**
193
+	 * Validate the payment.
194
+	 *
195
+	 * @param array|string $response_data
196
+	 * @param string|null  $message
197
+	 * @return string
198
+	 */
199
+	public static function getResponseMessage($response_data, ?string $message): string
200
+	{
201
+		$new_message = $message;
202
+		if (is_string($response_data)) {
203
+			// Try to decode.
204
+			$decoded_response = json_decode($response_data, true);
205
+			if ($decoded_response && is_array($decoded_response)) {
206
+				$response_data = $decoded_response;
207
+			}
208
+		}
209
+		if (is_array($response_data)) {
210
+			// Do we have a capture status ?
211
+			if (! empty($response_data['purchase_units']['0']['payments']['captures'][0]['status'])) {
212
+				$new_message .= sprintf(
213
+					/* translators: 1: <br/><br/>, 2: payment capture status */
214
+					esc_html__('%1$sPayment capture status: %2$s', 'event_espresso'),
215
+					'<br/><br/>',
216
+					$response_data['purchase_units']['0']['payments']['captures'][0]['status']
217
+				);
218
+			}
219
+			if (
220
+				! empty($response_data['purchase_units']['0']['payments']['captures'][0]['processor_response'])
221
+				&& is_array($response_data['purchase_units']['0']['payments']['captures'][0]['processor_response'])
222
+			) {
223
+				$new_message .= sprintf(
224
+					/* translators: 1: <br/><br/> */
225
+					esc_html__('%1$sProcessor responded: ', 'event_espresso'),
226
+					'<br/><br/>'
227
+				);
228
+				$processor_response = $response_data['purchase_units']['0']['payments']['captures'][0]['processor_response'];
229
+				$iteration = 1;
230
+				$foreach_count = count($processor_response);
231
+				foreach ($processor_response as $key => $value) {
232
+					$new_message .= " $key: $value";
233
+					$new_message .= $iteration < $foreach_count ? ', ' : '.';
234
+					$iteration++;
235
+				}
236
+			}
237
+			if (
238
+				! empty($response_data['details'][0]['description'])
239
+				&& ! empty($response_data['details'][0]['issue'])
240
+			) {
241
+				$iteration = 1;
242
+				$new_message .= sprintf(
243
+					/* translators: 1: <br/><br/> */
244
+					esc_html__('%1$sError details: ', 'event_espresso'),
245
+					'<br/><br/>'
246
+				);
247
+				$foreach_count = count($response_data['details'][0]);
248
+				foreach ($response_data['details'][0] as $key => $value) {
249
+					$new_message .= "$key: $value";
250
+					$new_message .= $iteration < $foreach_count ? ', ' : '';
251
+					$iteration++;
252
+				}
253
+			}
254
+		}
255
+		return $new_message;
256
+	}
257 257
 
258 258
 
259
-    /**
260
-     * Validate the payment.
261
-     *
262
-     * @param EE_Payment|null  $payment
263
-     * @param RequestInterface $request
264
-     * @return EE_Payment
265
-     * @throws EE_Error
266
-     * @throws ReflectionException
267
-     */
268
-    public function validatePayment(?EE_Payment $payment, RequestInterface $request): EE_Payment
269
-    {
270
-        $failed_status = $this->_pay_model->failed_status();
271
-        // Check the payment.
272
-        if (! $payment instanceof EE_Payment) {
273
-            $payment       = EE_Payment::new_instance();
274
-            $error_message = esc_html__('Error. No associated payment was found.', 'event_espresso');
275
-            return EEG_PayPalCheckout::updatePaymentStatus(
276
-                $payment,
277
-                $failed_status,
278
-                $request->postParams(),
279
-                $error_message
280
-            );
281
-        }
282
-        // Check the transaction.
283
-        $transaction = $payment->transaction();
284
-        if (! $transaction instanceof EE_Transaction) {
285
-            $error_message = esc_html__(
286
-                'Could not process this payment because it has no associated transaction.',
287
-                'event_espresso'
288
-            );
289
-            return EEG_PayPalCheckout::updatePaymentStatus(
290
-                $payment,
291
-                $failed_status,
292
-                $request->postParams(),
293
-                $error_message
294
-            );
295
-        }
296
-        return $payment;
297
-    }
259
+	/**
260
+	 * Validate the payment.
261
+	 *
262
+	 * @param EE_Payment|null  $payment
263
+	 * @param RequestInterface $request
264
+	 * @return EE_Payment
265
+	 * @throws EE_Error
266
+	 * @throws ReflectionException
267
+	 */
268
+	public function validatePayment(?EE_Payment $payment, RequestInterface $request): EE_Payment
269
+	{
270
+		$failed_status = $this->_pay_model->failed_status();
271
+		// Check the payment.
272
+		if (! $payment instanceof EE_Payment) {
273
+			$payment       = EE_Payment::new_instance();
274
+			$error_message = esc_html__('Error. No associated payment was found.', 'event_espresso');
275
+			return EEG_PayPalCheckout::updatePaymentStatus(
276
+				$payment,
277
+				$failed_status,
278
+				$request->postParams(),
279
+				$error_message
280
+			);
281
+		}
282
+		// Check the transaction.
283
+		$transaction = $payment->transaction();
284
+		if (! $transaction instanceof EE_Transaction) {
285
+			$error_message = esc_html__(
286
+				'Could not process this payment because it has no associated transaction.',
287
+				'event_espresso'
288
+			);
289
+			return EEG_PayPalCheckout::updatePaymentStatus(
290
+				$payment,
291
+				$failed_status,
292
+				$request->postParams(),
293
+				$error_message
294
+			);
295
+		}
296
+		return $payment;
297
+	}
298 298
 
299 299
 
300
-    /**
301
-     * Save some transaction details, like billing information.
302
-     *
303
-     * @param EE_Payment     $payment
304
-     * @param EE_Transaction $transaction
305
-     * @param array          $order
306
-     * @param array          $billing
307
-     * @return void
308
-     * @throws EE_Error
309
-     * @throws ReflectionException
310
-     */
311
-    public static function saveBillingDetails(
312
-        EE_Payment $payment,
313
-        EE_Transaction $transaction,
314
-        array $order,
315
-        array $billing
316
-    ): void {
317
-        $primary_reg = $transaction->primary_registration();
318
-        $att    = $primary_reg instanceof EE_Registration ? $primary_reg->attendee() : null;
319
-        if (! $att instanceof EE_Attendee) {
320
-            // I guess we are done here then. Just save what we have.
321
-            $payment->set_details($order);
322
-            return;
323
-        }
324
-        // Defaults:
325
-        $billing['credit_card'] = 'empty';
326
-        $billing['first_name']  = empty($billing['first_name']) ? ($att->fname() ?: 'empty') : $billing['first_name'];
327
-        $billing['last_name']   = empty($billing['last_name']) ? ($att->lname() ?: 'empty') : $billing['last_name'];
328
-        $billing['email']       = empty($billing['email']) ? ($att->email() ?: 'empty') : $billing['email'];
329
-        $billing['country']     = empty($billing['country']) ? ($att->country() ?: 'empty') : $billing['country'];
330
-        $billing['city']        = empty($billing['city']) ? ($att->city() ?: 'empty') : $billing['city'];
331
-        $billing['state']       = empty($billing['state']) ? ($att->state_name() ?: 'empty') : $billing['state'];
332
-        $billing['address']     = empty($billing['address']) ? ($att->address() ?: 'empty') : $billing['address'];
333
-        $billing['address2']    = empty($billing['address2']) ? ($att->address2() ?: 'empty') : $billing['address2'];
334
-        $billing['zip']         = empty($billing['zip']) ? ($att->zip() ?: 'empty') : $billing['zip'];
335
-        $billing['phone']       = empty($billing['phone']) ? ($att->phone() ?: 'empty') : $billing['phone'];
300
+	/**
301
+	 * Save some transaction details, like billing information.
302
+	 *
303
+	 * @param EE_Payment     $payment
304
+	 * @param EE_Transaction $transaction
305
+	 * @param array          $order
306
+	 * @param array          $billing
307
+	 * @return void
308
+	 * @throws EE_Error
309
+	 * @throws ReflectionException
310
+	 */
311
+	public static function saveBillingDetails(
312
+		EE_Payment $payment,
313
+		EE_Transaction $transaction,
314
+		array $order,
315
+		array $billing
316
+	): void {
317
+		$primary_reg = $transaction->primary_registration();
318
+		$att    = $primary_reg instanceof EE_Registration ? $primary_reg->attendee() : null;
319
+		if (! $att instanceof EE_Attendee) {
320
+			// I guess we are done here then. Just save what we have.
321
+			$payment->set_details($order);
322
+			return;
323
+		}
324
+		// Defaults:
325
+		$billing['credit_card'] = 'empty';
326
+		$billing['first_name']  = empty($billing['first_name']) ? ($att->fname() ?: 'empty') : $billing['first_name'];
327
+		$billing['last_name']   = empty($billing['last_name']) ? ($att->lname() ?: 'empty') : $billing['last_name'];
328
+		$billing['email']       = empty($billing['email']) ? ($att->email() ?: 'empty') : $billing['email'];
329
+		$billing['country']     = empty($billing['country']) ? ($att->country() ?: 'empty') : $billing['country'];
330
+		$billing['city']        = empty($billing['city']) ? ($att->city() ?: 'empty') : $billing['city'];
331
+		$billing['state']       = empty($billing['state']) ? ($att->state_name() ?: 'empty') : $billing['state'];
332
+		$billing['address']     = empty($billing['address']) ? ($att->address() ?: 'empty') : $billing['address'];
333
+		$billing['address2']    = empty($billing['address2']) ? ($att->address2() ?: 'empty') : $billing['address2'];
334
+		$billing['zip']         = empty($billing['zip']) ? ($att->zip() ?: 'empty') : $billing['zip'];
335
+		$billing['phone']       = empty($billing['phone']) ? ($att->phone() ?: 'empty') : $billing['phone'];
336 336
 
337
-        // Try getting the payer information from the payment source (PayPal).
338
-        if (! empty($order['payment_source'])) {
339
-            // A card (ACDC) payment ?
340
-            if (! empty($order['payment_source']['card'])) {
341
-                $payer = $order['payment_source']['card'];
342
-            // Or maybe a PayPal Express payment ?
343
-            } elseif (! empty($order['payment_source']['paypal'])) {
344
-                $payer = $order['payment_source']['paypal'];
345
-            }
346
-            if (! empty($payer)) {
347
-                if (! empty($payer['name'])) {
348
-                    // Yup, payment_source card vs PayPal have different info about the payer. So need to differentiate.
349
-                    if (is_string($payer['name'])) {
350
-                        $full_name                  = explode(' ', $payer['name']);
351
-                        $billing['first_name'] = $full_name[0] ?? $billing['first_name'];
352
-                        $billing['last_name']  = $full_name[1] ?? $billing['last_name'];
353
-                    }
354
-                    // PayPal info on the Payment:
355
-                    if (is_array($payer['name'])) {
356
-                        $billing['first_name'] = $payer['name']['given_name'] ?? $billing['first_name'];
357
-                        $billing['last_name']  = $payer['name']['surname'] ?? $billing['last_name'];
358
-                    }
359
-                }
360
-                // Possible info on the payer.
361
-                $billing['credit_card'] = $payer['last_digits'] ?? $billing['credit_card'];
362
-                $billing['email']       = $payer['email_address'] ?? $billing['email'];
363
-                $billing['country']     = $payer['address']['country_code'] ?? $billing['country'];
364
-                $billing['city']        = $payer['address']['city'] ?? $billing['city'];
365
-                $billing['state']       = $payer['address']['state'] ?? $billing['state'];
366
-                $billing['address']     = $payer['address']['address'] ?? $billing['address'];
367
-                $billing['zip']         = $payer['address']['zip'] ?? $billing['zip'];
368
-            }
369
-        }
370
-        // Update attendee billing info in the transaction details.
371
-        $payment_method = $transaction->payment_method();
372
-        $post_meta_name = $payment_method->type_obj() instanceof EE_PMT_Base
373
-            ? 'billing_info_' . $payment_method->type_obj()->system_name()
374
-            : '';
375
-        update_post_meta($att->ID(), $post_meta_name, $billing);
376
-    }
337
+		// Try getting the payer information from the payment source (PayPal).
338
+		if (! empty($order['payment_source'])) {
339
+			// A card (ACDC) payment ?
340
+			if (! empty($order['payment_source']['card'])) {
341
+				$payer = $order['payment_source']['card'];
342
+			// Or maybe a PayPal Express payment ?
343
+			} elseif (! empty($order['payment_source']['paypal'])) {
344
+				$payer = $order['payment_source']['paypal'];
345
+			}
346
+			if (! empty($payer)) {
347
+				if (! empty($payer['name'])) {
348
+					// Yup, payment_source card vs PayPal have different info about the payer. So need to differentiate.
349
+					if (is_string($payer['name'])) {
350
+						$full_name                  = explode(' ', $payer['name']);
351
+						$billing['first_name'] = $full_name[0] ?? $billing['first_name'];
352
+						$billing['last_name']  = $full_name[1] ?? $billing['last_name'];
353
+					}
354
+					// PayPal info on the Payment:
355
+					if (is_array($payer['name'])) {
356
+						$billing['first_name'] = $payer['name']['given_name'] ?? $billing['first_name'];
357
+						$billing['last_name']  = $payer['name']['surname'] ?? $billing['last_name'];
358
+					}
359
+				}
360
+				// Possible info on the payer.
361
+				$billing['credit_card'] = $payer['last_digits'] ?? $billing['credit_card'];
362
+				$billing['email']       = $payer['email_address'] ?? $billing['email'];
363
+				$billing['country']     = $payer['address']['country_code'] ?? $billing['country'];
364
+				$billing['city']        = $payer['address']['city'] ?? $billing['city'];
365
+				$billing['state']       = $payer['address']['state'] ?? $billing['state'];
366
+				$billing['address']     = $payer['address']['address'] ?? $billing['address'];
367
+				$billing['zip']         = $payer['address']['zip'] ?? $billing['zip'];
368
+			}
369
+		}
370
+		// Update attendee billing info in the transaction details.
371
+		$payment_method = $transaction->payment_method();
372
+		$post_meta_name = $payment_method->type_obj() instanceof EE_PMT_Base
373
+			? 'billing_info_' . $payment_method->type_obj()->system_name()
374
+			: '';
375
+		update_post_meta($att->ID(), $post_meta_name, $billing);
376
+	}
377 377
 }
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         $payment_method = $transaction->payment_method();
69 69
         // Get the order details.
70 70
         $order_id = $request->getRequestParam('pp_order_id');
71
-        if (! $order_id) {
71
+        if ( ! $order_id) {
72 72
             return EEG_PayPalCheckout::updatePaymentStatus(
73 73
                 $payment,
74 74
                 EEM_Payment::status_id_declined,
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         // Check the order status.
82 82
         $order_details  = EED_PayPalCommerce::getOrderDetails($order_id, $transaction, $payment_method);
83 83
         $order_status   = $this->isOrderCompleted($order_details);
84
-        if (! $order_status['completed']) {
84
+        if ( ! $order_status['completed']) {
85 85
             return EEG_PayPalCheckout::updatePaymentStatus(
86 86
                 $payment,
87 87
                 EEM_Payment::status_id_declined,
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
             'completed' => false,
108 108
             'details'   => $order_details,
109 109
         ];
110
-        if (! $order_details) {
110
+        if ( ! $order_details) {
111 111
             $conclusion['message'] = esc_html__(
112 112
                 'Could not validate this payment. The Order details were empty.',
113 113
                 'event_espresso'
114 114
             );
115
-        } elseif (! empty($order_details['error'])) {
115
+        } elseif ( ! empty($order_details['error'])) {
116 116
             $conclusion['message'] = $order_details['message'] ?? $order_details['error'];
117 117
         } elseif (empty($order_details['status'])) {
118 118
             $conclusion['message'] = esc_html__(
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             $default_message = esc_html__('Successful payment.', 'event_espresso');
163 163
             $amount          = $response_data['purchase_units'][0]['payments']['captures'][0]['amount']['value'] ?? 0;
164 164
             // Don't set the amount if there is no info on that with this order.
165
-            if (! empty($amount)) {
165
+            if ( ! empty($amount)) {
166 166
                 $payment->set_amount((float) $amount);
167 167
             }
168 168
             $payment->set_txn_id_chq_nmbr(
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
         }
209 209
         if (is_array($response_data)) {
210 210
             // Do we have a capture status ?
211
-            if (! empty($response_data['purchase_units']['0']['payments']['captures'][0]['status'])) {
211
+            if ( ! empty($response_data['purchase_units']['0']['payments']['captures'][0]['status'])) {
212 212
                 $new_message .= sprintf(
213 213
                     /* translators: 1: <br/><br/>, 2: payment capture status */
214 214
                     esc_html__('%1$sPayment capture status: %2$s', 'event_espresso'),
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
     {
270 270
         $failed_status = $this->_pay_model->failed_status();
271 271
         // Check the payment.
272
-        if (! $payment instanceof EE_Payment) {
272
+        if ( ! $payment instanceof EE_Payment) {
273 273
             $payment       = EE_Payment::new_instance();
274 274
             $error_message = esc_html__('Error. No associated payment was found.', 'event_espresso');
275 275
             return EEG_PayPalCheckout::updatePaymentStatus(
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
         }
282 282
         // Check the transaction.
283 283
         $transaction = $payment->transaction();
284
-        if (! $transaction instanceof EE_Transaction) {
284
+        if ( ! $transaction instanceof EE_Transaction) {
285 285
             $error_message = esc_html__(
286 286
                 'Could not process this payment because it has no associated transaction.',
287 287
                 'event_espresso'
@@ -315,8 +315,8 @@  discard block
 block discarded – undo
315 315
         array $billing
316 316
     ): void {
317 317
         $primary_reg = $transaction->primary_registration();
318
-        $att    = $primary_reg instanceof EE_Registration ? $primary_reg->attendee() : null;
319
-        if (! $att instanceof EE_Attendee) {
318
+        $att = $primary_reg instanceof EE_Registration ? $primary_reg->attendee() : null;
319
+        if ( ! $att instanceof EE_Attendee) {
320 320
             // I guess we are done here then. Just save what we have.
321 321
             $payment->set_details($order);
322 322
             return;
@@ -335,19 +335,19 @@  discard block
 block discarded – undo
335 335
         $billing['phone']       = empty($billing['phone']) ? ($att->phone() ?: 'empty') : $billing['phone'];
336 336
 
337 337
         // Try getting the payer information from the payment source (PayPal).
338
-        if (! empty($order['payment_source'])) {
338
+        if ( ! empty($order['payment_source'])) {
339 339
             // A card (ACDC) payment ?
340
-            if (! empty($order['payment_source']['card'])) {
340
+            if ( ! empty($order['payment_source']['card'])) {
341 341
                 $payer = $order['payment_source']['card'];
342 342
             // Or maybe a PayPal Express payment ?
343
-            } elseif (! empty($order['payment_source']['paypal'])) {
343
+            } elseif ( ! empty($order['payment_source']['paypal'])) {
344 344
                 $payer = $order['payment_source']['paypal'];
345 345
             }
346
-            if (! empty($payer)) {
347
-                if (! empty($payer['name'])) {
346
+            if ( ! empty($payer)) {
347
+                if ( ! empty($payer['name'])) {
348 348
                     // Yup, payment_source card vs PayPal have different info about the payer. So need to differentiate.
349 349
                     if (is_string($payer['name'])) {
350
-                        $full_name                  = explode(' ', $payer['name']);
350
+                        $full_name = explode(' ', $payer['name']);
351 351
                         $billing['first_name'] = $full_name[0] ?? $billing['first_name'];
352 352
                         $billing['last_name']  = $full_name[1] ?? $billing['last_name'];
353 353
                     }
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
         // Update attendee billing info in the transaction details.
371 371
         $payment_method = $transaction->payment_method();
372 372
         $post_meta_name = $payment_method->type_obj() instanceof EE_PMT_Base
373
-            ? 'billing_info_' . $payment_method->type_obj()->system_name()
373
+            ? 'billing_info_'.$payment_method->type_obj()->system_name()
374 374
             : '';
375 375
         update_post_meta($att->ID(), $post_meta_name, $billing);
376 376
     }
Please login to merge, or discard this patch.
PaymentMethods/PayPalCommerce/api/orders/CreateOrder.php 2 patches
Indentation   +397 added lines, -397 removed lines patch added patch discarded remove patch
@@ -30,401 +30,401 @@
 block discarded – undo
30 30
  */
31 31
 class CreateOrder extends OrdersApi
32 32
 {
33
-    /**
34
-     * Line items total.
35
-     *
36
-     * @var float
37
-     */
38
-    protected float $items_total = 0.0;
39
-
40
-    /**
41
-     * Promotions total.
42
-     *
43
-     * @var float
44
-     */
45
-    protected float $promos_total = 0.0;
46
-
47
-    /**
48
-     * Tax total.
49
-     *
50
-     * @var float
51
-     */
52
-    protected float $tax_total = 0.0;
53
-
54
-    /**
55
-     * Currency.
56
-     *
57
-     * @var string
58
-     */
59
-    protected string $currency_code;
60
-
61
-    /**
62
-     * Billing info.
63
-     *
64
-     * @var array
65
-     */
66
-    protected array $billing_info;
67
-
68
-    /**
69
-     * Transaction this order is for.
70
-     *
71
-     * @var EE_Transaction
72
-     */
73
-    protected EE_Transaction $transaction;
74
-
75
-    private FeatureFlags $feature;
76
-
77
-
78
-    /**
79
-     * CreateOrder constructor.
80
-     *
81
-     * @param PayPalApi      $api
82
-     * @param EE_Transaction $transaction
83
-     * @param array          $billing_info
84
-     * @param FeatureFlags   $feature
85
-     */
86
-    public function __construct(PayPalApi $api, EE_Transaction $transaction, array $billing_info, FeatureFlags $feature)
87
-    {
88
-        parent::__construct($api);
89
-        $this->transaction   = $transaction;
90
-        $this->feature       = $feature;
91
-        $this->currency_code = CurrencyManager::currencyCode();
92
-        $this->sanitizeRequestParameters($billing_info);
93
-    }
94
-
95
-
96
-    /**
97
-     * Sanitize the array of billing form data.
98
-     *
99
-     * @param array $billing_info
100
-     * @return void
101
-     */
102
-    public function sanitizeRequestParameters(array $billing_info): void
103
-    {
104
-        $sanitizer = new RequestSanitizer(new Basic());
105
-        foreach ($billing_info as $item => $value) {
106
-            $this->billing_info[ $item ] = $sanitizer->clean($value);
107
-        }
108
-    }
109
-
110
-
111
-    /**
112
-     * Create PayPal Order.
113
-     *
114
-     * @return array
115
-     * @throws EE_Error
116
-     * @throws ReflectionException
117
-     */
118
-    public function create(): array
119
-    {
120
-        $order_parameters = $this->getParameters();
121
-        // Create Order request.
122
-        $create_response = $this->api->sendRequest($order_parameters, $this->request_url);
123
-        // Check for MISMATCH errors.
124
-        if ($this->isMismatchError($create_response)) {
125
-            // Mismatch, fix items.
126
-            $order_parameters['purchase_units'][0]['items'] = $this->getSimplifiedItems();
127
-            // Add simplified breakdown.
128
-            $order_parameters['purchase_units'][0]['amount']['breakdown'] = $this->getSimplifiedAmountBreakdown();
129
-            // Retry Order request.
130
-            $create_response = $this->api->sendRequest($order_parameters, $this->request_url);
131
-        }
132
-        return $this->validateOrder($create_response, $order_parameters);
133
-    }
134
-
135
-
136
-    /**
137
-     * Form order parameters.
138
-     *
139
-     * @return array
140
-     * @throws EE_Error
141
-     * @throws ReflectionException
142
-     * @throws Exception
143
-     */
144
-    protected function getParameters(): array
145
-    {
146
-        $registrant  = $this->transaction->primary_registration();
147
-        $attendee    = $registrant->attendee();
148
-        $event       = $registrant->event();
149
-        $description = $event->name() ?: sprintf(
150
-            esc_html__('Tickets for an event at %1$s', 'event_espresso'),
151
-            get_bloginfo('name')
152
-        );
153
-        $parameters  = [
154
-            'intent'              => 'CAPTURE',
155
-            'purchase_units'      => [
156
-                [
157
-                    'custom_id'   => $this->transaction->ID(),
158
-                    'description' => substr(wp_strip_all_tags($description), 0, 125),
159
-                    'items'       => $this->getLineItems(),
160
-                    'amount'      => [
161
-                        'value'         => (string) CurrencyManager::normalizeValue($this->transaction->remaining()),
162
-                        'currency_code' => $this->currency_code,
163
-                        'breakdown'     => $this->getBreakdown(),
164
-                    ],
165
-                ],
166
-            ],
167
-            'application_context' => [
168
-                'shipping_preference' => 'NO_SHIPPING',
169
-                'user_action'         => 'PAY_NOW',
170
-            ],
171
-            'payer'               => [
172
-                'email_address' => $attendee->email(),
173
-                'name'          => [
174
-                    'given_name' => $attendee->fname(),
175
-                    'surname'    => $attendee->lname(),
176
-
177
-                ],
178
-            ],
179
-        ];
180
-        // Do we have the permissions for the fees ?
181
-        $scopes = PayPalExtraMetaManager::getPmOption(
182
-            $this->transaction->payment_method(),
183
-            Domain::META_KEY_AUTHORIZED_SCOPES
184
-        );
185
-        if (
186
-            (
187
-                (defined('EE_PPC_USE_PAYMENT_FEES') && EE_PPC_USE_PAYMENT_FEES)
188
-                || (! defined('EE_PPC_USE_PAYMENT_FEES')
189
-                    && $this->feature->allowed(FeatureFlag::USE_PAYMENT_PROCESSOR_FEES)
190
-                )
191
-            )
192
-            && ! empty($scopes) && in_array('partnerfee', $scopes)
193
-        ) {
194
-            /** @var PartnerPaymentFees $payment_fees */
195
-            $payment_fees = LoaderFactory::getShared(PartnerPaymentFees::class);
196
-            $parameters['purchase_units'][0]['payment_instruction'] = [
197
-                'platform_fees' => [
198
-                    [
199
-                        'amount' => [
200
-                            'value'         => (string) $payment_fees->getPartnerFee($this->transaction),
201
-                            'currency_code' => $this->currency_code,
202
-                        ],
203
-                    ],
204
-                ]
205
-            ];
206
-        }
207
-        return $parameters;
208
-    }
209
-
210
-
211
-    /**
212
-     * Itemize the payment. List all the line items, discounts and taxes.
213
-     *
214
-     * @return array
215
-     * @throws EE_Error|ReflectionException
216
-     */
217
-    protected function getLineItems(): array
218
-    {
219
-        // Order line items.
220
-        $line_items       = [];
221
-        $event_line_items = $this->transaction->items_purchased();
222
-        // List actual line items.
223
-        foreach ($event_line_items as $line_item) {
224
-            if (
225
-                $line_item instanceof EE_Line_Item
226
-                && $line_item->OBJ_type() !== 'Promotion'
227
-                && $line_item->quantity() > 0
228
-            ) {
229
-                $item_money     = CurrencyManager::normalizeValue($line_item->unit_price());
230
-                $li_description = $line_item->desc() ?? esc_html__('Event Ticket', 'event_espresso');
231
-                $line_items []  = [
232
-                    'name'        => substr(wp_strip_all_tags($line_item->name()), 0, 126),
233
-                    'quantity'    => $line_item->quantity(),
234
-                    'description' => substr(wp_strip_all_tags($li_description), 0, 125),
235
-                    'unit_amount' => [
236
-                        'currency_code' => $this->currency_code,
237
-                        'value'         => (string) $item_money,
238
-                    ],
239
-                    'category'    => 'DIGITAL_GOODS',
240
-                ];
241
-                // Line item total.
242
-                $this->items_total += $line_item->pretaxTotal();
243
-            } elseif ($line_item->OBJ_type() === 'Promotion' && $line_item->quantity() > 0) {
244
-                // Promotions total.
245
-                $this->promos_total += $line_item->total();
246
-            }
247
-        }
248
-        // Make sure we have an absolute number with only two decimal laces.
249
-        $this->items_total  = CurrencyManager::normalizeValue($this->items_total);
250
-        $this->promos_total = CurrencyManager::normalizeValue($this->promos_total);
251
-        // If this is a partial payment, apply the paid amount as a promo.
252
-        if ($this->transaction->paid() > 0) {
253
-            $this->promos_total += CurrencyManager::normalizeValue($this->transaction->paid());
254
-        }
255
-        $this->countTaxTotal();
256
-        return $line_items;
257
-    }
258
-
259
-
260
-    /**
261
-     * Count the tax total.
262
-     *
263
-     * @return void
264
-     * @throws EE_Error|ReflectionException
265
-     */
266
-    protected function countTaxTotal(): void
267
-    {
268
-        // List taxes.
269
-        $this->tax_total = 0.0;
270
-        $tax_items       = $this->transaction->tax_items();
271
-        foreach ($tax_items as $tax_item) {
272
-            $this->tax_total += $tax_item->total();
273
-        }
274
-        $this->tax_total = CurrencyManager::normalizeValue($this->tax_total);
275
-    }
276
-
277
-
278
-    /**
279
-     * Itemize the payment the breakdown list.
280
-     *
281
-     * @return array
282
-     */
283
-    protected function getBreakdown(): array
284
-    {
285
-        $breakdown['item_total'] = [
286
-            'currency_code' => $this->currency_code,
287
-            'value'         => (string) $this->items_total,
288
-        ];
289
-        $breakdown['tax_total']  = [
290
-            'currency_code' => $this->currency_code,
291
-            'value'         => (string) $this->tax_total,
292
-        ];
293
-        $breakdown['discount']   = [
294
-            'currency_code' => $this->currency_code,
295
-            'value'         => (string) abs($this->promos_total),
296
-        ];
297
-        return $breakdown;
298
-    }
299
-
300
-
301
-    /**
302
-     * Makes sure that we have received an Order back from the API call.
303
-     *
304
-     * @param $response
305
-     * @param $parameters
306
-     * @return array
307
-     * @throws EE_Error
308
-     * @throws ReflectionException
309
-     */
310
-    public function validateOrder($response, $parameters): array
311
-    {
312
-        PayPalLogger::errorLog(
313
-            esc_html__('Validating Order Create:', 'event_espresso'),
314
-            [$this->request_url, $response],
315
-            $this->transaction->payment_method(),
316
-            false,
317
-            $this->transaction
318
-        );
319
-        if (! empty($response['error'])) {
320
-            return $response;
321
-        }
322
-        if (! isset($response['id'])) {
323
-            $message = esc_html__('Unexpected response. Unable to find the order.', 'event_espresso');
324
-            try {
325
-                PayPalLogger::errorLog(
326
-                    $message,
327
-                    [$this->request_url, $parameters, $response],
328
-                    $this->transaction->payment_method()
329
-                );
330
-            } catch (EE_Error | ReflectionException $e) {
331
-                error_log("PayPalLogger Error: $message: " . json_encode($response));
332
-            }
333
-            return [
334
-                'error'    => $response['error'] ?? 'missing_order',
335
-                'message'  => $response['message'] ?? $message,
336
-                'response' => $response,
337
-            ];
338
-        }
339
-        return $response;
340
-    }
341
-
342
-
343
-    /**
344
-     * Check if PayPals response contains 'MISMATCH' errors.
345
-     *
346
-     * @return bool
347
-     */
348
-    public function isMismatchError($response): bool
349
-    {
350
-        if (! isset($response['details']) || ! is_array($response['details'])) {
351
-            return false;
352
-        }
353
-
354
-        foreach($response['details'] as $detail) {
355
-            if (! empty($detail['issue'])) {
356
-                if (
357
-                    strtoupper($detail['issue']) === 'ITEM_TOTAL_MISMATCH'
358
-                    || strtoupper($detail['issue']) === 'AMOUNT_MISMATCH'
359
-            ) {
360
-                    PayPalLogger::errorLog(
361
-                        esc_html__('Mistmatch Error:', 'event_espresso'),
362
-                        [$this->request_url, $response],
363
-                        $this->transaction->payment_method(),
364
-                        false,
365
-                        $this->transaction
366
-                    );
367
-                    return true;
368
-                }
369
-            }
370
-        }
371
-        return false;
372
-    }
373
-
374
-
375
-    /**
376
-     * Itemize the simplified payment breakdown list.
377
-     *
378
-     * @return array
379
-     */
380
-    protected function getSimplifiedAmountBreakdown(): array
381
-    {
382
-        $tax_total = $this->transaction->tax_total();
383
-        $breakdown['item_total'] = [
384
-            'currency_code' => $this->currency_code,
385
-            'value'         => (string) CurrencyManager::normalizeValue($this->transaction->remaining() - $tax_total)
386
-        ];
387
-        if ($tax_total > 0) {
388
-            $breakdown['tax_total'] = [
389
-                'currency_code' => $this->currency_code,
390
-                'value'         => (string) CurrencyManager::normalizeValue($tax_total)
391
-            ];
392
-        }
393
-        return $breakdown;
394
-    }
395
-
396
-
397
-    /**
398
-     * Generate single line item for full order.
399
-     *
400
-     * @return array
401
-     */
402
-    protected function getSimplifiedItems(): array
403
-    {
404
-        // Simplified single line item.
405
-        $line_items         = [];
406
-        $primary_registrant = $this->transaction->primary_registration();
407
-        $event_obj          = $primary_registrant->event_obj();
408
-        $name               = sprintf(
409
-            esc_html__('Event Registrations from %1$s', "event_espresso"),
410
-            wp_specialchars_decode(get_bloginfo(), ENT_QUOTES),
411
-        );
412
-        $description        = sprintf(
413
-            esc_html__('Event Registrations from %1$s for %2$s', "event_espresso"),
414
-            wp_specialchars_decode(get_bloginfo(), ENT_QUOTES),
415
-            $event_obj instanceof EE_Event ? $event_obj->name() : esc_html__('Event', 'event_espresso')
416
-        );
417
-
418
-        $line_items[]   = [
419
-            'name'        => substr(wp_strip_all_tags($name), 0, 126),
420
-            'quantity'    => 1,
421
-            'description' => substr(wp_strip_all_tags($description), 0, 2047),
422
-            'unit_amount' => [
423
-                'currency_code' => $this->currency_code,
424
-                'value'         => (string) CurrencyManager::normalizeValue($this->transaction->remaining() - $this->transaction->tax_total()),
425
-            ],
426
-            'category'    => 'DIGITAL_GOODS',
427
-        ];
428
-        return $line_items;
429
-    }
33
+	/**
34
+	 * Line items total.
35
+	 *
36
+	 * @var float
37
+	 */
38
+	protected float $items_total = 0.0;
39
+
40
+	/**
41
+	 * Promotions total.
42
+	 *
43
+	 * @var float
44
+	 */
45
+	protected float $promos_total = 0.0;
46
+
47
+	/**
48
+	 * Tax total.
49
+	 *
50
+	 * @var float
51
+	 */
52
+	protected float $tax_total = 0.0;
53
+
54
+	/**
55
+	 * Currency.
56
+	 *
57
+	 * @var string
58
+	 */
59
+	protected string $currency_code;
60
+
61
+	/**
62
+	 * Billing info.
63
+	 *
64
+	 * @var array
65
+	 */
66
+	protected array $billing_info;
67
+
68
+	/**
69
+	 * Transaction this order is for.
70
+	 *
71
+	 * @var EE_Transaction
72
+	 */
73
+	protected EE_Transaction $transaction;
74
+
75
+	private FeatureFlags $feature;
76
+
77
+
78
+	/**
79
+	 * CreateOrder constructor.
80
+	 *
81
+	 * @param PayPalApi      $api
82
+	 * @param EE_Transaction $transaction
83
+	 * @param array          $billing_info
84
+	 * @param FeatureFlags   $feature
85
+	 */
86
+	public function __construct(PayPalApi $api, EE_Transaction $transaction, array $billing_info, FeatureFlags $feature)
87
+	{
88
+		parent::__construct($api);
89
+		$this->transaction   = $transaction;
90
+		$this->feature       = $feature;
91
+		$this->currency_code = CurrencyManager::currencyCode();
92
+		$this->sanitizeRequestParameters($billing_info);
93
+	}
94
+
95
+
96
+	/**
97
+	 * Sanitize the array of billing form data.
98
+	 *
99
+	 * @param array $billing_info
100
+	 * @return void
101
+	 */
102
+	public function sanitizeRequestParameters(array $billing_info): void
103
+	{
104
+		$sanitizer = new RequestSanitizer(new Basic());
105
+		foreach ($billing_info as $item => $value) {
106
+			$this->billing_info[ $item ] = $sanitizer->clean($value);
107
+		}
108
+	}
109
+
110
+
111
+	/**
112
+	 * Create PayPal Order.
113
+	 *
114
+	 * @return array
115
+	 * @throws EE_Error
116
+	 * @throws ReflectionException
117
+	 */
118
+	public function create(): array
119
+	{
120
+		$order_parameters = $this->getParameters();
121
+		// Create Order request.
122
+		$create_response = $this->api->sendRequest($order_parameters, $this->request_url);
123
+		// Check for MISMATCH errors.
124
+		if ($this->isMismatchError($create_response)) {
125
+			// Mismatch, fix items.
126
+			$order_parameters['purchase_units'][0]['items'] = $this->getSimplifiedItems();
127
+			// Add simplified breakdown.
128
+			$order_parameters['purchase_units'][0]['amount']['breakdown'] = $this->getSimplifiedAmountBreakdown();
129
+			// Retry Order request.
130
+			$create_response = $this->api->sendRequest($order_parameters, $this->request_url);
131
+		}
132
+		return $this->validateOrder($create_response, $order_parameters);
133
+	}
134
+
135
+
136
+	/**
137
+	 * Form order parameters.
138
+	 *
139
+	 * @return array
140
+	 * @throws EE_Error
141
+	 * @throws ReflectionException
142
+	 * @throws Exception
143
+	 */
144
+	protected function getParameters(): array
145
+	{
146
+		$registrant  = $this->transaction->primary_registration();
147
+		$attendee    = $registrant->attendee();
148
+		$event       = $registrant->event();
149
+		$description = $event->name() ?: sprintf(
150
+			esc_html__('Tickets for an event at %1$s', 'event_espresso'),
151
+			get_bloginfo('name')
152
+		);
153
+		$parameters  = [
154
+			'intent'              => 'CAPTURE',
155
+			'purchase_units'      => [
156
+				[
157
+					'custom_id'   => $this->transaction->ID(),
158
+					'description' => substr(wp_strip_all_tags($description), 0, 125),
159
+					'items'       => $this->getLineItems(),
160
+					'amount'      => [
161
+						'value'         => (string) CurrencyManager::normalizeValue($this->transaction->remaining()),
162
+						'currency_code' => $this->currency_code,
163
+						'breakdown'     => $this->getBreakdown(),
164
+					],
165
+				],
166
+			],
167
+			'application_context' => [
168
+				'shipping_preference' => 'NO_SHIPPING',
169
+				'user_action'         => 'PAY_NOW',
170
+			],
171
+			'payer'               => [
172
+				'email_address' => $attendee->email(),
173
+				'name'          => [
174
+					'given_name' => $attendee->fname(),
175
+					'surname'    => $attendee->lname(),
176
+
177
+				],
178
+			],
179
+		];
180
+		// Do we have the permissions for the fees ?
181
+		$scopes = PayPalExtraMetaManager::getPmOption(
182
+			$this->transaction->payment_method(),
183
+			Domain::META_KEY_AUTHORIZED_SCOPES
184
+		);
185
+		if (
186
+			(
187
+				(defined('EE_PPC_USE_PAYMENT_FEES') && EE_PPC_USE_PAYMENT_FEES)
188
+				|| (! defined('EE_PPC_USE_PAYMENT_FEES')
189
+					&& $this->feature->allowed(FeatureFlag::USE_PAYMENT_PROCESSOR_FEES)
190
+				)
191
+			)
192
+			&& ! empty($scopes) && in_array('partnerfee', $scopes)
193
+		) {
194
+			/** @var PartnerPaymentFees $payment_fees */
195
+			$payment_fees = LoaderFactory::getShared(PartnerPaymentFees::class);
196
+			$parameters['purchase_units'][0]['payment_instruction'] = [
197
+				'platform_fees' => [
198
+					[
199
+						'amount' => [
200
+							'value'         => (string) $payment_fees->getPartnerFee($this->transaction),
201
+							'currency_code' => $this->currency_code,
202
+						],
203
+					],
204
+				]
205
+			];
206
+		}
207
+		return $parameters;
208
+	}
209
+
210
+
211
+	/**
212
+	 * Itemize the payment. List all the line items, discounts and taxes.
213
+	 *
214
+	 * @return array
215
+	 * @throws EE_Error|ReflectionException
216
+	 */
217
+	protected function getLineItems(): array
218
+	{
219
+		// Order line items.
220
+		$line_items       = [];
221
+		$event_line_items = $this->transaction->items_purchased();
222
+		// List actual line items.
223
+		foreach ($event_line_items as $line_item) {
224
+			if (
225
+				$line_item instanceof EE_Line_Item
226
+				&& $line_item->OBJ_type() !== 'Promotion'
227
+				&& $line_item->quantity() > 0
228
+			) {
229
+				$item_money     = CurrencyManager::normalizeValue($line_item->unit_price());
230
+				$li_description = $line_item->desc() ?? esc_html__('Event Ticket', 'event_espresso');
231
+				$line_items []  = [
232
+					'name'        => substr(wp_strip_all_tags($line_item->name()), 0, 126),
233
+					'quantity'    => $line_item->quantity(),
234
+					'description' => substr(wp_strip_all_tags($li_description), 0, 125),
235
+					'unit_amount' => [
236
+						'currency_code' => $this->currency_code,
237
+						'value'         => (string) $item_money,
238
+					],
239
+					'category'    => 'DIGITAL_GOODS',
240
+				];
241
+				// Line item total.
242
+				$this->items_total += $line_item->pretaxTotal();
243
+			} elseif ($line_item->OBJ_type() === 'Promotion' && $line_item->quantity() > 0) {
244
+				// Promotions total.
245
+				$this->promos_total += $line_item->total();
246
+			}
247
+		}
248
+		// Make sure we have an absolute number with only two decimal laces.
249
+		$this->items_total  = CurrencyManager::normalizeValue($this->items_total);
250
+		$this->promos_total = CurrencyManager::normalizeValue($this->promos_total);
251
+		// If this is a partial payment, apply the paid amount as a promo.
252
+		if ($this->transaction->paid() > 0) {
253
+			$this->promos_total += CurrencyManager::normalizeValue($this->transaction->paid());
254
+		}
255
+		$this->countTaxTotal();
256
+		return $line_items;
257
+	}
258
+
259
+
260
+	/**
261
+	 * Count the tax total.
262
+	 *
263
+	 * @return void
264
+	 * @throws EE_Error|ReflectionException
265
+	 */
266
+	protected function countTaxTotal(): void
267
+	{
268
+		// List taxes.
269
+		$this->tax_total = 0.0;
270
+		$tax_items       = $this->transaction->tax_items();
271
+		foreach ($tax_items as $tax_item) {
272
+			$this->tax_total += $tax_item->total();
273
+		}
274
+		$this->tax_total = CurrencyManager::normalizeValue($this->tax_total);
275
+	}
276
+
277
+
278
+	/**
279
+	 * Itemize the payment the breakdown list.
280
+	 *
281
+	 * @return array
282
+	 */
283
+	protected function getBreakdown(): array
284
+	{
285
+		$breakdown['item_total'] = [
286
+			'currency_code' => $this->currency_code,
287
+			'value'         => (string) $this->items_total,
288
+		];
289
+		$breakdown['tax_total']  = [
290
+			'currency_code' => $this->currency_code,
291
+			'value'         => (string) $this->tax_total,
292
+		];
293
+		$breakdown['discount']   = [
294
+			'currency_code' => $this->currency_code,
295
+			'value'         => (string) abs($this->promos_total),
296
+		];
297
+		return $breakdown;
298
+	}
299
+
300
+
301
+	/**
302
+	 * Makes sure that we have received an Order back from the API call.
303
+	 *
304
+	 * @param $response
305
+	 * @param $parameters
306
+	 * @return array
307
+	 * @throws EE_Error
308
+	 * @throws ReflectionException
309
+	 */
310
+	public function validateOrder($response, $parameters): array
311
+	{
312
+		PayPalLogger::errorLog(
313
+			esc_html__('Validating Order Create:', 'event_espresso'),
314
+			[$this->request_url, $response],
315
+			$this->transaction->payment_method(),
316
+			false,
317
+			$this->transaction
318
+		);
319
+		if (! empty($response['error'])) {
320
+			return $response;
321
+		}
322
+		if (! isset($response['id'])) {
323
+			$message = esc_html__('Unexpected response. Unable to find the order.', 'event_espresso');
324
+			try {
325
+				PayPalLogger::errorLog(
326
+					$message,
327
+					[$this->request_url, $parameters, $response],
328
+					$this->transaction->payment_method()
329
+				);
330
+			} catch (EE_Error | ReflectionException $e) {
331
+				error_log("PayPalLogger Error: $message: " . json_encode($response));
332
+			}
333
+			return [
334
+				'error'    => $response['error'] ?? 'missing_order',
335
+				'message'  => $response['message'] ?? $message,
336
+				'response' => $response,
337
+			];
338
+		}
339
+		return $response;
340
+	}
341
+
342
+
343
+	/**
344
+	 * Check if PayPals response contains 'MISMATCH' errors.
345
+	 *
346
+	 * @return bool
347
+	 */
348
+	public function isMismatchError($response): bool
349
+	{
350
+		if (! isset($response['details']) || ! is_array($response['details'])) {
351
+			return false;
352
+		}
353
+
354
+		foreach($response['details'] as $detail) {
355
+			if (! empty($detail['issue'])) {
356
+				if (
357
+					strtoupper($detail['issue']) === 'ITEM_TOTAL_MISMATCH'
358
+					|| strtoupper($detail['issue']) === 'AMOUNT_MISMATCH'
359
+			) {
360
+					PayPalLogger::errorLog(
361
+						esc_html__('Mistmatch Error:', 'event_espresso'),
362
+						[$this->request_url, $response],
363
+						$this->transaction->payment_method(),
364
+						false,
365
+						$this->transaction
366
+					);
367
+					return true;
368
+				}
369
+			}
370
+		}
371
+		return false;
372
+	}
373
+
374
+
375
+	/**
376
+	 * Itemize the simplified payment breakdown list.
377
+	 *
378
+	 * @return array
379
+	 */
380
+	protected function getSimplifiedAmountBreakdown(): array
381
+	{
382
+		$tax_total = $this->transaction->tax_total();
383
+		$breakdown['item_total'] = [
384
+			'currency_code' => $this->currency_code,
385
+			'value'         => (string) CurrencyManager::normalizeValue($this->transaction->remaining() - $tax_total)
386
+		];
387
+		if ($tax_total > 0) {
388
+			$breakdown['tax_total'] = [
389
+				'currency_code' => $this->currency_code,
390
+				'value'         => (string) CurrencyManager::normalizeValue($tax_total)
391
+			];
392
+		}
393
+		return $breakdown;
394
+	}
395
+
396
+
397
+	/**
398
+	 * Generate single line item for full order.
399
+	 *
400
+	 * @return array
401
+	 */
402
+	protected function getSimplifiedItems(): array
403
+	{
404
+		// Simplified single line item.
405
+		$line_items         = [];
406
+		$primary_registrant = $this->transaction->primary_registration();
407
+		$event_obj          = $primary_registrant->event_obj();
408
+		$name               = sprintf(
409
+			esc_html__('Event Registrations from %1$s', "event_espresso"),
410
+			wp_specialchars_decode(get_bloginfo(), ENT_QUOTES),
411
+		);
412
+		$description        = sprintf(
413
+			esc_html__('Event Registrations from %1$s for %2$s', "event_espresso"),
414
+			wp_specialchars_decode(get_bloginfo(), ENT_QUOTES),
415
+			$event_obj instanceof EE_Event ? $event_obj->name() : esc_html__('Event', 'event_espresso')
416
+		);
417
+
418
+		$line_items[]   = [
419
+			'name'        => substr(wp_strip_all_tags($name), 0, 126),
420
+			'quantity'    => 1,
421
+			'description' => substr(wp_strip_all_tags($description), 0, 2047),
422
+			'unit_amount' => [
423
+				'currency_code' => $this->currency_code,
424
+				'value'         => (string) CurrencyManager::normalizeValue($this->transaction->remaining() - $this->transaction->tax_total()),
425
+			],
426
+			'category'    => 'DIGITAL_GOODS',
427
+		];
428
+		return $line_items;
429
+	}
430 430
 }
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     {
104 104
         $sanitizer = new RequestSanitizer(new Basic());
105 105
         foreach ($billing_info as $item => $value) {
106
-            $this->billing_info[ $item ] = $sanitizer->clean($value);
106
+            $this->billing_info[$item] = $sanitizer->clean($value);
107 107
         }
108 108
     }
109 109
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
             esc_html__('Tickets for an event at %1$s', 'event_espresso'),
151 151
             get_bloginfo('name')
152 152
         );
153
-        $parameters  = [
153
+        $parameters = [
154 154
             'intent'              => 'CAPTURE',
155 155
             'purchase_units'      => [
156 156
                 [
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
         if (
186 186
             (
187 187
                 (defined('EE_PPC_USE_PAYMENT_FEES') && EE_PPC_USE_PAYMENT_FEES)
188
-                || (! defined('EE_PPC_USE_PAYMENT_FEES')
188
+                || ( ! defined('EE_PPC_USE_PAYMENT_FEES')
189 189
                     && $this->feature->allowed(FeatureFlag::USE_PAYMENT_PROCESSOR_FEES)
190 190
                 )
191 191
             )
@@ -286,11 +286,11 @@  discard block
 block discarded – undo
286 286
             'currency_code' => $this->currency_code,
287 287
             'value'         => (string) $this->items_total,
288 288
         ];
289
-        $breakdown['tax_total']  = [
289
+        $breakdown['tax_total'] = [
290 290
             'currency_code' => $this->currency_code,
291 291
             'value'         => (string) $this->tax_total,
292 292
         ];
293
-        $breakdown['discount']   = [
293
+        $breakdown['discount'] = [
294 294
             'currency_code' => $this->currency_code,
295 295
             'value'         => (string) abs($this->promos_total),
296 296
         ];
@@ -316,10 +316,10 @@  discard block
 block discarded – undo
316 316
             false,
317 317
             $this->transaction
318 318
         );
319
-        if (! empty($response['error'])) {
319
+        if ( ! empty($response['error'])) {
320 320
             return $response;
321 321
         }
322
-        if (! isset($response['id'])) {
322
+        if ( ! isset($response['id'])) {
323 323
             $message = esc_html__('Unexpected response. Unable to find the order.', 'event_espresso');
324 324
             try {
325 325
                 PayPalLogger::errorLog(
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
                     $this->transaction->payment_method()
329 329
                 );
330 330
             } catch (EE_Error | ReflectionException $e) {
331
-                error_log("PayPalLogger Error: $message: " . json_encode($response));
331
+                error_log("PayPalLogger Error: $message: ".json_encode($response));
332 332
             }
333 333
             return [
334 334
                 'error'    => $response['error'] ?? 'missing_order',
@@ -347,12 +347,12 @@  discard block
 block discarded – undo
347 347
      */
348 348
     public function isMismatchError($response): bool
349 349
     {
350
-        if (! isset($response['details']) || ! is_array($response['details'])) {
350
+        if ( ! isset($response['details']) || ! is_array($response['details'])) {
351 351
             return false;
352 352
         }
353 353
 
354
-        foreach($response['details'] as $detail) {
355
-            if (! empty($detail['issue'])) {
354
+        foreach ($response['details'] as $detail) {
355
+            if ( ! empty($detail['issue'])) {
356 356
                 if (
357 357
                     strtoupper($detail['issue']) === 'ITEM_TOTAL_MISMATCH'
358 358
                     || strtoupper($detail['issue']) === 'AMOUNT_MISMATCH'
@@ -409,13 +409,13 @@  discard block
 block discarded – undo
409 409
             esc_html__('Event Registrations from %1$s', "event_espresso"),
410 410
             wp_specialchars_decode(get_bloginfo(), ENT_QUOTES),
411 411
         );
412
-        $description        = sprintf(
412
+        $description = sprintf(
413 413
             esc_html__('Event Registrations from %1$s for %2$s', "event_espresso"),
414 414
             wp_specialchars_decode(get_bloginfo(), ENT_QUOTES),
415 415
             $event_obj instanceof EE_Event ? $event_obj->name() : esc_html__('Event', 'event_espresso')
416 416
         );
417 417
 
418
-        $line_items[]   = [
418
+        $line_items[] = [
419 419
             'name'        => substr(wp_strip_all_tags($name), 0, 126),
420 420
             'quantity'    => 1,
421 421
             'description' => substr(wp_strip_all_tags($description), 0, 2047),
Please login to merge, or discard this patch.
PaymentMethods/PayPalCommerce/api/orders/CaptureOrder.php 2 patches
Indentation   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -20,102 +20,102 @@
 block discarded – undo
20 20
  */
21 21
 class CaptureOrder extends OrdersApi
22 22
 {
23
-    /**
24
-     * Currency.
25
-     *
26
-     * @var string
27
-     */
28
-    protected string $currency_code;
23
+	/**
24
+	 * Currency.
25
+	 *
26
+	 * @var string
27
+	 */
28
+	protected string $currency_code;
29 29
 
30
-    /**
31
-     * Transaction this order is for.
32
-     *
33
-     * @var EE_Transaction
34
-     */
35
-    protected EE_Transaction $transaction;
30
+	/**
31
+	 * Transaction this order is for.
32
+	 *
33
+	 * @var EE_Transaction
34
+	 */
35
+	protected EE_Transaction $transaction;
36 36
 
37 37
 
38
-    /**
39
-     * CaptureOrder constructor.
40
-     *
41
-     * @param PayPalApi      $api
42
-     * @param EE_Transaction $transaction
43
-     * @param string         $order_id
44
-     */
45
-    public function __construct(PayPalApi $api, EE_Transaction $transaction, string $order_id)
46
-    {
47
-        parent::__construct($api);
48
-        $this->transaction   = $transaction;
49
-        $this->order_id      = $order_id;
50
-        $this->currency_code = CurrencyManager::currencyCode();
51
-        $this->request_url   = $this->request_url . $order_id . '/capture';
52
-    }
38
+	/**
39
+	 * CaptureOrder constructor.
40
+	 *
41
+	 * @param PayPalApi      $api
42
+	 * @param EE_Transaction $transaction
43
+	 * @param string         $order_id
44
+	 */
45
+	public function __construct(PayPalApi $api, EE_Transaction $transaction, string $order_id)
46
+	{
47
+		parent::__construct($api);
48
+		$this->transaction   = $transaction;
49
+		$this->order_id      = $order_id;
50
+		$this->currency_code = CurrencyManager::currencyCode();
51
+		$this->request_url   = $this->request_url . $order_id . '/capture';
52
+	}
53 53
 
54 54
 
55
-    /**
56
-     * Capture payment for PayPal Order.
57
-     *
58
-     * @return array
59
-     * @throws EE_Error
60
-     * @throws ReflectionException
61
-     */
62
-    public function capture(): array
63
-    {
64
-        // Create Order request.
65
-        $capture_response = $this->api->sendRequest([], $this->request_url);
66
-        return $this->validateOrder($capture_response);
67
-    }
55
+	/**
56
+	 * Capture payment for PayPal Order.
57
+	 *
58
+	 * @return array
59
+	 * @throws EE_Error
60
+	 * @throws ReflectionException
61
+	 */
62
+	public function capture(): array
63
+	{
64
+		// Create Order request.
65
+		$capture_response = $this->api->sendRequest([], $this->request_url);
66
+		return $this->validateOrder($capture_response);
67
+	}
68 68
 
69 69
 
70
-    /**
71
-     * Makes sure that we have received an Order back from the API call.
72
-     *
73
-     * @param $response
74
-     * @return array
75
-     * @throws EE_Error
76
-     * @throws ReflectionException
77
-     */
78
-    public function validateOrder($response): array
79
-    {
80
-        $message = esc_html__('Validating Order Capture:', 'event_espresso');
81
-        PayPalLogger::errorLog(
82
-            $message,
83
-            [$this->request_url,  $response],
84
-            $this->transaction->payment_method(),
85
-            false,
86
-            $this->transaction
87
-        );
88
-        // We got a direct error response. Not valid. Return that error.
89
-        if (! empty($response['error'])) {
90
-            return $response;
91
-        }
92
-        // This also could be a retry capture, so consider this valid, if order already captured.
93
-        if (
94
-            ! empty($response['message']['details']['issue'])
95
-            && $response['message']['details']['issue'] === 'ORDER_ALREADY_CAPTURED'
96
-        ) {
97
-            // Need to make sure we pass on the order ID.
98
-            if (empty($response['id'])) {
99
-                $response['id'] = $this->order_id;
100
-            }
101
-            $response['status'] = 'ORDER_ALREADY_CAPTURED';
102
-            return $response;
103
-        }
104
-        // A success capture should return the order ID.
105
-        if (! isset($response['id'])) {
106
-            $message = esc_html__('Unexpected response. No order returned.', 'event_espresso');
107
-            try {
108
-                PayPalLogger::errorLog($message, [$this->request_url, $response], $this->transaction->payment_method());
109
-            } catch (EE_Error | ReflectionException $e) {
110
-                error_log("PayPalLogger Error: $message: " . json_encode($response));
111
-            }
112
-            return [
113
-                'error'    => $response['error'] ?? 'missing_order',
114
-                'message'  => $response['message'] ?? $message,
115
-                'name'     => $response['name'] ?? 'UNKNOWN_ERROR',
116
-                'response' => $response,
117
-            ];
118
-        }
119
-        return $response;
120
-    }
70
+	/**
71
+	 * Makes sure that we have received an Order back from the API call.
72
+	 *
73
+	 * @param $response
74
+	 * @return array
75
+	 * @throws EE_Error
76
+	 * @throws ReflectionException
77
+	 */
78
+	public function validateOrder($response): array
79
+	{
80
+		$message = esc_html__('Validating Order Capture:', 'event_espresso');
81
+		PayPalLogger::errorLog(
82
+			$message,
83
+			[$this->request_url,  $response],
84
+			$this->transaction->payment_method(),
85
+			false,
86
+			$this->transaction
87
+		);
88
+		// We got a direct error response. Not valid. Return that error.
89
+		if (! empty($response['error'])) {
90
+			return $response;
91
+		}
92
+		// This also could be a retry capture, so consider this valid, if order already captured.
93
+		if (
94
+			! empty($response['message']['details']['issue'])
95
+			&& $response['message']['details']['issue'] === 'ORDER_ALREADY_CAPTURED'
96
+		) {
97
+			// Need to make sure we pass on the order ID.
98
+			if (empty($response['id'])) {
99
+				$response['id'] = $this->order_id;
100
+			}
101
+			$response['status'] = 'ORDER_ALREADY_CAPTURED';
102
+			return $response;
103
+		}
104
+		// A success capture should return the order ID.
105
+		if (! isset($response['id'])) {
106
+			$message = esc_html__('Unexpected response. No order returned.', 'event_espresso');
107
+			try {
108
+				PayPalLogger::errorLog($message, [$this->request_url, $response], $this->transaction->payment_method());
109
+			} catch (EE_Error | ReflectionException $e) {
110
+				error_log("PayPalLogger Error: $message: " . json_encode($response));
111
+			}
112
+			return [
113
+				'error'    => $response['error'] ?? 'missing_order',
114
+				'message'  => $response['message'] ?? $message,
115
+				'name'     => $response['name'] ?? 'UNKNOWN_ERROR',
116
+				'response' => $response,
117
+			];
118
+		}
119
+		return $response;
120
+	}
121 121
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         $this->transaction   = $transaction;
49 49
         $this->order_id      = $order_id;
50 50
         $this->currency_code = CurrencyManager::currencyCode();
51
-        $this->request_url   = $this->request_url . $order_id . '/capture';
51
+        $this->request_url   = $this->request_url.$order_id.'/capture';
52 52
     }
53 53
 
54 54
 
@@ -80,13 +80,13 @@  discard block
 block discarded – undo
80 80
         $message = esc_html__('Validating Order Capture:', 'event_espresso');
81 81
         PayPalLogger::errorLog(
82 82
             $message,
83
-            [$this->request_url,  $response],
83
+            [$this->request_url, $response],
84 84
             $this->transaction->payment_method(),
85 85
             false,
86 86
             $this->transaction
87 87
         );
88 88
         // We got a direct error response. Not valid. Return that error.
89
-        if (! empty($response['error'])) {
89
+        if ( ! empty($response['error'])) {
90 90
             return $response;
91 91
         }
92 92
         // This also could be a retry capture, so consider this valid, if order already captured.
@@ -102,12 +102,12 @@  discard block
 block discarded – undo
102 102
             return $response;
103 103
         }
104 104
         // A success capture should return the order ID.
105
-        if (! isset($response['id'])) {
105
+        if ( ! isset($response['id'])) {
106 106
             $message = esc_html__('Unexpected response. No order returned.', 'event_espresso');
107 107
             try {
108 108
                 PayPalLogger::errorLog($message, [$this->request_url, $response], $this->transaction->payment_method());
109 109
             } catch (EE_Error | ReflectionException $e) {
110
-                error_log("PayPalLogger Error: $message: " . json_encode($response));
110
+                error_log("PayPalLogger Error: $message: ".json_encode($response));
111 111
             }
112 112
             return [
113 113
                 'error'    => $response['error'] ?? 'missing_order',
Please login to merge, or discard this patch.
PaymentMethods/PayPalCommerce/api/orders/OrderDetails.php 2 patches
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -20,82 +20,82 @@
 block discarded – undo
20 20
  */
21 21
 class OrderDetails extends OrdersApi
22 22
 {
23
-    /**
24
-     * Transaction this order is for.
25
-     *
26
-     * @var EE_Transaction
27
-     */
28
-    protected EE_Transaction $transaction;
23
+	/**
24
+	 * Transaction this order is for.
25
+	 *
26
+	 * @var EE_Transaction
27
+	 */
28
+	protected EE_Transaction $transaction;
29 29
 
30
-    private FeatureFlags $feature;
30
+	private FeatureFlags $feature;
31 31
 
32 32
 
33
-    /**
34
-     * OrderDetails constructor.
35
-     *
36
-     * @param PayPalApi      $api
37
-     * @param string         $order_id
38
-     * @param EE_Transaction $transaction
39
-     */
40
-    public function __construct(PayPalApi $api, string $order_id, EE_Transaction $transaction)
41
-    {
42
-        parent::__construct($api);
43
-        $this->transaction = $transaction;
44
-        $this->request_url = $this->request_url . $order_id;
45
-    }
33
+	/**
34
+	 * OrderDetails constructor.
35
+	 *
36
+	 * @param PayPalApi      $api
37
+	 * @param string         $order_id
38
+	 * @param EE_Transaction $transaction
39
+	 */
40
+	public function __construct(PayPalApi $api, string $order_id, EE_Transaction $transaction)
41
+	{
42
+		parent::__construct($api);
43
+		$this->transaction = $transaction;
44
+		$this->request_url = $this->request_url . $order_id;
45
+	}
46 46
 
47 47
 
48
-    /**
49
-     * Create PayPal Order.
50
-     *
51
-     * @return array
52
-     * @throws EE_Error
53
-     * @throws ReflectionException
54
-     */
55
-    public function get(): array
56
-    {
57
-        $response = $this->api->sendRequest([], $this->request_url, 'GET');
58
-        return $this->validateResponse($response);
59
-    }
48
+	/**
49
+	 * Create PayPal Order.
50
+	 *
51
+	 * @return array
52
+	 * @throws EE_Error
53
+	 * @throws ReflectionException
54
+	 */
55
+	public function get(): array
56
+	{
57
+		$response = $this->api->sendRequest([], $this->request_url, 'GET');
58
+		return $this->validateResponse($response);
59
+	}
60 60
 
61 61
 
62
-    /**
63
-     * Makes sure that we have received the expected Order information back from the API call.
64
-     *
65
-     * @param $response
66
-     * @return array
67
-     * @throws EE_Error
68
-     * @throws ReflectionException
69
-     */
70
-    public function validateResponse($response): array
71
-    {
72
-        PayPalLogger::errorLog(
73
-            esc_html__('Validating Order Information Response:', 'event_espresso'),
74
-            [$this->request_url, $response],
75
-            $this->transaction->payment_method(),
76
-            false,
77
-            $this->transaction
78
-        );
79
-        if (! empty($response['error'])) {
80
-            return $response;
81
-        }
82
-        if (! isset($response['id']) || ! isset($response['status'])) {
83
-            $message = esc_html__('No proper order information was found in this response.', 'event_espresso');
84
-            try {
85
-                PayPalLogger::errorLog(
86
-                    $message,
87
-                    [$this->request_url, $response],
88
-                    $this->transaction->payment_method()
89
-                );
90
-            } catch (EE_Error | ReflectionException $e) {
91
-                error_log("PayPalLogger Error: $message: " . json_encode($response));
92
-            }
93
-            return [
94
-                'error'    => $response['error'] ?? 'missing_order_info',
95
-                'message'  => $response['message'] ?? $message,
96
-                'response' => $response,
97
-            ];
98
-        }
99
-        return $response;
100
-    }
62
+	/**
63
+	 * Makes sure that we have received the expected Order information back from the API call.
64
+	 *
65
+	 * @param $response
66
+	 * @return array
67
+	 * @throws EE_Error
68
+	 * @throws ReflectionException
69
+	 */
70
+	public function validateResponse($response): array
71
+	{
72
+		PayPalLogger::errorLog(
73
+			esc_html__('Validating Order Information Response:', 'event_espresso'),
74
+			[$this->request_url, $response],
75
+			$this->transaction->payment_method(),
76
+			false,
77
+			$this->transaction
78
+		);
79
+		if (! empty($response['error'])) {
80
+			return $response;
81
+		}
82
+		if (! isset($response['id']) || ! isset($response['status'])) {
83
+			$message = esc_html__('No proper order information was found in this response.', 'event_espresso');
84
+			try {
85
+				PayPalLogger::errorLog(
86
+					$message,
87
+					[$this->request_url, $response],
88
+					$this->transaction->payment_method()
89
+				);
90
+			} catch (EE_Error | ReflectionException $e) {
91
+				error_log("PayPalLogger Error: $message: " . json_encode($response));
92
+			}
93
+			return [
94
+				'error'    => $response['error'] ?? 'missing_order_info',
95
+				'message'  => $response['message'] ?? $message,
96
+				'response' => $response,
97
+			];
98
+		}
99
+		return $response;
100
+	}
101 101
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     {
42 42
         parent::__construct($api);
43 43
         $this->transaction = $transaction;
44
-        $this->request_url = $this->request_url . $order_id;
44
+        $this->request_url = $this->request_url.$order_id;
45 45
     }
46 46
 
47 47
 
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
             false,
77 77
             $this->transaction
78 78
         );
79
-        if (! empty($response['error'])) {
79
+        if ( ! empty($response['error'])) {
80 80
             return $response;
81 81
         }
82
-        if (! isset($response['id']) || ! isset($response['status'])) {
82
+        if ( ! isset($response['id']) || ! isset($response['status'])) {
83 83
             $message = esc_html__('No proper order information was found in this response.', 'event_espresso');
84 84
             try {
85 85
                 PayPalLogger::errorLog(
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
                     $this->transaction->payment_method()
89 89
                 );
90 90
             } catch (EE_Error | ReflectionException $e) {
91
-                error_log("PayPalLogger Error: $message: " . json_encode($response));
91
+                error_log("PayPalLogger Error: $message: ".json_encode($response));
92 92
             }
93 93
             return [
94 94
                 'error'    => $response['error'] ?? 'missing_order_info',
Please login to merge, or discard this patch.
PaymentMethods/PayPalCommerce/modules/EED_PayPalCommerce.module.php 1 patch
Indentation   +466 added lines, -466 removed lines patch added patch discarded remove patch
@@ -23,470 +23,470 @@
 block discarded – undo
23 23
  */
24 24
 class EED_PayPalCommerce extends EED_Module
25 25
 {
26
-    /**
27
-     * @return EED_Module
28
-     * @throws EE_Error
29
-     * @throws ReflectionException
30
-     */
31
-    public static function instance(): EED_Module
32
-    {
33
-        return parent::get_instance(__CLASS__);
34
-    }
35
-
36
-
37
-    /**
38
-     * Run - initial module setup.
39
-     *
40
-     * @param WP $WP
41
-     * @return void
42
-     */
43
-    public function run($WP)
44
-    {
45
-    }
46
-
47
-
48
-    /**
49
-     * For hooking into EE Core and other modules.
50
-     *
51
-     * @return void
52
-     */
53
-    public static function set_hooks(): void
54
-    {
55
-        if (DbStatus::isOnline()) {
56
-            // Don't load PM on the front-end if not Connected.
57
-            add_filter(
58
-                'FHEE__EEM_Payment_Method__get_all_for_transaction__payment_methods',
59
-                [__CLASS__, 'filterPaymentMethods'],
60
-                100
61
-            );
62
-        }
63
-    }
64
-
65
-
66
-    /**
67
-     * For hooking into EE Core and other modules Admin.
68
-     *
69
-     * @return void
70
-     */
71
-    public static function set_hooks_admin(): void
72
-    {
73
-        if (DbStatus::isOnline()) {
74
-            // Create an Order.
75
-            add_action('wp_ajax_eeaPPCCreateOrder', [__CLASS__, 'createOrderRequest']);
76
-            add_action('wp_ajax_nopriv_eeaPPCCreateOrder', [__CLASS__, 'createOrderRequest']);
77
-            // Log errors from the JS side.
78
-            add_action('wp_ajax_eeaPPCommerceLogError', [__CLASS__, 'logJsError']);
79
-            add_action('wp_ajax_nopriv_eeaPPCommerceLogError', [__CLASS__, 'logJsError']);
80
-            // Don't load PM in the admin if not Connected.
81
-            add_filter(
82
-                'FHEE__EEM_Payment_Method__get_all_for_transaction__payment_methods',
83
-                [__CLASS__, 'filterPaymentMethods'],
84
-                100
85
-            );
86
-        }
87
-    }
88
-
89
-
90
-    /**
91
-     * Create the order and return its data as JSON.
92
-     * (AJAX)
93
-     *
94
-     * @return void
95
-     * @throws EE_Error
96
-     * @throws ReflectionException
97
-     */
98
-    public static function createOrderRequest(): void
99
-    {
100
-        $paypal_pm   = EED_PayPalCommerce::getPaymentMethod();
101
-        $post_params = EED_Module::getRequest()->postParams();
102
-        if (! $paypal_pm instanceof EE_Payment_Method) {
103
-            PayPalLogger::errorLogAndExit(
104
-                esc_html__('Related payment method not found (create Order).', 'event_espresso'),
105
-                $post_params
106
-            );
107
-        }
108
-        $transaction  = EED_PayPalCommerce::getTransaction();
109
-        $billing_info = $post_params['billing_info'] ?? [];
110
-        if ($billing_info) {
111
-            $billing_info_decoded = json_decode(stripslashes($billing_info), true);
112
-            $billing_info         = is_array($billing_info_decoded) ? $billing_info_decoded : [];
113
-        }
114
-        if (! $transaction) {
115
-            PayPalLogger::errorLogAndExit(
116
-                esc_html__('Transaction info not found.', 'event_espresso'),
117
-                $post_params,
118
-                $paypal_pm
119
-            );
120
-        }
121
-        $order_data = EED_PayPalCommerce::createOrder($transaction, $billing_info, $paypal_pm);
122
-        wp_send_json($order_data);
123
-    }
124
-
125
-
126
-    /**
127
-     * Create a new Order using the PP API.
128
-     *
129
-     * @param EE_Transaction    $transaction
130
-     * @param array             $billing_info
131
-     * @param EE_Payment_Method $paypal_pm
132
-     * @return array
133
-     * @throws EE_Error
134
-     * @throws ReflectionException
135
-     */
136
-    public static function createOrder(
137
-        EE_Transaction $transaction,
138
-        array $billing_info,
139
-        EE_Payment_Method $paypal_pm
140
-    ): array {
141
-        $create_order_api = EED_PayPalCommerce::getCreateOrderApi($transaction, $billing_info, $paypal_pm);
142
-        if (! $create_order_api instanceof CreateOrder) {
143
-            return [
144
-                'error'   => 'CREATE_ORDER_API_FAULT',
145
-                'message' => esc_html__('The Create Order API request fault.', 'event_espresso'),
146
-            ];
147
-        }
148
-        // Make sure we have a payment method saved.
149
-        $payment_method = EED_PayPalCommerce::getPaymentMethod();
150
-        if ($payment_method->ID()) {
151
-            $transaction->set_payment_method_ID($payment_method->ID());
152
-        }
153
-        $order = $create_order_api->create();
154
-        if (isset($order['error'])) {
155
-            $last_payment = $transaction->last_payment();
156
-            if ($last_payment instanceof EE_Payment) {
157
-                EEG_PayPalCheckout::updatePaymentStatus(
158
-                    $last_payment,
159
-                    EEM_Payment::status_id_failed,
160
-                    $order,
161
-                    $order['error']
162
-                );
163
-            }
164
-            return [
165
-                'error'    => 'CREATE_ORDER_API_RESPONSE_ERROR',
166
-                'message'  => EEG_PayPalCheckout::getResponseMessage($order['response'], $order['message']),
167
-                'response' => $order['message'],
168
-            ];
169
-        }
170
-        return [
171
-            'pp_order_id' => $order['id'],
172
-        ];
173
-    }
174
-
175
-
176
-    /**
177
-     * Create a new Order using the PP API.
178
-     *
179
-     * @param EE_Transaction    $transaction
180
-     * @param EE_Payment_Method $paypal_pm
181
-     * @param string            $order_id
182
-     * @return array
183
-     * @throws EE_Error
184
-     * @throws ReflectionException
185
-     */
186
-    public static function captureOrder(
187
-        EE_Transaction    $transaction,
188
-        EE_Payment_Method $paypal_pm,
189
-        string            $order_id
190
-    ): array {
191
-        $capture_order_api = EED_PayPalCommerce::getCaptureOrderApi($transaction, $paypal_pm, $order_id);
192
-        if (! $capture_order_api instanceof CaptureOrder) {
193
-            return [
194
-                'error'   => 'CAPTURE_ORDER_API_FAULT',
195
-                'message' => esc_html__('A capture Order API request fault.', 'event_espresso'),
196
-            ];
197
-        }
198
-        return $capture_order_api->capture();
199
-    }
200
-
201
-
202
-    /**
203
-     * Get Order Details using the PP API.
204
-     *
205
-     * @param string            $order_id
206
-     * @param EE_Transaction    $transaction
207
-     * @param EE_Payment_Method $paypal_pm
208
-     * @return array
209
-     * @throws EE_Error
210
-     * @throws ReflectionException
211
-     */
212
-    public static function getOrderDetails(
213
-        string            $order_id,
214
-        EE_Transaction    $transaction,
215
-        EE_Payment_Method $paypal_pm
216
-    ): array {
217
-        $order_details = EED_PayPalCommerce::getOrderDetailsApi($order_id, $transaction, $paypal_pm);
218
-        if (! $order_details instanceof OrderDetails) {
219
-            return [
220
-                'error'   => 'ORDER_DETAILS_API_FAULT',
221
-                'message' => esc_html__('Get Order Details API request fault.', 'event_espresso'),
222
-            ];
223
-        }
224
-        return $order_details->get();
225
-    }
226
-
227
-
228
-    /**
229
-     * Initialize and return Create Order API.
230
-     *
231
-     * @param EE_Transaction    $transaction
232
-     * @param array             $billing_info
233
-     * @param EE_Payment_Method $paypal_pm
234
-     * @return CreateOrder|null
235
-     * @throws EE_Error
236
-     * @throws ReflectionException
237
-     */
238
-    public static function getCreateOrderApi(
239
-        EE_Transaction $transaction,
240
-        array $billing_info,
241
-        EE_Payment_Method $paypal_pm
242
-    ): ?CreateOrder {
243
-        $paypal_api = EED_PayPalCommerce::getPayPalApi($paypal_pm);
244
-        if (! $paypal_api instanceof PayPalApi) {
245
-            return null;
246
-        }
247
-        return LoaderFactory::getNew(CreateOrder::class, [$paypal_api, $transaction, $billing_info]);
248
-    }
249
-
250
-
251
-    /**
252
-     * Initialize and return Capture Order API.
253
-     *
254
-     * @param EE_Transaction    $transaction
255
-     * @param EE_Payment_Method $paypal_pm
256
-     * @param string            $order_id
257
-     * @return CaptureOrder|null
258
-     * @throws EE_Error
259
-     * @throws ReflectionException
260
-     */
261
-    public static function getCaptureOrderApi(
262
-        EE_Transaction $transaction,
263
-        EE_Payment_Method $paypal_pm,
264
-        string $order_id
265
-    ): ?CaptureOrder {
266
-        $paypal_api = EED_PayPalCommerce::getPayPalApi($paypal_pm);
267
-        if (! $paypal_api instanceof PayPalApi) {
268
-            return null;
269
-        }
270
-        return LoaderFactory::getNew(CaptureOrder::class, [$paypal_api, $transaction, $order_id]);
271
-    }
272
-
273
-
274
-    /**
275
-     * Initialize and return Order Details API.
276
-     *
277
-     * @param EE_Transaction    $transaction
278
-     * @param EE_Payment_Method $paypal_pm
279
-     * @param string            $order_id
280
-     * @return OrderDetails|null
281
-     * @throws EE_Error
282
-     * @throws ReflectionException
283
-     */
284
-    public static function getOrderDetailsApi(
285
-        string $order_id,
286
-        EE_Transaction $transaction,
287
-        EE_Payment_Method $paypal_pm
288
-    ): ?OrderDetails {
289
-        $paypal_api = EED_PayPalCommerce::getPayPalApi($paypal_pm);
290
-        if (! $paypal_api instanceof PayPalApi) {
291
-            return null;
292
-        }
293
-        return LoaderFactory::getNew(OrderDetails::class, [$paypal_api, $order_id, $transaction]);
294
-    }
295
-
296
-
297
-    /**
298
-     * Return a PayPal API object, or false on failure.
299
-     *
300
-     * @param EE_Payment_Method $paypal_pm
301
-     * @return PayPalApi|null
302
-     * @throws EE_Error
303
-     * @throws ReflectionException
304
-     */
305
-    public static function getPayPalApi(EE_Payment_Method $paypal_pm): ?PayPalApi
306
-    {
307
-        // Try getting the first party credentials to determine if this is a first party integration that's active.
308
-        $client_id     = PayPalExtraMetaManager::getPmOption($paypal_pm, Domain::META_KEY_CLIENT_ID);
309
-        $client_secret = PayPalExtraMetaManager::getPmOption($paypal_pm, Domain::META_KEY_CLIENT_SECRET);
310
-        $bn_code       = PayPalExtraMetaManager::getPmOption($paypal_pm, Domain::META_KEY_BN_CODE);
311
-        if ($client_id && $client_secret) {
312
-            return new FirstPartyPayPalApi($client_id, $client_secret, $bn_code, $paypal_pm->debug_mode());
313
-        }
314
-        // Third party integration credentials:
315
-        $access_token = EED_PayPalOnboard::getPartnerAccessToken($paypal_pm);
316
-        if (! $access_token || ! $bn_code) {
317
-            return null;
318
-        }
319
-        $partner_client_id = PayPalExtraMetaManager::getPmOption($paypal_pm, Domain::META_KEY_PARTNER_CLIENT_ID) ?: '';
320
-        $payer_id          = PayPalExtraMetaManager::getPmOption($paypal_pm, Domain::META_KEY_SELLER_MERCHANT_ID) ?: '';
321
-        return new ThirdPartyPayPalApi(
322
-            $access_token,
323
-            $bn_code,
324
-            $partner_client_id,
325
-            $payer_id,
326
-            $paypal_pm->debug_mode()
327
-        );
328
-    }
329
-
330
-
331
-    /**
332
-     * Requests a client token.
333
-     *
334
-     * @param EE_Payment_Method $paypal_pm
335
-     * @return array
336
-     * @throws EE_Error
337
-     * @throws ReflectionException
338
-     */
339
-    public static function requestClientToken(EE_Payment_Method $paypal_pm): array
340
-    {
341
-        $error      = ['error' => 'GET_CLIENT_TOKEN_FAULT'];
342
-        $paypal_api = EED_PayPalCommerce::getPayPalApi($paypal_pm);
343
-        if (! $paypal_api instanceof PayPalApi) {
344
-            $error['message'] = esc_html__('Got an error while trying to get the client token.', 'event_espresso');
345
-            return $error;
346
-        }
347
-        $client_token_api = new ClientToken($paypal_api, $paypal_pm->debug_mode());
348
-        $client_token     = $client_token_api->getToken();
349
-        if (isset($client_token['error'])) {
350
-            return $client_token;
351
-        }
352
-        if (empty($client_token)) {
353
-            $error['message'] = esc_html__('Client token not valid.', 'event_espresso');
354
-            return $error;
355
-        }
356
-        return $client_token;
357
-    }
358
-
359
-
360
-    /**
361
-     * Retrieve the payment method from the provided data.
362
-     *
363
-     * @return EE_Transaction|null
364
-     */
365
-    public static function getTransaction(): ?EE_Transaction
366
-    {
367
-        try {
368
-            $txn_id      = EED_Module::getRequest()->getRequestParam('txn_id', 0, DataType::INT);
369
-            $transaction = EEM_Transaction::instance()->get_one_by_ID($txn_id);
370
-            if (! $transaction instanceof EE_Transaction) {
371
-                PayPalLogger::errorLog(
372
-                    esc_html__('No transaction found by ID:', 'event_espresso'),
373
-                    EED_Module::getRequest()->postParams()
374
-                );
375
-                return null;
376
-            }
377
-        } catch (Exception $e) {
378
-            return null;
379
-        }
380
-        return $transaction;
381
-    }
382
-
383
-
384
-    /**
385
-     * Return a PayPal API object, or false on failure.
386
-     *
387
-     * @param EE_Payment_Method $paypal_pm
388
-     * @return bool
389
-     * @throws EE_Error
390
-     * @throws ReflectionException
391
-     */
392
-    public static function isThirdParty(EE_Payment_Method $paypal_pm): bool
393
-    {
394
-        $pp_meta_data = PayPalExtraMetaManager::getAllData($paypal_pm);
395
-        return ! empty($pp_meta_data[ Domain::META_KEY_SELLER_MERCHANT_ID ])
396
-            && ! empty($pp_meta_data[ Domain::META_KEY_ACCESS_TOKEN ]);
397
-    }
398
-
399
-
400
-    /**
401
-     * Retrieve the payment method from the provided data.
402
-     *
403
-     * @return EE_Payment_Method|null
404
-     */
405
-    public static function getPaymentMethod(): ?EE_Payment_Method
406
-    {
407
-        try {
408
-            // Check if all required parameters are present.
409
-            $pm_slug        = EED_Module::getRequest()->getRequestParam('payment_method');
410
-            $payment_method = EEM_Payment_Method::instance()->get_one_by_slug($pm_slug);
411
-            if ($payment_method instanceof EE_Payment_Method) {
412
-                return $payment_method;
413
-            }
414
-        } catch (Exception $e) {
415
-            return null;
416
-        }
417
-        return null;
418
-    }
419
-
420
-
421
-    /**
422
-     * Log JS error.
423
-     *
424
-     * @return void
425
-     */
426
-    public static function logJsError(): void
427
-    {
428
-        // Default to the "first" PayPal checkout PM.
429
-        $request        = EED_Module::getRequest();
430
-        $pm_slug        = $request->getRequestParam('pm_slug', Domain::PM_SLUG);
431
-        $payment_method = null;
432
-        $txn_id         = 'unknown';
433
-        try {
434
-            $payment_method = EEM_Payment_Method::instance()->get_one_of_type($pm_slug);
435
-            $txn_id         = sanitize_text_field($request->getRequestParam('txn_id', '-'));
436
-        } catch (Exception $e) {
437
-            // Don't throw out anything, log at least something.
438
-        }
439
-        $transaction = EED_PayPalCommerce::getTransaction();
440
-        PayPalLogger::errorLog(
441
-            "JS Error on transaction: $txn_id",
442
-            $request->postParams(),
443
-            $payment_method,
444
-            false,
445
-            $transaction
446
-        );
447
-    }
448
-
449
-
450
-    /**
451
-     * Filter the Payment Methods list.
452
-     * if needed, this filter can also supply the $transaction and $scope parameters.
453
-     *
454
-     * @param EE_Payment_Method[] $payment_methods
455
-     * @return array
456
-     * @throws EE_Error
457
-     * @throws ReflectionException
458
-     */
459
-    public static function filterPaymentMethods(array $payment_methods): array
460
-    {
461
-        // Don't allow this PM on the checkout page if not Connected.
462
-        foreach ($payment_methods as $key => $pm) {
463
-            // It is a PayPal Commerce payment method. Check if it's connected. If not - remove from the list.
464
-            if (str_contains($pm->slug(), Domain::PM_SLUG) && ! EED_PayPalOnboard::isOnboard($pm)) {
465
-                unset($payment_methods[ $key ]);
466
-            }
467
-        }
468
-        return $payment_methods;
469
-    }
470
-
471
-
472
-    /**
473
-     *  Get all active states.
474
-     *
475
-     * @return array
476
-     * @throws EE_Error
477
-     * @throws ReflectionException
478
-     */
479
-    public static function getActiveStates(): array
480
-    {
481
-        $state_options = [];
482
-        $states        = EEM_State::instance()->get_all_active_states();
483
-        if (! empty($states)) {
484
-            foreach ($states as $numeral => $state) {
485
-                if ($state instanceof EE_State) {
486
-                    $state_options[ $numeral ] = $state->abbrev();
487
-                }
488
-            }
489
-        }
490
-        return $state_options;
491
-    }
26
+	/**
27
+	 * @return EED_Module
28
+	 * @throws EE_Error
29
+	 * @throws ReflectionException
30
+	 */
31
+	public static function instance(): EED_Module
32
+	{
33
+		return parent::get_instance(__CLASS__);
34
+	}
35
+
36
+
37
+	/**
38
+	 * Run - initial module setup.
39
+	 *
40
+	 * @param WP $WP
41
+	 * @return void
42
+	 */
43
+	public function run($WP)
44
+	{
45
+	}
46
+
47
+
48
+	/**
49
+	 * For hooking into EE Core and other modules.
50
+	 *
51
+	 * @return void
52
+	 */
53
+	public static function set_hooks(): void
54
+	{
55
+		if (DbStatus::isOnline()) {
56
+			// Don't load PM on the front-end if not Connected.
57
+			add_filter(
58
+				'FHEE__EEM_Payment_Method__get_all_for_transaction__payment_methods',
59
+				[__CLASS__, 'filterPaymentMethods'],
60
+				100
61
+			);
62
+		}
63
+	}
64
+
65
+
66
+	/**
67
+	 * For hooking into EE Core and other modules Admin.
68
+	 *
69
+	 * @return void
70
+	 */
71
+	public static function set_hooks_admin(): void
72
+	{
73
+		if (DbStatus::isOnline()) {
74
+			// Create an Order.
75
+			add_action('wp_ajax_eeaPPCCreateOrder', [__CLASS__, 'createOrderRequest']);
76
+			add_action('wp_ajax_nopriv_eeaPPCCreateOrder', [__CLASS__, 'createOrderRequest']);
77
+			// Log errors from the JS side.
78
+			add_action('wp_ajax_eeaPPCommerceLogError', [__CLASS__, 'logJsError']);
79
+			add_action('wp_ajax_nopriv_eeaPPCommerceLogError', [__CLASS__, 'logJsError']);
80
+			// Don't load PM in the admin if not Connected.
81
+			add_filter(
82
+				'FHEE__EEM_Payment_Method__get_all_for_transaction__payment_methods',
83
+				[__CLASS__, 'filterPaymentMethods'],
84
+				100
85
+			);
86
+		}
87
+	}
88
+
89
+
90
+	/**
91
+	 * Create the order and return its data as JSON.
92
+	 * (AJAX)
93
+	 *
94
+	 * @return void
95
+	 * @throws EE_Error
96
+	 * @throws ReflectionException
97
+	 */
98
+	public static function createOrderRequest(): void
99
+	{
100
+		$paypal_pm   = EED_PayPalCommerce::getPaymentMethod();
101
+		$post_params = EED_Module::getRequest()->postParams();
102
+		if (! $paypal_pm instanceof EE_Payment_Method) {
103
+			PayPalLogger::errorLogAndExit(
104
+				esc_html__('Related payment method not found (create Order).', 'event_espresso'),
105
+				$post_params
106
+			);
107
+		}
108
+		$transaction  = EED_PayPalCommerce::getTransaction();
109
+		$billing_info = $post_params['billing_info'] ?? [];
110
+		if ($billing_info) {
111
+			$billing_info_decoded = json_decode(stripslashes($billing_info), true);
112
+			$billing_info         = is_array($billing_info_decoded) ? $billing_info_decoded : [];
113
+		}
114
+		if (! $transaction) {
115
+			PayPalLogger::errorLogAndExit(
116
+				esc_html__('Transaction info not found.', 'event_espresso'),
117
+				$post_params,
118
+				$paypal_pm
119
+			);
120
+		}
121
+		$order_data = EED_PayPalCommerce::createOrder($transaction, $billing_info, $paypal_pm);
122
+		wp_send_json($order_data);
123
+	}
124
+
125
+
126
+	/**
127
+	 * Create a new Order using the PP API.
128
+	 *
129
+	 * @param EE_Transaction    $transaction
130
+	 * @param array             $billing_info
131
+	 * @param EE_Payment_Method $paypal_pm
132
+	 * @return array
133
+	 * @throws EE_Error
134
+	 * @throws ReflectionException
135
+	 */
136
+	public static function createOrder(
137
+		EE_Transaction $transaction,
138
+		array $billing_info,
139
+		EE_Payment_Method $paypal_pm
140
+	): array {
141
+		$create_order_api = EED_PayPalCommerce::getCreateOrderApi($transaction, $billing_info, $paypal_pm);
142
+		if (! $create_order_api instanceof CreateOrder) {
143
+			return [
144
+				'error'   => 'CREATE_ORDER_API_FAULT',
145
+				'message' => esc_html__('The Create Order API request fault.', 'event_espresso'),
146
+			];
147
+		}
148
+		// Make sure we have a payment method saved.
149
+		$payment_method = EED_PayPalCommerce::getPaymentMethod();
150
+		if ($payment_method->ID()) {
151
+			$transaction->set_payment_method_ID($payment_method->ID());
152
+		}
153
+		$order = $create_order_api->create();
154
+		if (isset($order['error'])) {
155
+			$last_payment = $transaction->last_payment();
156
+			if ($last_payment instanceof EE_Payment) {
157
+				EEG_PayPalCheckout::updatePaymentStatus(
158
+					$last_payment,
159
+					EEM_Payment::status_id_failed,
160
+					$order,
161
+					$order['error']
162
+				);
163
+			}
164
+			return [
165
+				'error'    => 'CREATE_ORDER_API_RESPONSE_ERROR',
166
+				'message'  => EEG_PayPalCheckout::getResponseMessage($order['response'], $order['message']),
167
+				'response' => $order['message'],
168
+			];
169
+		}
170
+		return [
171
+			'pp_order_id' => $order['id'],
172
+		];
173
+	}
174
+
175
+
176
+	/**
177
+	 * Create a new Order using the PP API.
178
+	 *
179
+	 * @param EE_Transaction    $transaction
180
+	 * @param EE_Payment_Method $paypal_pm
181
+	 * @param string            $order_id
182
+	 * @return array
183
+	 * @throws EE_Error
184
+	 * @throws ReflectionException
185
+	 */
186
+	public static function captureOrder(
187
+		EE_Transaction    $transaction,
188
+		EE_Payment_Method $paypal_pm,
189
+		string            $order_id
190
+	): array {
191
+		$capture_order_api = EED_PayPalCommerce::getCaptureOrderApi($transaction, $paypal_pm, $order_id);
192
+		if (! $capture_order_api instanceof CaptureOrder) {
193
+			return [
194
+				'error'   => 'CAPTURE_ORDER_API_FAULT',
195
+				'message' => esc_html__('A capture Order API request fault.', 'event_espresso'),
196
+			];
197
+		}
198
+		return $capture_order_api->capture();
199
+	}
200
+
201
+
202
+	/**
203
+	 * Get Order Details using the PP API.
204
+	 *
205
+	 * @param string            $order_id
206
+	 * @param EE_Transaction    $transaction
207
+	 * @param EE_Payment_Method $paypal_pm
208
+	 * @return array
209
+	 * @throws EE_Error
210
+	 * @throws ReflectionException
211
+	 */
212
+	public static function getOrderDetails(
213
+		string            $order_id,
214
+		EE_Transaction    $transaction,
215
+		EE_Payment_Method $paypal_pm
216
+	): array {
217
+		$order_details = EED_PayPalCommerce::getOrderDetailsApi($order_id, $transaction, $paypal_pm);
218
+		if (! $order_details instanceof OrderDetails) {
219
+			return [
220
+				'error'   => 'ORDER_DETAILS_API_FAULT',
221
+				'message' => esc_html__('Get Order Details API request fault.', 'event_espresso'),
222
+			];
223
+		}
224
+		return $order_details->get();
225
+	}
226
+
227
+
228
+	/**
229
+	 * Initialize and return Create Order API.
230
+	 *
231
+	 * @param EE_Transaction    $transaction
232
+	 * @param array             $billing_info
233
+	 * @param EE_Payment_Method $paypal_pm
234
+	 * @return CreateOrder|null
235
+	 * @throws EE_Error
236
+	 * @throws ReflectionException
237
+	 */
238
+	public static function getCreateOrderApi(
239
+		EE_Transaction $transaction,
240
+		array $billing_info,
241
+		EE_Payment_Method $paypal_pm
242
+	): ?CreateOrder {
243
+		$paypal_api = EED_PayPalCommerce::getPayPalApi($paypal_pm);
244
+		if (! $paypal_api instanceof PayPalApi) {
245
+			return null;
246
+		}
247
+		return LoaderFactory::getNew(CreateOrder::class, [$paypal_api, $transaction, $billing_info]);
248
+	}
249
+
250
+
251
+	/**
252
+	 * Initialize and return Capture Order API.
253
+	 *
254
+	 * @param EE_Transaction    $transaction
255
+	 * @param EE_Payment_Method $paypal_pm
256
+	 * @param string            $order_id
257
+	 * @return CaptureOrder|null
258
+	 * @throws EE_Error
259
+	 * @throws ReflectionException
260
+	 */
261
+	public static function getCaptureOrderApi(
262
+		EE_Transaction $transaction,
263
+		EE_Payment_Method $paypal_pm,
264
+		string $order_id
265
+	): ?CaptureOrder {
266
+		$paypal_api = EED_PayPalCommerce::getPayPalApi($paypal_pm);
267
+		if (! $paypal_api instanceof PayPalApi) {
268
+			return null;
269
+		}
270
+		return LoaderFactory::getNew(CaptureOrder::class, [$paypal_api, $transaction, $order_id]);
271
+	}
272
+
273
+
274
+	/**
275
+	 * Initialize and return Order Details API.
276
+	 *
277
+	 * @param EE_Transaction    $transaction
278
+	 * @param EE_Payment_Method $paypal_pm
279
+	 * @param string            $order_id
280
+	 * @return OrderDetails|null
281
+	 * @throws EE_Error
282
+	 * @throws ReflectionException
283
+	 */
284
+	public static function getOrderDetailsApi(
285
+		string $order_id,
286
+		EE_Transaction $transaction,
287
+		EE_Payment_Method $paypal_pm
288
+	): ?OrderDetails {
289
+		$paypal_api = EED_PayPalCommerce::getPayPalApi($paypal_pm);
290
+		if (! $paypal_api instanceof PayPalApi) {
291
+			return null;
292
+		}
293
+		return LoaderFactory::getNew(OrderDetails::class, [$paypal_api, $order_id, $transaction]);
294
+	}
295
+
296
+
297
+	/**
298
+	 * Return a PayPal API object, or false on failure.
299
+	 *
300
+	 * @param EE_Payment_Method $paypal_pm
301
+	 * @return PayPalApi|null
302
+	 * @throws EE_Error
303
+	 * @throws ReflectionException
304
+	 */
305
+	public static function getPayPalApi(EE_Payment_Method $paypal_pm): ?PayPalApi
306
+	{
307
+		// Try getting the first party credentials to determine if this is a first party integration that's active.
308
+		$client_id     = PayPalExtraMetaManager::getPmOption($paypal_pm, Domain::META_KEY_CLIENT_ID);
309
+		$client_secret = PayPalExtraMetaManager::getPmOption($paypal_pm, Domain::META_KEY_CLIENT_SECRET);
310
+		$bn_code       = PayPalExtraMetaManager::getPmOption($paypal_pm, Domain::META_KEY_BN_CODE);
311
+		if ($client_id && $client_secret) {
312
+			return new FirstPartyPayPalApi($client_id, $client_secret, $bn_code, $paypal_pm->debug_mode());
313
+		}
314
+		// Third party integration credentials:
315
+		$access_token = EED_PayPalOnboard::getPartnerAccessToken($paypal_pm);
316
+		if (! $access_token || ! $bn_code) {
317
+			return null;
318
+		}
319
+		$partner_client_id = PayPalExtraMetaManager::getPmOption($paypal_pm, Domain::META_KEY_PARTNER_CLIENT_ID) ?: '';
320
+		$payer_id          = PayPalExtraMetaManager::getPmOption($paypal_pm, Domain::META_KEY_SELLER_MERCHANT_ID) ?: '';
321
+		return new ThirdPartyPayPalApi(
322
+			$access_token,
323
+			$bn_code,
324
+			$partner_client_id,
325
+			$payer_id,
326
+			$paypal_pm->debug_mode()
327
+		);
328
+	}
329
+
330
+
331
+	/**
332
+	 * Requests a client token.
333
+	 *
334
+	 * @param EE_Payment_Method $paypal_pm
335
+	 * @return array
336
+	 * @throws EE_Error
337
+	 * @throws ReflectionException
338
+	 */
339
+	public static function requestClientToken(EE_Payment_Method $paypal_pm): array
340
+	{
341
+		$error      = ['error' => 'GET_CLIENT_TOKEN_FAULT'];
342
+		$paypal_api = EED_PayPalCommerce::getPayPalApi($paypal_pm);
343
+		if (! $paypal_api instanceof PayPalApi) {
344
+			$error['message'] = esc_html__('Got an error while trying to get the client token.', 'event_espresso');
345
+			return $error;
346
+		}
347
+		$client_token_api = new ClientToken($paypal_api, $paypal_pm->debug_mode());
348
+		$client_token     = $client_token_api->getToken();
349
+		if (isset($client_token['error'])) {
350
+			return $client_token;
351
+		}
352
+		if (empty($client_token)) {
353
+			$error['message'] = esc_html__('Client token not valid.', 'event_espresso');
354
+			return $error;
355
+		}
356
+		return $client_token;
357
+	}
358
+
359
+
360
+	/**
361
+	 * Retrieve the payment method from the provided data.
362
+	 *
363
+	 * @return EE_Transaction|null
364
+	 */
365
+	public static function getTransaction(): ?EE_Transaction
366
+	{
367
+		try {
368
+			$txn_id      = EED_Module::getRequest()->getRequestParam('txn_id', 0, DataType::INT);
369
+			$transaction = EEM_Transaction::instance()->get_one_by_ID($txn_id);
370
+			if (! $transaction instanceof EE_Transaction) {
371
+				PayPalLogger::errorLog(
372
+					esc_html__('No transaction found by ID:', 'event_espresso'),
373
+					EED_Module::getRequest()->postParams()
374
+				);
375
+				return null;
376
+			}
377
+		} catch (Exception $e) {
378
+			return null;
379
+		}
380
+		return $transaction;
381
+	}
382
+
383
+
384
+	/**
385
+	 * Return a PayPal API object, or false on failure.
386
+	 *
387
+	 * @param EE_Payment_Method $paypal_pm
388
+	 * @return bool
389
+	 * @throws EE_Error
390
+	 * @throws ReflectionException
391
+	 */
392
+	public static function isThirdParty(EE_Payment_Method $paypal_pm): bool
393
+	{
394
+		$pp_meta_data = PayPalExtraMetaManager::getAllData($paypal_pm);
395
+		return ! empty($pp_meta_data[ Domain::META_KEY_SELLER_MERCHANT_ID ])
396
+			&& ! empty($pp_meta_data[ Domain::META_KEY_ACCESS_TOKEN ]);
397
+	}
398
+
399
+
400
+	/**
401
+	 * Retrieve the payment method from the provided data.
402
+	 *
403
+	 * @return EE_Payment_Method|null
404
+	 */
405
+	public static function getPaymentMethod(): ?EE_Payment_Method
406
+	{
407
+		try {
408
+			// Check if all required parameters are present.
409
+			$pm_slug        = EED_Module::getRequest()->getRequestParam('payment_method');
410
+			$payment_method = EEM_Payment_Method::instance()->get_one_by_slug($pm_slug);
411
+			if ($payment_method instanceof EE_Payment_Method) {
412
+				return $payment_method;
413
+			}
414
+		} catch (Exception $e) {
415
+			return null;
416
+		}
417
+		return null;
418
+	}
419
+
420
+
421
+	/**
422
+	 * Log JS error.
423
+	 *
424
+	 * @return void
425
+	 */
426
+	public static function logJsError(): void
427
+	{
428
+		// Default to the "first" PayPal checkout PM.
429
+		$request        = EED_Module::getRequest();
430
+		$pm_slug        = $request->getRequestParam('pm_slug', Domain::PM_SLUG);
431
+		$payment_method = null;
432
+		$txn_id         = 'unknown';
433
+		try {
434
+			$payment_method = EEM_Payment_Method::instance()->get_one_of_type($pm_slug);
435
+			$txn_id         = sanitize_text_field($request->getRequestParam('txn_id', '-'));
436
+		} catch (Exception $e) {
437
+			// Don't throw out anything, log at least something.
438
+		}
439
+		$transaction = EED_PayPalCommerce::getTransaction();
440
+		PayPalLogger::errorLog(
441
+			"JS Error on transaction: $txn_id",
442
+			$request->postParams(),
443
+			$payment_method,
444
+			false,
445
+			$transaction
446
+		);
447
+	}
448
+
449
+
450
+	/**
451
+	 * Filter the Payment Methods list.
452
+	 * if needed, this filter can also supply the $transaction and $scope parameters.
453
+	 *
454
+	 * @param EE_Payment_Method[] $payment_methods
455
+	 * @return array
456
+	 * @throws EE_Error
457
+	 * @throws ReflectionException
458
+	 */
459
+	public static function filterPaymentMethods(array $payment_methods): array
460
+	{
461
+		// Don't allow this PM on the checkout page if not Connected.
462
+		foreach ($payment_methods as $key => $pm) {
463
+			// It is a PayPal Commerce payment method. Check if it's connected. If not - remove from the list.
464
+			if (str_contains($pm->slug(), Domain::PM_SLUG) && ! EED_PayPalOnboard::isOnboard($pm)) {
465
+				unset($payment_methods[ $key ]);
466
+			}
467
+		}
468
+		return $payment_methods;
469
+	}
470
+
471
+
472
+	/**
473
+	 *  Get all active states.
474
+	 *
475
+	 * @return array
476
+	 * @throws EE_Error
477
+	 * @throws ReflectionException
478
+	 */
479
+	public static function getActiveStates(): array
480
+	{
481
+		$state_options = [];
482
+		$states        = EEM_State::instance()->get_all_active_states();
483
+		if (! empty($states)) {
484
+			foreach ($states as $numeral => $state) {
485
+				if ($state instanceof EE_State) {
486
+					$state_options[ $numeral ] = $state->abbrev();
487
+				}
488
+			}
489
+		}
490
+		return $state_options;
491
+	}
492 492
 }
Please login to merge, or discard this patch.
languages/event_espresso-translations-js.php 1 patch
Spacing   +713 added lines, -713 removed lines patch added patch discarded remove patch
@@ -2,140 +2,140 @@  discard block
 block discarded – undo
2 2
 /* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */
3 3
 $generated_i18n_strings = array(
4 4
 	// Reference: packages/ui-components/src/Pagination/constants.ts:6
5
-	__( '2', 'event_espresso' ),
5
+	__('2', 'event_espresso'),
6 6
 
7 7
 	// Reference: packages/ui-components/src/Pagination/constants.ts:7
8
-	__( '6', 'event_espresso' ),
8
+	__('6', 'event_espresso'),
9 9
 
10 10
 	// Reference: packages/ui-components/src/Pagination/constants.ts:8
11
-	__( '12', 'event_espresso' ),
11
+	__('12', 'event_espresso'),
12 12
 
13 13
 	// Reference: packages/ui-components/src/Pagination/constants.ts:9
14
-	__( '24', 'event_espresso' ),
14
+	__('24', 'event_espresso'),
15 15
 
16 16
 	// Reference: packages/ui-components/src/Pagination/constants.ts:10
17
-	__( '48', 'event_espresso' ),
17
+	__('48', 'event_espresso'),
18 18
 
19 19
 	// Reference: packages/ui-components/src/Pagination/constants.ts:11
20
-	__( '96', 'event_espresso' ),
20
+	__('96', 'event_espresso'),
21 21
 
22 22
 	// Reference: domains/core/admin/blocks/src/components/AvatarImage.tsx:27
23
-	__( 'contact avatar', 'event_espresso' ),
23
+	__('contact avatar', 'event_espresso'),
24 24
 
25 25
 	// Reference: domains/core/admin/blocks/src/components/OrderByControl.tsx:12
26
-	__( 'Order by', 'event_espresso' ),
26
+	__('Order by', 'event_espresso'),
27 27
 
28 28
 	// Reference: domains/core/admin/blocks/src/components/RegStatusControl.tsx:17
29 29
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectStatus.tsx:13
30
-	__( 'Select Registration Status', 'event_espresso' ),
30
+	__('Select Registration Status', 'event_espresso'),
31 31
 
32 32
 	// Reference: domains/core/admin/blocks/src/components/SortOrderControl.tsx:14
33
-	__( 'Ascending', 'event_espresso' ),
33
+	__('Ascending', 'event_espresso'),
34 34
 
35 35
 	// Reference: domains/core/admin/blocks/src/components/SortOrderControl.tsx:18
36
-	__( 'Descending', 'event_espresso' ),
36
+	__('Descending', 'event_espresso'),
37 37
 
38 38
 	// Reference: domains/core/admin/blocks/src/components/SortOrderControl.tsx:24
39
-	__( 'Sort order:', 'event_espresso' ),
39
+	__('Sort order:', 'event_espresso'),
40 40
 
41 41
 	// Reference: domains/core/admin/blocks/src/event-attendees/AttendeesDisplay.tsx:41
42
-	__( 'There was some error fetching attendees list', 'event_espresso' ),
42
+	__('There was some error fetching attendees list', 'event_espresso'),
43 43
 
44 44
 	// Reference: domains/core/admin/blocks/src/event-attendees/AttendeesDisplay.tsx:47
45
-	__( 'To get started, select what event you want to show attendees from in the block settings.', 'event_espresso' ),
45
+	__('To get started, select what event you want to show attendees from in the block settings.', 'event_espresso'),
46 46
 
47 47
 	// Reference: domains/core/admin/blocks/src/event-attendees/AttendeesDisplay.tsx:53
48
-	__( 'There are no attendees for selected options.', 'event_espresso' ),
48
+	__('There are no attendees for selected options.', 'event_espresso'),
49 49
 
50 50
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/ArchiveSettings.tsx:12
51
-	__( 'Display on Archives', 'event_espresso' ),
51
+	__('Display on Archives', 'event_espresso'),
52 52
 
53 53
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/ArchiveSettings.tsx:17
54
-	__( 'Attendees are shown whenever this post is listed in an archive view.', 'event_espresso' ),
54
+	__('Attendees are shown whenever this post is listed in an archive view.', 'event_espresso'),
55 55
 
56 56
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/ArchiveSettings.tsx:18
57
-	__( 'Attendees are hidden whenever this post is listed in an archive view.', 'event_espresso' ),
57
+	__('Attendees are hidden whenever this post is listed in an archive view.', 'event_espresso'),
58 58
 
59 59
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/AttendeeLimit.tsx:29
60
-	__( 'Number of Attendees to Display:', 'event_espresso' ),
60
+	__('Number of Attendees to Display:', 'event_espresso'),
61 61
 
62 62
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/AttendeeLimit.tsx:34
63 63
 	/* translators: %d attendees count */
64
-	_n_noop( 'Used to adjust the number of attendees displayed (There is %d total attendee for the current filter settings).', 'Used to adjust the number of attendees displayed (There are %d total attendees for the current filter settings).', 'event_espresso' ),
64
+	_n_noop('Used to adjust the number of attendees displayed (There is %d total attendee for the current filter settings).', 'Used to adjust the number of attendees displayed (There are %d total attendees for the current filter settings).', 'event_espresso'),
65 65
 
66 66
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/GravatarSettings.tsx:27
67
-	__( 'Display Gravatar', 'event_espresso' ),
67
+	__('Display Gravatar', 'event_espresso'),
68 68
 
69 69
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/GravatarSettings.tsx:32
70
-	__( 'Gravatar images are shown for each attendee.', 'event_espresso' ),
70
+	__('Gravatar images are shown for each attendee.', 'event_espresso'),
71 71
 
72 72
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/GravatarSettings.tsx:33
73
-	__( 'No gravatar images are shown for each attendee.', 'event_espresso' ),
73
+	__('No gravatar images are shown for each attendee.', 'event_espresso'),
74 74
 
75 75
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/GravatarSettings.tsx:38
76
-	__( 'Size of Gravatar', 'event_espresso' ),
76
+	__('Size of Gravatar', 'event_espresso'),
77 77
 
78 78
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectDatetime.tsx:22
79
-	__( 'Select Datetime', 'event_espresso' ),
79
+	__('Select Datetime', 'event_espresso'),
80 80
 
81 81
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectEvent.tsx:22
82 82
 	// Reference: domains/core/admin/blocks/src/event/controls/SelectEvent.tsx:22
83
-	__( 'Select Event', 'event_espresso' ),
83
+	__('Select Event', 'event_espresso'),
84 84
 
85 85
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:11
86
-	__( 'Attendee id', 'event_espresso' ),
86
+	__('Attendee id', 'event_espresso'),
87 87
 
88 88
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:15
89
-	__( 'Last name only', 'event_espresso' ),
89
+	__('Last name only', 'event_espresso'),
90 90
 
91 91
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:19
92
-	__( 'First name only', 'event_espresso' ),
92
+	__('First name only', 'event_espresso'),
93 93
 
94 94
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:23
95
-	__( 'First, then Last name', 'event_espresso' ),
95
+	__('First, then Last name', 'event_espresso'),
96 96
 
97 97
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:27
98
-	__( 'Last, then First name', 'event_espresso' ),
98
+	__('Last, then First name', 'event_espresso'),
99 99
 
100 100
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:41
101
-	__( 'Order Attendees by:', 'event_espresso' ),
101
+	__('Order Attendees by:', 'event_espresso'),
102 102
 
103 103
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectTicket.tsx:22
104
-	__( 'Select Ticket', 'event_espresso' ),
104
+	__('Select Ticket', 'event_espresso'),
105 105
 
106 106
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/index.tsx:21
107
-	__( 'Filter By Settings', 'event_espresso' ),
107
+	__('Filter By Settings', 'event_espresso'),
108 108
 
109 109
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/index.tsx:36
110
-	__( 'Gravatar Setttings', 'event_espresso' ),
110
+	__('Gravatar Setttings', 'event_espresso'),
111 111
 
112 112
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/index.tsx:39
113
-	__( 'Archive Settings', 'event_espresso' ),
113
+	__('Archive Settings', 'event_espresso'),
114 114
 
115 115
 	// Reference: domains/core/admin/blocks/src/event-attendees/index.tsx:10
116
-	__( 'Event Attendees', 'event_espresso' ),
116
+	__('Event Attendees', 'event_espresso'),
117 117
 
118 118
 	// Reference: domains/core/admin/blocks/src/event-attendees/index.tsx:11
119
-	__( 'Displays a list of people that have registered for the specified event', 'event_espresso' ),
119
+	__('Displays a list of people that have registered for the specified event', 'event_espresso'),
120 120
 
121 121
 	// Reference: domains/core/admin/blocks/src/event-attendees/index.tsx:14
122 122
 	// Reference: domains/core/admin/blocks/src/event/index.tsx:12
123 123
 	// Reference: packages/edtr-services/src/constants.ts:25
124
-	__( 'event', 'event_espresso' ),
124
+	__('event', 'event_espresso'),
125 125
 
126 126
 	// Reference: domains/core/admin/blocks/src/event-attendees/index.tsx:14
127
-	__( 'attendees', 'event_espresso' ),
127
+	__('attendees', 'event_espresso'),
128 128
 
129 129
 	// Reference: domains/core/admin/blocks/src/event-attendees/index.tsx:14
130
-	__( 'list', 'event_espresso' ),
130
+	__('list', 'event_espresso'),
131 131
 
132 132
 	// Reference: domains/core/admin/blocks/src/event/DisplayField.tsx:41
133
-	__( 'An unknown error occurred while fetching event details.', 'event_espresso' ),
133
+	__('An unknown error occurred while fetching event details.', 'event_espresso'),
134 134
 
135 135
 	// Reference: domains/core/admin/blocks/src/event/controls/SelectField.tsx:10
136 136
 	// Reference: domains/core/admin/blocks/src/services/utils.ts:24
137 137
 	// Reference: packages/utils/src/list/index.ts:13
138
-	__( 'Select…', 'event_espresso' ),
138
+	__('Select…', 'event_espresso'),
139 139
 
140 140
 	// Reference: domains/core/admin/blocks/src/event/controls/SelectField.tsx:15
141 141
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:75
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:189
145 145
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:48
146 146
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:42
147
-	__( 'Name', 'event_espresso' ),
147
+	__('Name', 'event_espresso'),
148 148
 
149 149
 	// Reference: domains/core/admin/blocks/src/event/controls/SelectField.tsx:19
150 150
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:80
@@ -152,411 +152,411 @@  discard block
 block discarded – undo
152 152
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:194
153 153
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:54
154 154
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:47
155
-	__( 'Description', 'event_espresso' ),
155
+	__('Description', 'event_espresso'),
156 156
 
157 157
 	// Reference: domains/core/admin/blocks/src/event/controls/SelectField.tsx:23
158
-	__( 'Short description', 'event_espresso' ),
158
+	__('Short description', 'event_espresso'),
159 159
 
160 160
 	// Reference: domains/core/admin/blocks/src/event/controls/SelectField.tsx:35
161
-	__( 'Select Field', 'event_espresso' ),
161
+	__('Select Field', 'event_espresso'),
162 162
 
163 163
 	// Reference: domains/core/admin/blocks/src/event/controls/index.tsx:27
164
-	__( 'Text Color', 'event_espresso' ),
164
+	__('Text Color', 'event_espresso'),
165 165
 
166 166
 	// Reference: domains/core/admin/blocks/src/event/controls/index.tsx:32
167
-	__( 'Background Color', 'event_espresso' ),
167
+	__('Background Color', 'event_espresso'),
168 168
 
169 169
 	// Reference: domains/core/admin/blocks/src/event/controls/index.tsx:41
170 170
 	// Reference: packages/form-builder/src/FormElement/Tabs/FormElementTabs.tsx:23
171 171
 	// Reference: packages/form-builder/src/FormSection/Tabs/FormSectionTabs.tsx:22
172
-	__( 'Settings', 'event_espresso' ),
172
+	__('Settings', 'event_espresso'),
173 173
 
174 174
 	// Reference: domains/core/admin/blocks/src/event/controls/index.tsx:45
175
-	__( 'Typography', 'event_espresso' ),
175
+	__('Typography', 'event_espresso'),
176 176
 
177 177
 	// Reference: domains/core/admin/blocks/src/event/controls/index.tsx:48
178
-	__( 'Color', 'event_espresso' ),
178
+	__('Color', 'event_espresso'),
179 179
 
180 180
 	// Reference: domains/core/admin/blocks/src/event/index.tsx:12
181
-	__( 'field', 'event_espresso' ),
181
+	__('field', 'event_espresso'),
182 182
 
183 183
 	// Reference: domains/core/admin/blocks/src/event/index.tsx:8
184
-	__( 'Event Field', 'event_espresso' ),
184
+	__('Event Field', 'event_espresso'),
185 185
 
186 186
 	// Reference: domains/core/admin/blocks/src/event/index.tsx:9
187
-	__( 'Displays the selected field of an event', 'event_espresso' ),
187
+	__('Displays the selected field of an event', 'event_espresso'),
188 188
 
189 189
 	// Reference: domains/core/admin/blocks/src/services/utils.ts:17
190
-	__( 'Error', 'event_espresso' ),
190
+	__('Error', 'event_espresso'),
191 191
 
192 192
 	// Reference: domains/core/admin/blocks/src/services/utils.ts:9
193
-	__( 'Loading…', 'event_espresso' ),
193
+	__('Loading…', 'event_espresso'),
194 194
 
195 195
 	// Reference: domains/core/admin/eventEditor/src/ui/EventDescription.tsx:33
196
-	__( 'Event Description', 'event_espresso' ),
196
+	__('Event Description', 'event_espresso'),
197 197
 
198 198
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/ActiveStatus.tsx:28
199
-	__( 'Active status', 'event_espresso' ),
199
+	__('Active status', 'event_espresso'),
200 200
 
201 201
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/AltRegPage.tsx:12
202
-	__( 'Alternative Registration Page', 'event_espresso' ),
202
+	__('Alternative Registration Page', 'event_espresso'),
203 203
 
204 204
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/DefaultRegistrationStatus.tsx:25
205
-	__( 'Default Registration Status', 'event_espresso' ),
205
+	__('Default Registration Status', 'event_espresso'),
206 206
 
207 207
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/Donations.tsx:8
208
-	__( 'Donations Enabled', 'event_espresso' ),
208
+	__('Donations Enabled', 'event_espresso'),
209 209
 
210 210
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/Donations.tsx:8
211
-	__( 'Donations Disabled', 'event_espresso' ),
211
+	__('Donations Disabled', 'event_espresso'),
212 212
 
213 213
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/EventManager.tsx:16
214
-	__( 'Event Manager', 'event_espresso' ),
214
+	__('Event Manager', 'event_espresso'),
215 215
 
216 216
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/EventPhoneNumber.tsx:15
217
-	__( 'Event Phone Number', 'event_espresso' ),
217
+	__('Event Phone Number', 'event_espresso'),
218 218
 
219 219
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/MaxRegistrations.tsx:13
220
-	__( 'Max Registrations per Transaction', 'event_espresso' ),
220
+	__('Max Registrations per Transaction', 'event_espresso'),
221 221
 
222 222
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/TicketSelector.tsx:8
223
-	__( 'Ticket Selector Enabled', 'event_espresso' ),
223
+	__('Ticket Selector Enabled', 'event_espresso'),
224 224
 
225 225
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/TicketSelector.tsx:8
226
-	__( 'Ticket Selector Disabled', 'event_espresso' ),
226
+	__('Ticket Selector Disabled', 'event_espresso'),
227 227
 
228 228
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/index.tsx:41
229
-	__( 'Event Details', 'event_espresso' ),
229
+	__('Event Details', 'event_espresso'),
230 230
 
231 231
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/index.tsx:47
232
-	__( 'Registration Options', 'event_espresso' ),
232
+	__('Registration Options', 'event_espresso'),
233 233
 
234 234
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:10
235
-	__( 'primary information about the date', 'event_espresso' ),
235
+	__('primary information about the date', 'event_espresso'),
236 236
 
237 237
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:10
238
-	__( 'Date Details', 'event_espresso' ),
238
+	__('Date Details', 'event_espresso'),
239 239
 
240 240
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11
241 241
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:16
242 242
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:16
243
-	__( 'relations between tickets and dates', 'event_espresso' ),
243
+	__('relations between tickets and dates', 'event_espresso'),
244 244
 
245 245
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11
246
-	__( 'Assign Tickets', 'event_espresso' ),
246
+	__('Assign Tickets', 'event_espresso'),
247 247
 
248 248
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/FooterButtons.tsx:22
249
-	__( 'Save and assign tickets', 'event_espresso' ),
249
+	__('Save and assign tickets', 'event_espresso'),
250 250
 
251 251
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/Modal.tsx:30
252 252
 	/* translators: %d database id */
253
-	__( 'Edit datetime %s', 'event_espresso' ),
253
+	__('Edit datetime %s', 'event_espresso'),
254 254
 
255 255
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/Modal.tsx:33
256
-	__( 'New Datetime', 'event_espresso' ),
256
+	__('New Datetime', 'event_espresso'),
257 257
 
258 258
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/Modal.tsx:43
259
-	__( 'modal for datetime', 'event_espresso' ),
259
+	__('modal for datetime', 'event_espresso'),
260 260
 
261 261
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:110
262 262
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:107
263 263
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:224
264 264
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:106
265
-	__( 'Details', 'event_espresso' ),
265
+	__('Details', 'event_espresso'),
266 266
 
267 267
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:114
268 268
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:111
269 269
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:83
270
-	__( 'Capacity', 'event_espresso' ),
270
+	__('Capacity', 'event_espresso'),
271 271
 
272 272
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:119
273
-	__( 'The maximum number of registrants that can attend the event at this particular date.', 'event_espresso' ),
273
+	__('The maximum number of registrants that can attend the event at this particular date.', 'event_espresso'),
274 274
 
275 275
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:123
276
-	__( 'Set to 0 to close registration or leave blank for no limit.', 'event_espresso' ),
276
+	__('Set to 0 to close registration or leave blank for no limit.', 'event_espresso'),
277 277
 
278 278
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:129
279 279
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:164
280
-	__( 'Trash', 'event_espresso' ),
280
+	__('Trash', 'event_espresso'),
281 281
 
282 282
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:71
283 283
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:44
284 284
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:185
285 285
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:44
286
-	__( 'Basics', 'event_espresso' ),
286
+	__('Basics', 'event_espresso'),
287 287
 
288 288
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:88
289 289
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:62
290 290
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:62
291
-	__( 'Dates', 'event_espresso' ),
291
+	__('Dates', 'event_espresso'),
292 292
 
293 293
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:92
294 294
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:53
295 295
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:206
296
-	__( 'Start Date', 'event_espresso' ),
296
+	__('Start Date', 'event_espresso'),
297 297
 
298 298
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:99
299 299
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:67
300 300
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:213
301
-	__( 'End Date', 'event_espresso' ),
301
+	__('End Date', 'event_espresso'),
302 302
 
303 303
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DateRegistrationsLink.tsx:25
304 304
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/TicketRegistrationsLink.tsx:13
305
-	__( 'total registrations.', 'event_espresso' ),
305
+	__('total registrations.', 'event_espresso'),
306 306
 
307 307
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DateRegistrationsLink.tsx:26
308
-	__( 'view ALL registrations for this date.', 'event_espresso' ),
308
+	__('view ALL registrations for this date.', 'event_espresso'),
309 309
 
310 310
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DateSoldLink.tsx:13
311
-	__( 'view approved registrations for this date.', 'event_espresso' ),
311
+	__('view approved registrations for this date.', 'event_espresso'),
312 312
 
313 313
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:35
314 314
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/TableView.tsx:33
315
-	__( 'Event Dates', 'event_espresso' ),
315
+	__('Event Dates', 'event_espresso'),
316 316
 
317 317
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:38
318
-	__( 'loading event dates…', 'event_espresso' ),
318
+	__('loading event dates…', 'event_espresso'),
319 319
 
320 320
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DatesListButtons.tsx:20
321
-	__( 'Add a date or a ticket in order to use Ticket Assignment Manager', 'event_espresso' ),
321
+	__('Add a date or a ticket in order to use Ticket Assignment Manager', 'event_espresso'),
322 322
 
323 323
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DatesListButtons.tsx:30
324
-	__( 'Ticket Assignments', 'event_espresso' ),
324
+	__('Ticket Assignments', 'event_espresso'),
325 325
 
326 326
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:25
327
-	__( 'Number of related tickets', 'event_espresso' ),
327
+	__('Number of related tickets', 'event_espresso'),
328 328
 
329 329
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:26
330
-	__( 'There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso' ),
330
+	__('There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso'),
331 331
 
332 332
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:34
333
-	__( 'assign tickets', 'event_espresso' ),
333
+	__('assign tickets', 'event_espresso'),
334 334
 
335 335
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:21
336
-	__( 'event datetime main menu', 'event_espresso' ),
336
+	__('event datetime main menu', 'event_espresso'),
337 337
 
338 338
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:33
339
-	__( 'edit datetime', 'event_espresso' ),
339
+	__('edit datetime', 'event_espresso'),
340 340
 
341 341
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:34
342
-	__( 'copy datetime', 'event_espresso' ),
342
+	__('copy datetime', 'event_espresso'),
343 343
 
344 344
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DeleteDatetime.tsx:15
345 345
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:48
346
-	__( 'delete permanently', 'event_espresso' ),
346
+	__('delete permanently', 'event_espresso'),
347 347
 
348 348
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DeleteDatetime.tsx:15
349
-	__( 'trash datetime', 'event_espresso' ),
349
+	__('trash datetime', 'event_espresso'),
350 350
 
351 351
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DeleteDatetime.tsx:18
352
-	__( 'Permanently Delete Datetime?', 'event_espresso' ),
352
+	__('Permanently Delete Datetime?', 'event_espresso'),
353 353
 
354 354
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DeleteDatetime.tsx:18
355
-	__( 'Move Datetime to Trash?', 'event_espresso' ),
355
+	__('Move Datetime to Trash?', 'event_espresso'),
356 356
 
357 357
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DeleteDatetime.tsx:20
358
-	__( 'Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso' ),
358
+	__('Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso'),
359 359
 
360 360
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DeleteDatetime.tsx:23
361
-	__( 'Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso' ),
361
+	__('Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso'),
362 362
 
363 363
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DeleteDatetime.tsx:33
364
-	__( 'delete', 'event_espresso' ),
364
+	__('delete', 'event_espresso'),
365 365
 
366 366
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:34
367 367
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:39
368 368
 	// Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:43
369
-	__( 'bulk actions', 'event_espresso' ),
369
+	__('bulk actions', 'event_espresso'),
370 370
 
371 371
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:38
372
-	__( 'edit datetime details', 'event_espresso' ),
372
+	__('edit datetime details', 'event_espresso'),
373 373
 
374 374
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:42
375
-	__( 'delete datetimes', 'event_espresso' ),
375
+	__('delete datetimes', 'event_espresso'),
376 376
 
377 377
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:42
378
-	__( 'trash datetimes', 'event_espresso' ),
378
+	__('trash datetimes', 'event_espresso'),
379 379
 
380 380
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:14
381
-	__( 'Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso' ),
381
+	__('Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso'),
382 382
 
383 383
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:15
384
-	__( 'Are you sure you want to trash these datetimes?', 'event_espresso' ),
384
+	__('Are you sure you want to trash these datetimes?', 'event_espresso'),
385 385
 
386 386
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:16
387
-	__( 'Delete datetimes permanently', 'event_espresso' ),
387
+	__('Delete datetimes permanently', 'event_espresso'),
388 388
 
389 389
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:16
390
-	__( 'Trash datetimes', 'event_espresso' ),
390
+	__('Trash datetimes', 'event_espresso'),
391 391
 
392 392
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:21
393
-	__( 'Bulk edit date details', 'event_espresso' ),
393
+	__('Bulk edit date details', 'event_espresso'),
394 394
 
395 395
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:22
396
-	__( 'any changes will be applied to ALL of the selected dates.', 'event_espresso' ),
396
+	__('any changes will be applied to ALL of the selected dates.', 'event_espresso'),
397 397
 
398 398
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/formValidation.ts:12
399 399
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/formValidation.ts:12
400
-	__( 'Name must be at least three characters', 'event_espresso' ),
400
+	__('Name must be at least three characters', 'event_espresso'),
401 401
 
402 402
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:66
403 403
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:66
404
-	__( 'Shift dates', 'event_espresso' ),
404
+	__('Shift dates', 'event_espresso'),
405 405
 
406 406
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:91
407 407
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:90
408
-	__( 'earlier', 'event_espresso' ),
408
+	__('earlier', 'event_espresso'),
409 409
 
410 410
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:95
411 411
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:94
412
-	__( 'later', 'event_espresso' ),
412
+	__('later', 'event_espresso'),
413 413
 
414 414
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCapacity.tsx:31
415 415
 	/* translators: click to edit capacity<linebreak>(registration limit)… */
416
-	__( 'click to edit capacity%s(registration limit)…', 'event_espresso' ),
416
+	__('click to edit capacity%s(registration limit)…', 'event_espresso'),
417 417
 
418 418
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:31
419 419
 	// Reference: packages/ee-components/src/SimpleTicketCard/SimpleTicketCard.tsx:27
420 420
 	// Reference: packages/ui-components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:34
421
-	__( 'starts', 'event_espresso' ),
421
+	__('starts', 'event_espresso'),
422 422
 
423 423
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:32
424 424
 	// Reference: packages/ee-components/src/SimpleTicketCard/SimpleTicketCard.tsx:34
425 425
 	// Reference: packages/ui-components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:47
426
-	__( 'ends', 'event_espresso' ),
426
+	__('ends', 'event_espresso'),
427 427
 
428 428
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:32
429
-	__( 'started', 'event_espresso' ),
429
+	__('started', 'event_espresso'),
430 430
 
431 431
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:32
432
-	__( 'ended', 'event_espresso' ),
432
+	__('ended', 'event_espresso'),
433 433
 
434 434
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:46
435
-	__( 'Edit Event Date', 'event_espresso' ),
435
+	__('Edit Event Date', 'event_espresso'),
436 436
 
437 437
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:50
438
-	__( 'edit start and end dates', 'event_espresso' ),
438
+	__('edit start and end dates', 'event_espresso'),
439 439
 
440 440
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:16
441 441
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:16
442
-	__( 'sold', 'event_espresso' ),
442
+	__('sold', 'event_espresso'),
443 443
 
444 444
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:21
445
-	__( 'capacity', 'event_espresso' ),
445
+	__('capacity', 'event_espresso'),
446 446
 
447 447
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:27
448 448
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:26
449
-	__( 'reg list', 'event_espresso' ),
449
+	__('reg list', 'event_espresso'),
450 450
 
451 451
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:43
452 452
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:35
453
-	__( 'add description…', 'event_espresso' ),
453
+	__('add description…', 'event_espresso'),
454 454
 
455 455
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:44
456 456
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:36
457
-	__( 'Edit description', 'event_espresso' ),
457
+	__('Edit description', 'event_espresso'),
458 458
 
459 459
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:45
460 460
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:37
461
-	__( 'click to edit description…', 'event_espresso' ),
461
+	__('click to edit description…', 'event_espresso'),
462 462
 
463 463
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:14
464
-	__( 'View Registrations for this Date', 'event_espresso' ),
464
+	__('View Registrations for this Date', 'event_espresso'),
465 465
 
466 466
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:19
467
-	__( 'Manage Ticket Assignments', 'event_espresso' ),
467
+	__('Manage Ticket Assignments', 'event_espresso'),
468 468
 
469 469
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:24
470
-	__( 'Move Date to Trash', 'event_espresso' ),
470
+	__('Move Date to Trash', 'event_espresso'),
471 471
 
472 472
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:29
473 473
 	// Reference: packages/constants/src/datetime.ts:6
474
-	__( 'Active', 'event_espresso' ),
474
+	__('Active', 'event_espresso'),
475 475
 
476 476
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:30
477 477
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:29
478
-	__( 'Trashed', 'event_espresso' ),
478
+	__('Trashed', 'event_espresso'),
479 479
 
480 480
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:31
481 481
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:30
482 482
 	// Reference: packages/constants/src/datetime.ts:8
483
-	__( 'Expired', 'event_espresso' ),
483
+	__('Expired', 'event_espresso'),
484 484
 
485 485
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:32
486 486
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:32
487
-	__( 'Sold Out', 'event_espresso' ),
487
+	__('Sold Out', 'event_espresso'),
488 488
 
489 489
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:33
490 490
 	// Reference: packages/constants/src/datetime.ts:12
491
-	__( 'Upcoming', 'event_espresso' ),
491
+	__('Upcoming', 'event_espresso'),
492 492
 
493 493
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:9
494
-	__( 'Edit Event Date Details', 'event_espresso' ),
494
+	__('Edit Event Date Details', 'event_espresso'),
495 495
 
496 496
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/editable/EditableName.tsx:41
497 497
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/editable/EditableName.tsx:41
498
-	__( 'click to edit title…', 'event_espresso' ),
498
+	__('click to edit title…', 'event_espresso'),
499 499
 
500 500
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/editable/EditableName.tsx:42
501 501
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/editable/EditableName.tsx:42
502
-	__( 'add title…', 'event_espresso' ),
502
+	__('add title…', 'event_espresso'),
503 503
 
504 504
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/ActiveDatesFilters.tsx:17
505 505
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/ActiveTicketsFilters.tsx:17
506
-	__( 'ON', 'event_espresso' ),
506
+	__('ON', 'event_espresso'),
507 507
 
508 508
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:10
509
-	__( 'end dates only', 'event_espresso' ),
509
+	__('end dates only', 'event_espresso'),
510 510
 
511 511
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:11
512
-	__( 'start and end dates', 'event_espresso' ),
512
+	__('start and end dates', 'event_espresso'),
513 513
 
514 514
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:16
515
-	__( 'dates above 90% capacity', 'event_espresso' ),
515
+	__('dates above 90% capacity', 'event_espresso'),
516 516
 
517 517
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:17
518
-	__( 'dates above 75% capacity', 'event_espresso' ),
518
+	__('dates above 75% capacity', 'event_espresso'),
519 519
 
520 520
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:18
521
-	__( 'dates above 50% capacity', 'event_espresso' ),
521
+	__('dates above 50% capacity', 'event_espresso'),
522 522
 
523 523
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:19
524
-	__( 'dates below 50% capacity', 'event_espresso' ),
524
+	__('dates below 50% capacity', 'event_espresso'),
525 525
 
526 526
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:23
527
-	__( 'all dates', 'event_espresso' ),
527
+	__('all dates', 'event_espresso'),
528 528
 
529 529
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:24
530
-	__( 'all active and upcoming', 'event_espresso' ),
530
+	__('all active and upcoming', 'event_espresso'),
531 531
 
532 532
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:25
533
-	__( 'active dates only', 'event_espresso' ),
533
+	__('active dates only', 'event_espresso'),
534 534
 
535 535
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:26
536
-	__( 'upcoming dates only', 'event_espresso' ),
536
+	__('upcoming dates only', 'event_espresso'),
537 537
 
538 538
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:27
539
-	__( 'next active or upcoming only', 'event_espresso' ),
539
+	__('next active or upcoming only', 'event_espresso'),
540 540
 
541 541
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:28
542
-	__( 'sold out dates only', 'event_espresso' ),
542
+	__('sold out dates only', 'event_espresso'),
543 543
 
544 544
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:29
545
-	__( 'recently expired dates', 'event_espresso' ),
545
+	__('recently expired dates', 'event_espresso'),
546 546
 
547 547
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:30
548
-	__( 'all expired dates', 'event_espresso' ),
548
+	__('all expired dates', 'event_espresso'),
549 549
 
550 550
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:31
551
-	__( 'trashed dates only', 'event_espresso' ),
551
+	__('trashed dates only', 'event_espresso'),
552 552
 
553 553
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:35
554 554
 	// Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:9
555 555
 	// Reference: packages/dates/src/components/DateRangePicker/index.tsx:60
556
-	__( 'start date', 'event_espresso' ),
556
+	__('start date', 'event_espresso'),
557 557
 
558 558
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:36
559
-	__( 'name', 'event_espresso' ),
559
+	__('name', 'event_espresso'),
560 560
 
561 561
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:37
562 562
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:33
@@ -564,176 +564,176 @@  discard block
 block discarded – undo
564 564
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/HeaderCell.tsx:27
565 565
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:33
566 566
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:23
567
-	__( 'ID', 'event_espresso' ),
567
+	__('ID', 'event_espresso'),
568 568
 
569 569
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:38
570 570
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:47
571
-	__( 'custom order', 'event_espresso' ),
571
+	__('custom order', 'event_espresso'),
572 572
 
573 573
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:42
574 574
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:51
575
-	__( 'display', 'event_espresso' ),
575
+	__('display', 'event_espresso'),
576 576
 
577 577
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:43
578
-	__( 'recurrence', 'event_espresso' ),
578
+	__('recurrence', 'event_espresso'),
579 579
 
580 580
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:44
581 581
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:53
582
-	__( 'sales', 'event_espresso' ),
582
+	__('sales', 'event_espresso'),
583 583
 
584 584
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:45
585 585
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:55
586
-	__( 'sort by', 'event_espresso' ),
586
+	__('sort by', 'event_espresso'),
587 587
 
588 588
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:46
589 589
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:54
590 590
 	// Reference: packages/ee-components/src/EntityList/EntityListFilterBar.tsx:38
591
-	__( 'search', 'event_espresso' ),
591
+	__('search', 'event_espresso'),
592 592
 
593 593
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:47
594 594
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:56
595
-	__( 'status', 'event_espresso' ),
595
+	__('status', 'event_espresso'),
596 596
 
597 597
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:9
598
-	__( 'start dates only', 'event_espresso' ),
598
+	__('start dates only', 'event_espresso'),
599 599
 
600 600
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:26
601 601
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/NewDateModal.tsx:12
602 602
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/OptionsModalButton.tsx:18
603
-	__( 'Add New Date', 'event_espresso' ),
603
+	__('Add New Date', 'event_espresso'),
604 604
 
605 605
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:26
606
-	__( 'Add Single Date', 'event_espresso' ),
606
+	__('Add Single Date', 'event_espresso'),
607 607
 
608 608
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:44
609
-	__( 'Add a single date that only occurs once', 'event_espresso' ),
609
+	__('Add a single date that only occurs once', 'event_espresso'),
610 610
 
611 611
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:46
612
-	__( 'Single Date', 'event_espresso' ),
612
+	__('Single Date', 'event_espresso'),
613 613
 
614 614
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:108
615
-	__( 'Reg list', 'event_espresso' ),
615
+	__('Reg list', 'event_espresso'),
616 616
 
617 617
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:109
618
-	__( 'Regs', 'event_espresso' ),
618
+	__('Regs', 'event_espresso'),
619 619
 
620 620
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:124
621 621
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:123
622 622
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:59
623
-	__( 'Actions', 'event_espresso' ),
623
+	__('Actions', 'event_espresso'),
624 624
 
625 625
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:54
626
-	__( 'Start', 'event_espresso' ),
626
+	__('Start', 'event_espresso'),
627 627
 
628 628
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:68
629
-	__( 'End', 'event_espresso' ),
629
+	__('End', 'event_espresso'),
630 630
 
631 631
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:84
632
-	__( 'Cap', 'event_espresso' ),
632
+	__('Cap', 'event_espresso'),
633 633
 
634 634
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:96
635 635
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:100
636
-	__( 'Sold', 'event_espresso' ),
636
+	__('Sold', 'event_espresso'),
637 637
 
638 638
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:33
639 639
 	// Reference: packages/form-builder/src/constants.ts:67
640
-	__( 'Text Input', 'event_espresso' ),
640
+	__('Text Input', 'event_espresso'),
641 641
 
642 642
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:34
643 643
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:32
644
-	__( 'Attendee First Name', 'event_espresso' ),
644
+	__('Attendee First Name', 'event_espresso'),
645 645
 
646 646
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:39
647 647
 	/* translators: field name */
648
-	__( 'Registration form must have a field of type "%1$s" which maps to "%2$s"', 'event_espresso' ),
648
+	__('Registration form must have a field of type "%1$s" which maps to "%2$s"', 'event_espresso'),
649 649
 
650 650
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:40
651 651
 	// Reference: packages/form-builder/src/constants.ts:82
652
-	__( 'Email Address', 'event_espresso' ),
652
+	__('Email Address', 'event_espresso'),
653 653
 
654 654
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:41
655 655
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:40
656
-	__( 'Attendee Email Address', 'event_espresso' ),
656
+	__('Attendee Email Address', 'event_espresso'),
657 657
 
658 658
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:49
659
-	__( 'Please add the required fields', 'event_espresso' ),
659
+	__('Please add the required fields', 'event_espresso'),
660 660
 
661 661
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/RegistrationForm.tsx:12
662
-	__( 'Registration Form', 'event_espresso' ),
662
+	__('Registration Form', 'event_espresso'),
663 663
 
664 664
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:13
665
-	__( 'primary registrant', 'event_espresso' ),
665
+	__('primary registrant', 'event_espresso'),
666 666
 
667 667
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:17
668
-	__( 'purchaser', 'event_espresso' ),
668
+	__('purchaser', 'event_espresso'),
669 669
 
670 670
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:21
671
-	__( 'registrants', 'event_espresso' ),
671
+	__('registrants', 'event_espresso'),
672 672
 
673 673
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:36
674
-	__( 'Attendee Last Name', 'event_espresso' ),
674
+	__('Attendee Last Name', 'event_espresso'),
675 675
 
676 676
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:44
677
-	__( 'Attendee Address', 'event_espresso' ),
677
+	__('Attendee Address', 'event_espresso'),
678 678
 
679 679
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:9
680
-	__( 'all', 'event_espresso' ),
680
+	__('all', 'event_espresso'),
681 681
 
682 682
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:18
683
-	__( 'Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. 
684
-Please correct the assignments for the highlighted cells.', 'event_espresso' ),
683
+	__('Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. 
684
+Please correct the assignments for the highlighted cells.', 'event_espresso'),
685 685
 
686 686
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:22
687
-	__( 'Event Dates must always have at least one Ticket assigned to them but one or more of the Event Dates below does not have any. 
688
-Please correct the assignments for the highlighted cells.', 'event_espresso' ),
687
+	__('Event Dates must always have at least one Ticket assigned to them but one or more of the Event Dates below does not have any. 
688
+Please correct the assignments for the highlighted cells.', 'event_espresso'),
689 689
 
690 690
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:32
691
-	__( 'Please Update Assignments', 'event_espresso' ),
691
+	__('Please Update Assignments', 'event_espresso'),
692 692
 
693 693
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:26
694
-	__( 'There seem to be some dates/tickets which have no tickets/dates assigned. Do you want to fix them now?', 'event_espresso' ),
694
+	__('There seem to be some dates/tickets which have no tickets/dates assigned. Do you want to fix them now?', 'event_espresso'),
695 695
 
696 696
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:29
697
-	__( 'Alert!', 'event_espresso' ),
697
+	__('Alert!', 'event_espresso'),
698 698
 
699 699
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:42
700 700
 	/* translators: 1 entity id, 2 entity name */
701
-	__( 'Ticket Assignment Manager for Datetime: %1$s - %2$s', 'event_espresso' ),
701
+	__('Ticket Assignment Manager for Datetime: %1$s - %2$s', 'event_espresso'),
702 702
 
703 703
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:49
704 704
 	/* translators: 1 entity id, 2 entity name */
705
-	__( 'Ticket Assignment Manager for Ticket: %1$s - %2$s', 'event_espresso' ),
705
+	__('Ticket Assignment Manager for Ticket: %1$s - %2$s', 'event_espresso'),
706 706
 
707 707
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal.tsx:45
708 708
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/Table.tsx:13
709
-	__( 'Ticket Assignment Manager', 'event_espresso' ),
709
+	__('Ticket Assignment Manager', 'event_espresso'),
710 710
 
711 711
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:10
712
-	__( 'existing relation', 'event_espresso' ),
712
+	__('existing relation', 'event_espresso'),
713 713
 
714 714
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:15
715
-	__( 'remove existing relation', 'event_espresso' ),
715
+	__('remove existing relation', 'event_espresso'),
716 716
 
717 717
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:20
718
-	__( 'add new relation', 'event_espresso' ),
718
+	__('add new relation', 'event_espresso'),
719 719
 
720 720
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:25
721
-	__( 'invalid relation', 'event_espresso' ),
721
+	__('invalid relation', 'event_espresso'),
722 722
 
723 723
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:29
724
-	__( 'no relation', 'event_espresso' ),
724
+	__('no relation', 'event_espresso'),
725 725
 
726 726
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:15
727
-	__( 'Assignments', 'event_espresso' ),
727
+	__('Assignments', 'event_espresso'),
728 728
 
729 729
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:16
730
-	__( 'Event Dates are listed below', 'event_espresso' ),
730
+	__('Event Dates are listed below', 'event_espresso'),
731 731
 
732 732
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:17
733
-	__( 'Tickets are listed along the top', 'event_espresso' ),
733
+	__('Tickets are listed along the top', 'event_espresso'),
734 734
 
735 735
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:18
736
-	__( 'Click the cell buttons to toggle assigments', 'event_espresso' ),
736
+	__('Click the cell buttons to toggle assigments', 'event_espresso'),
737 737
 
738 738
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/useSubmitButtonProps.ts:29
739 739
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:16
@@ -742,1570 +742,1570 @@  discard block
 block discarded – undo
742 742
 	// Reference: packages/tpc/src/buttons/useSubmitButtonProps.tsx:29
743 743
 	// Reference: packages/ui-components/src/Modal/useSubmitButtonProps.tsx:13
744 744
 	// Reference: packages/ui-components/src/Stepper/buttons/Submit.tsx:7
745
-	__( 'Submit', 'event_espresso' ),
745
+	__('Submit', 'event_espresso'),
746 746
 
747 747
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:20
748
-	__( 'All Dates', 'event_espresso' ),
748
+	__('All Dates', 'event_espresso'),
749 749
 
750 750
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:27
751
-	__( 'dates by month', 'event_espresso' ),
751
+	__('dates by month', 'event_espresso'),
752 752
 
753 753
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowExpiredTicketsControl.tsx:16
754
-	__( 'show expired tickets', 'event_espresso' ),
754
+	__('show expired tickets', 'event_espresso'),
755 755
 
756 756
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedDatesControl.tsx:13
757
-	__( 'show trashed dates', 'event_espresso' ),
757
+	__('show trashed dates', 'event_espresso'),
758 758
 
759 759
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedTicketsControl.tsx:16
760
-	__( 'show trashed tickets', 'event_espresso' ),
760
+	__('show trashed tickets', 'event_espresso'),
761 761
 
762 762
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/Container.tsx:38
763 763
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actions/Actions.tsx:25
764
-	__( 'Default tickets', 'event_espresso' ),
764
+	__('Default tickets', 'event_espresso'),
765 765
 
766 766
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/ModalBody.tsx:63
767 767
 	// Reference: packages/edtr-services/src/constants.ts:26
768
-	__( 'ticket', 'event_espresso' ),
768
+	__('ticket', 'event_espresso'),
769 769
 
770 770
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:26
771 771
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:33
772
-	__( 'Set ticket prices', 'event_espresso' ),
772
+	__('Set ticket prices', 'event_espresso'),
773 773
 
774 774
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:31
775
-	__( 'Skip prices - Save', 'event_espresso' ),
775
+	__('Skip prices - Save', 'event_espresso'),
776 776
 
777 777
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:37
778 778
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:57
779
-	__( 'Ticket details', 'event_espresso' ),
779
+	__('Ticket details', 'event_espresso'),
780 780
 
781 781
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:38
782
-	__( 'Save', 'event_espresso' ),
782
+	__('Save', 'event_espresso'),
783 783
 
784 784
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/Modal.tsx:22
785 785
 	/* translators: %s ticket id */
786
-	__( 'Edit ticket %s', 'event_espresso' ),
786
+	__('Edit ticket %s', 'event_espresso'),
787 787
 
788 788
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/Modal.tsx:25
789 789
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/Modal.tsx:33
790
-	__( 'New Ticket Details', 'event_espresso' ),
790
+	__('New Ticket Details', 'event_espresso'),
791 791
 
792 792
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:10
793 793
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:10
794
-	__( 'primary information about the ticket', 'event_espresso' ),
794
+	__('primary information about the ticket', 'event_espresso'),
795 795
 
796 796
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:10
797 797
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:10
798
-	__( 'Ticket Details', 'event_espresso' ),
798
+	__('Ticket Details', 'event_espresso'),
799 799
 
800 800
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:12
801 801
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:12
802
-	__( 'apply ticket price modifiers and taxes', 'event_espresso' ),
802
+	__('apply ticket price modifiers and taxes', 'event_espresso'),
803 803
 
804 804
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:14
805 805
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:14
806
-	__( 'Price Calculator', 'event_espresso' ),
806
+	__('Price Calculator', 'event_espresso'),
807 807
 
808 808
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:16
809 809
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:16
810
-	__( 'Assign Dates', 'event_espresso' ),
810
+	__('Assign Dates', 'event_espresso'),
811 811
 
812 812
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:39
813
-	__( 'Skip prices - assign dates', 'event_espresso' ),
813
+	__('Skip prices - assign dates', 'event_espresso'),
814 814
 
815 815
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:50
816
-	__( 'Save and assign dates', 'event_espresso' ),
816
+	__('Save and assign dates', 'event_espresso'),
817 817
 
818 818
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/Modal.tsx:29
819 819
 	/* translators: %1$s ticket name, %2$s ticket id */
820
-	__( 'Edit ticket "%1$s" - %2$s', 'event_espresso' ),
820
+	__('Edit ticket "%1$s" - %2$s', 'event_espresso'),
821 821
 
822 822
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/Modal.tsx:43
823
-	__( 'modal for ticket', 'event_espresso' ),
823
+	__('modal for ticket', 'event_espresso'),
824 824
 
825 825
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:101
826
-	__( 'Set to 0 to stop sales, or leave blank for no limit.', 'event_espresso' ),
826
+	__('Set to 0 to stop sales, or leave blank for no limit.', 'event_espresso'),
827 827
 
828 828
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:107
829 829
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:119
830
-	__( 'Number of Uses', 'event_espresso' ),
830
+	__('Number of Uses', 'event_espresso'),
831 831
 
832 832
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:113
833
-	__( 'Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.', 'event_espresso' ),
833
+	__('Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.', 'event_espresso'),
834 834
 
835 835
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:117
836
-	__( 'Example: A ticket might have access to 4 different dates, but setting this field to 2 would mean that the ticket could only be used twice. Leave blank for no limit.', 'event_espresso' ),
836
+	__('Example: A ticket might have access to 4 different dates, but setting this field to 2 would mean that the ticket could only be used twice. Leave blank for no limit.', 'event_espresso'),
837 837
 
838 838
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:125
839 839
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:127
840
-	__( 'Minimum Quantity', 'event_espresso' ),
840
+	__('Minimum Quantity', 'event_espresso'),
841 841
 
842 842
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:130
843
-	__( 'The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso' ),
843
+	__('The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso'),
844 844
 
845 845
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:134
846
-	__( 'Leave blank for no minimum.', 'event_espresso' ),
846
+	__('Leave blank for no minimum.', 'event_espresso'),
847 847
 
848 848
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:140
849 849
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:135
850
-	__( 'Maximum Quantity', 'event_espresso' ),
850
+	__('Maximum Quantity', 'event_espresso'),
851 851
 
852 852
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:146
853
-	__( 'The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso' ),
853
+	__('The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso'),
854 854
 
855 855
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:150
856
-	__( 'Leave blank for no maximum.', 'event_espresso' ),
856
+	__('Leave blank for no maximum.', 'event_espresso'),
857 857
 
858 858
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:156
859 859
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:144
860
-	__( 'Required Ticket', 'event_espresso' ),
860
+	__('Required Ticket', 'event_espresso'),
861 861
 
862 862
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:158
863
-	__( 'If enabled, the ticket must be selected and will appear first in ticket lists.', 'event_espresso' ),
863
+	__('If enabled, the ticket must be selected and will appear first in ticket lists.', 'event_espresso'),
864 864
 
865 865
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:170
866
-	__( 'Visibility', 'event_espresso' ),
866
+	__('Visibility', 'event_espresso'),
867 867
 
868 868
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:202
869
-	__( 'Ticket Sales', 'event_espresso' ),
869
+	__('Ticket Sales', 'event_espresso'),
870 870
 
871 871
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:93
872 872
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:110
873
-	__( 'Quantity For Sale', 'event_espresso' ),
873
+	__('Quantity For Sale', 'event_espresso'),
874 874
 
875 875
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:99
876
-	__( 'The maximum number of this ticket available for sale.', 'event_espresso' ),
876
+	__('The maximum number of this ticket available for sale.', 'event_espresso'),
877 877
 
878 878
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/TicketRegistrationsLink.tsx:14
879
-	__( 'view ALL registrations for this ticket.', 'event_espresso' ),
879
+	__('view ALL registrations for this ticket.', 'event_espresso'),
880 880
 
881 881
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/TicketSoldLink.tsx:13
882
-	__( 'view approved registrations for this ticket.', 'event_espresso' ),
882
+	__('view approved registrations for this ticket.', 'event_espresso'),
883 883
 
884 884
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:36
885
-	__( 'Available Tickets', 'event_espresso' ),
885
+	__('Available Tickets', 'event_espresso'),
886 886
 
887 887
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:39
888
-	__( 'loading tickets…', 'event_espresso' ),
888
+	__('loading tickets…', 'event_espresso'),
889 889
 
890 890
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:26
891
-	__( 'Number of related dates', 'event_espresso' ),
891
+	__('Number of related dates', 'event_espresso'),
892 892
 
893 893
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:27
894
-	__( 'There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso' ),
894
+	__('There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso'),
895 895
 
896 896
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:37
897
-	__( 'assign dates', 'event_espresso' ),
897
+	__('assign dates', 'event_espresso'),
898 898
 
899 899
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:19
900
-	__( 'Permanently Delete Ticket?', 'event_espresso' ),
900
+	__('Permanently Delete Ticket?', 'event_espresso'),
901 901
 
902 902
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:19
903
-	__( 'Move Ticket to Trash?', 'event_espresso' ),
903
+	__('Move Ticket to Trash?', 'event_espresso'),
904 904
 
905 905
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:22
906
-	__( 'Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso' ),
906
+	__('Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso'),
907 907
 
908 908
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:48
909 909
 	// Reference: packages/ee-components/src/SimpleTicketCard/actions/Trash.tsx:6
910
-	__( 'trash ticket', 'event_espresso' ),
910
+	__('trash ticket', 'event_espresso'),
911 911
 
912 912
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:25
913
-	__( 'ticket main menu', 'event_espresso' ),
913
+	__('ticket main menu', 'event_espresso'),
914 914
 
915 915
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:38
916 916
 	// Reference: packages/ee-components/src/SimpleTicketCard/actions/Edit.tsx:15
917
-	__( 'edit ticket', 'event_espresso' ),
917
+	__('edit ticket', 'event_espresso'),
918 918
 
919 919
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:39
920
-	__( 'copy ticket', 'event_espresso' ),
920
+	__('copy ticket', 'event_espresso'),
921 921
 
922 922
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:43
923
-	__( 'edit ticket details', 'event_espresso' ),
923
+	__('edit ticket details', 'event_espresso'),
924 924
 
925 925
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:47
926
-	__( 'delete tickets', 'event_espresso' ),
926
+	__('delete tickets', 'event_espresso'),
927 927
 
928 928
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:47
929
-	__( 'trash tickets', 'event_espresso' ),
929
+	__('trash tickets', 'event_espresso'),
930 930
 
931 931
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:51
932
-	__( 'edit ticket prices', 'event_espresso' ),
932
+	__('edit ticket prices', 'event_espresso'),
933 933
 
934 934
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:14
935
-	__( 'Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso' ),
935
+	__('Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso'),
936 936
 
937 937
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:15
938
-	__( 'Are you sure you want to trash these tickets?', 'event_espresso' ),
938
+	__('Are you sure you want to trash these tickets?', 'event_espresso'),
939 939
 
940 940
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:16
941
-	__( 'Delete tickets permanently', 'event_espresso' ),
941
+	__('Delete tickets permanently', 'event_espresso'),
942 942
 
943 943
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:16
944
-	__( 'Trash tickets', 'event_espresso' ),
944
+	__('Trash tickets', 'event_espresso'),
945 945
 
946 946
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:21
947
-	__( 'Bulk edit ticket details', 'event_espresso' ),
947
+	__('Bulk edit ticket details', 'event_espresso'),
948 948
 
949 949
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:22
950
-	__( 'any changes will be applied to ALL of the selected tickets.', 'event_espresso' ),
950
+	__('any changes will be applied to ALL of the selected tickets.', 'event_espresso'),
951 951
 
952 952
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/EditPrices.tsx:19
953
-	__( 'Bulk edit ticket prices', 'event_espresso' ),
953
+	__('Bulk edit ticket prices', 'event_espresso'),
954 954
 
955 955
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:20
956
-	__( 'Edit all prices together', 'event_espresso' ),
956
+	__('Edit all prices together', 'event_espresso'),
957 957
 
958 958
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:21
959
-	__( 'Edit all the selected ticket prices dynamically', 'event_espresso' ),
959
+	__('Edit all the selected ticket prices dynamically', 'event_espresso'),
960 960
 
961 961
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:25
962
-	__( 'Edit prices individually', 'event_espresso' ),
962
+	__('Edit prices individually', 'event_espresso'),
963 963
 
964 964
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:26
965
-	__( 'Edit prices for each ticket individually', 'event_espresso' ),
965
+	__('Edit prices for each ticket individually', 'event_espresso'),
966 966
 
967 967
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:14
968 968
 	// Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:34
969 969
 	// Reference: packages/form/src/ResetButton.tsx:18
970 970
 	// Reference: packages/tpc/src/buttons/useResetButtonProps.tsx:12
971
-	__( 'Reset', 'event_espresso' ),
971
+	__('Reset', 'event_espresso'),
972 972
 
973 973
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:15
974 974
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:76
975 975
 	// Reference: packages/ui-components/src/Modal/useCancelButtonProps.tsx:10
976
-	__( 'Cancel', 'event_espresso' ),
976
+	__('Cancel', 'event_espresso'),
977 977
 
978 978
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/editSeparately/TPCInstance.tsx:26
979 979
 	/* translators: %s ticket name */
980
-	__( 'Edit prices for Ticket: %s', 'event_espresso' ),
980
+	__('Edit prices for Ticket: %s', 'event_espresso'),
981 981
 
982 982
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:30
983
-	__( 'sales start', 'event_espresso' ),
983
+	__('sales start', 'event_espresso'),
984 984
 
985 985
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:33
986
-	__( 'sales began', 'event_espresso' ),
986
+	__('sales began', 'event_espresso'),
987 987
 
988 988
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:35
989
-	__( 'sales ended', 'event_espresso' ),
989
+	__('sales ended', 'event_espresso'),
990 990
 
991 991
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:36
992
-	__( 'sales end', 'event_espresso' ),
992
+	__('sales end', 'event_espresso'),
993 993
 
994 994
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:50
995
-	__( 'Edit Ticket Sale Dates', 'event_espresso' ),
995
+	__('Edit Ticket Sale Dates', 'event_espresso'),
996 996
 
997 997
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:54
998
-	__( 'edit ticket sales start and end dates', 'event_espresso' ),
998
+	__('edit ticket sales start and end dates', 'event_espresso'),
999 999
 
1000 1000
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:21
1001
-	__( 'quantity', 'event_espresso' ),
1001
+	__('quantity', 'event_espresso'),
1002 1002
 
1003 1003
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketQuantity.tsx:28
1004 1004
 	// Reference: packages/edtr-services/src/apollo/mutations/tickets/useUpdateTicketQtyByCapacity.ts:78
1005
-	__( 'Ticket quantity has been adjusted because it cannot be more than the related event date capacity.', 'event_espresso' ),
1005
+	__('Ticket quantity has been adjusted because it cannot be more than the related event date capacity.', 'event_espresso'),
1006 1006
 
1007 1007
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketQuantity.tsx:51
1008
-	__( 'edit quantity of tickets available…', 'event_espresso' ),
1008
+	__('edit quantity of tickets available…', 'event_espresso'),
1009 1009
 
1010 1010
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:14
1011
-	__( 'Manage Date Assignments', 'event_espresso' ),
1011
+	__('Manage Date Assignments', 'event_espresso'),
1012 1012
 
1013 1013
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:19
1014 1014
 	// Reference: packages/tpc/src/components/table/Table.tsx:43
1015
-	__( 'Ticket Price Calculator', 'event_espresso' ),
1015
+	__('Ticket Price Calculator', 'event_espresso'),
1016 1016
 
1017 1017
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:24
1018
-	__( 'Move Ticket to Trash', 'event_espresso' ),
1018
+	__('Move Ticket to Trash', 'event_espresso'),
1019 1019
 
1020 1020
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:31
1021 1021
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:54
1022
-	__( 'On Sale', 'event_espresso' ),
1022
+	__('On Sale', 'event_espresso'),
1023 1023
 
1024 1024
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:33
1025
-	__( 'Pending', 'event_espresso' ),
1025
+	__('Pending', 'event_espresso'),
1026 1026
 
1027 1027
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:9
1028
-	__( 'Edit Ticket Details', 'event_espresso' ),
1028
+	__('Edit Ticket Details', 'event_espresso'),
1029 1029
 
1030 1030
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:39
1031
-	__( 'edit ticket total…', 'event_espresso' ),
1031
+	__('edit ticket total…', 'event_espresso'),
1032 1032
 
1033 1033
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:53
1034
-	__( 'set price…', 'event_espresso' ),
1034
+	__('set price…', 'event_espresso'),
1035 1035
 
1036 1036
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:23
1037
-	__( 'tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso' ),
1037
+	__('tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso'),
1038 1038
 
1039 1039
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:24
1040
-	__( 'tickets list is unlinked and is showing tickets for all event dates', 'event_espresso' ),
1040
+	__('tickets list is unlinked and is showing tickets for all event dates', 'event_espresso'),
1041 1041
 
1042 1042
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:10
1043
-	__( 'ticket sales start and end dates', 'event_espresso' ),
1043
+	__('ticket sales start and end dates', 'event_espresso'),
1044 1044
 
1045 1045
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:15
1046
-	__( 'tickets with 90% or more sold', 'event_espresso' ),
1046
+	__('tickets with 90% or more sold', 'event_espresso'),
1047 1047
 
1048 1048
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:16
1049
-	__( 'tickets with 75% or more sold', 'event_espresso' ),
1049
+	__('tickets with 75% or more sold', 'event_espresso'),
1050 1050
 
1051 1051
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:17
1052
-	__( 'tickets with 50% or more sold', 'event_espresso' ),
1052
+	__('tickets with 50% or more sold', 'event_espresso'),
1053 1053
 
1054 1054
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:19
1055
-	__( 'tickets with less than 50% sold', 'event_espresso' ),
1055
+	__('tickets with less than 50% sold', 'event_espresso'),
1056 1056
 
1057 1057
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:28
1058
-	__( 'all tickets for all dates', 'event_espresso' ),
1058
+	__('all tickets for all dates', 'event_espresso'),
1059 1059
 
1060 1060
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:29
1061
-	__( 'all on sale and sale pending', 'event_espresso' ),
1061
+	__('all on sale and sale pending', 'event_espresso'),
1062 1062
 
1063 1063
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:30
1064
-	__( 'on sale tickets only', 'event_espresso' ),
1064
+	__('on sale tickets only', 'event_espresso'),
1065 1065
 
1066 1066
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:31
1067
-	__( 'sale pending tickets only', 'event_espresso' ),
1067
+	__('sale pending tickets only', 'event_espresso'),
1068 1068
 
1069 1069
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:32
1070
-	__( 'next on sale or sale pending only', 'event_espresso' ),
1070
+	__('next on sale or sale pending only', 'event_espresso'),
1071 1071
 
1072 1072
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:33
1073
-	__( 'sold out tickets only', 'event_espresso' ),
1073
+	__('sold out tickets only', 'event_espresso'),
1074 1074
 
1075 1075
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:34
1076
-	__( 'expired tickets only', 'event_espresso' ),
1076
+	__('expired tickets only', 'event_espresso'),
1077 1077
 
1078 1078
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:35
1079
-	__( 'trashed tickets only', 'event_espresso' ),
1079
+	__('trashed tickets only', 'event_espresso'),
1080 1080
 
1081 1081
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:40
1082
-	__( 'all tickets for above dates', 'event_espresso' ),
1082
+	__('all tickets for above dates', 'event_espresso'),
1083 1083
 
1084 1084
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:44
1085
-	__( 'ticket sale date', 'event_espresso' ),
1085
+	__('ticket sale date', 'event_espresso'),
1086 1086
 
1087 1087
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:45
1088
-	__( 'ticket name', 'event_espresso' ),
1088
+	__('ticket name', 'event_espresso'),
1089 1089
 
1090 1090
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:46
1091
-	__( 'ticket ID', 'event_espresso' ),
1091
+	__('ticket ID', 'event_espresso'),
1092 1092
 
1093 1093
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:52
1094
-	__( 'linked', 'event_espresso' ),
1094
+	__('linked', 'event_espresso'),
1095 1095
 
1096 1096
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:8
1097
-	__( 'ticket sales start date only', 'event_espresso' ),
1097
+	__('ticket sales start date only', 'event_espresso'),
1098 1098
 
1099 1099
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:9
1100
-	__( 'ticket sales end date only', 'event_espresso' ),
1100
+	__('ticket sales end date only', 'event_espresso'),
1101 1101
 
1102 1102
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:18
1103
-	__( 'Add New Ticket', 'event_espresso' ),
1103
+	__('Add New Ticket', 'event_espresso'),
1104 1104
 
1105 1105
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:32
1106
-	__( 'Add a single ticket and assign the dates to it', 'event_espresso' ),
1106
+	__('Add a single ticket and assign the dates to it', 'event_espresso'),
1107 1107
 
1108 1108
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:34
1109
-	__( 'Single Ticket', 'event_espresso' ),
1109
+	__('Single Ticket', 'event_espresso'),
1110 1110
 
1111 1111
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/TableView.tsx:39
1112
-	__( 'Tickets', 'event_espresso' ),
1112
+	__('Tickets', 'event_espresso'),
1113 1113
 
1114 1114
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:110
1115
-	__( 'Reg List', 'event_espresso' ),
1115
+	__('Reg List', 'event_espresso'),
1116 1116
 
1117 1117
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:53
1118
-	__( 'Goes on Sale', 'event_espresso' ),
1118
+	__('Goes on Sale', 'event_espresso'),
1119 1119
 
1120 1120
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:67
1121
-	__( 'Sale Ends', 'event_espresso' ),
1121
+	__('Sale Ends', 'event_espresso'),
1122 1122
 
1123 1123
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:68
1124
-	__( 'Ends', 'event_espresso' ),
1124
+	__('Ends', 'event_espresso'),
1125 1125
 
1126 1126
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:80
1127
-	__( 'Price', 'event_espresso' ),
1127
+	__('Price', 'event_espresso'),
1128 1128
 
1129 1129
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:90
1130
-	__( 'Qty', 'event_espresso' ),
1130
+	__('Qty', 'event_espresso'),
1131 1131
 
1132 1132
 	// Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:104
1133
-	__( 'Venue telephone', 'event_espresso' ),
1133
+	__('Venue telephone', 'event_espresso'),
1134 1134
 
1135 1135
 	// Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:111
1136
-	__( 'Edit this Venue', 'event_espresso' ),
1136
+	__('Edit this Venue', 'event_espresso'),
1137 1137
 
1138 1138
 	// Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:120
1139
-	__( 'Select a Venue for the Event', 'event_espresso' ),
1139
+	__('Select a Venue for the Event', 'event_espresso'),
1140 1140
 
1141 1141
 	// Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:21
1142
-	__( 'Venue Details', 'event_espresso' ),
1142
+	__('Venue Details', 'event_espresso'),
1143 1143
 
1144 1144
 	// Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:39
1145
-	__( 'unlimited space', 'event_espresso' ),
1145
+	__('unlimited space', 'event_espresso'),
1146 1146
 
1147 1147
 	// Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:42
1148 1148
 	/* translators: %d venue capacity */
1149
-	__( 'Space for up to %d people', 'event_espresso' ),
1149
+	__('Space for up to %d people', 'event_espresso'),
1150 1150
 
1151 1151
 	// Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:53
1152
-	__( 'Venue address', 'event_espresso' ),
1152
+	__('Venue address', 'event_espresso'),
1153 1153
 
1154 1154
 	// Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:59
1155
-	__( 'Venue Details card', 'event_espresso' ),
1155
+	__('Venue Details card', 'event_espresso'),
1156 1156
 
1157 1157
 	// Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:68
1158
-	__( 'no image', 'event_espresso' ),
1158
+	__('no image', 'event_espresso'),
1159 1159
 
1160 1160
 	// Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:72
1161
-	__( 'Venue name', 'event_espresso' ),
1161
+	__('Venue name', 'event_espresso'),
1162 1162
 
1163 1163
 	// Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:96
1164
-	__( 'Venue capacity', 'event_espresso' ),
1164
+	__('Venue capacity', 'event_espresso'),
1165 1165
 
1166 1166
 	// Reference: domains/core/admin/wpPluginsPage/src/exitSurvey/Popup.tsx:29
1167
-	__( 'Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso' ),
1167
+	__('Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso'),
1168 1168
 
1169 1169
 	// Reference: domains/core/admin/wpPluginsPage/src/exitSurvey/Popup.tsx:40
1170
-	__( 'Skip', 'event_espresso' ),
1170
+	__('Skip', 'event_espresso'),
1171 1171
 
1172 1172
 	// Reference: domains/core/admin/wpPluginsPage/src/exitSurvey/Popup.tsx:42
1173
-	__( 'Sure I\'ll help', 'event_espresso' ),
1173
+	__('Sure I\'ll help', 'event_espresso'),
1174 1174
 
1175 1175
 	// Reference: packages/adapters/src/Pagination/Pagination.tsx:23
1176
-	__( 'pagination', 'event_espresso' ),
1176
+	__('pagination', 'event_espresso'),
1177 1177
 
1178 1178
 	// Reference: packages/adapters/src/TagSelector/TagSelector.tsx:113
1179
-	__( 'toggle menu', 'event_espresso' ),
1179
+	__('toggle menu', 'event_espresso'),
1180 1180
 
1181 1181
 	// Reference: packages/constants/src/datetime.ts:10
1182
-	__( 'Postponed', 'event_espresso' ),
1182
+	__('Postponed', 'event_espresso'),
1183 1183
 
1184 1184
 	// Reference: packages/constants/src/datetime.ts:11
1185
-	__( 'SoldOut', 'event_espresso' ),
1185
+	__('SoldOut', 'event_espresso'),
1186 1186
 
1187 1187
 	// Reference: packages/constants/src/datetime.ts:7
1188 1188
 	// Reference: packages/predicates/src/registration/statusOptions.ts:11
1189
-	__( 'Cancelled', 'event_espresso' ),
1189
+	__('Cancelled', 'event_espresso'),
1190 1190
 
1191 1191
 	// Reference: packages/constants/src/datetime.ts:9
1192
-	__( 'Inactive', 'event_espresso' ),
1192
+	__('Inactive', 'event_espresso'),
1193 1193
 
1194 1194
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:25
1195
-	__( 'error creating %s', 'event_espresso' ),
1195
+	__('error creating %s', 'event_espresso'),
1196 1196
 
1197 1197
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:26
1198
-	__( 'error deleting %s', 'event_espresso' ),
1198
+	__('error deleting %s', 'event_espresso'),
1199 1199
 
1200 1200
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:27
1201
-	__( 'error updating %s', 'event_espresso' ),
1201
+	__('error updating %s', 'event_espresso'),
1202 1202
 
1203 1203
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:28
1204
-	__( 'creating %s', 'event_espresso' ),
1204
+	__('creating %s', 'event_espresso'),
1205 1205
 
1206 1206
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:29
1207
-	__( 'deleting %s', 'event_espresso' ),
1207
+	__('deleting %s', 'event_espresso'),
1208 1208
 
1209 1209
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:30
1210
-	__( 'updating %s', 'event_espresso' ),
1210
+	__('updating %s', 'event_espresso'),
1211 1211
 
1212 1212
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:31
1213
-	__( 'successfully created %s', 'event_espresso' ),
1213
+	__('successfully created %s', 'event_espresso'),
1214 1214
 
1215 1215
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:32
1216
-	__( 'successfully deleted %s', 'event_espresso' ),
1216
+	__('successfully deleted %s', 'event_espresso'),
1217 1217
 
1218 1218
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:33
1219
-	__( 'successfully updated %s', 'event_espresso' ),
1219
+	__('successfully updated %s', 'event_espresso'),
1220 1220
 
1221 1221
 	// Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:13
1222
-	__( 'day in range', 'event_espresso' ),
1222
+	__('day in range', 'event_espresso'),
1223 1223
 
1224 1224
 	// Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:17
1225 1225
 	// Reference: packages/dates/src/components/DateRangePicker/index.tsx:78
1226
-	__( 'end date', 'event_espresso' ),
1226
+	__('end date', 'event_espresso'),
1227 1227
 
1228 1228
 	// Reference: packages/dates/src/components/DateTimePicker.tsx:17
1229 1229
 	// Reference: packages/dates/src/components/TimePicker.tsx:17
1230 1230
 	// Reference: packages/form-builder/src/state/utils.ts:433
1231
-	__( 'time', 'event_espresso' ),
1231
+	__('time', 'event_espresso'),
1232 1232
 
1233 1233
 	// Reference: packages/dates/src/constants.ts:7
1234
-	__( 'End Date & Time must be set later than the Start Date & Time', 'event_espresso' ),
1234
+	__('End Date & Time must be set later than the Start Date & Time', 'event_espresso'),
1235 1235
 
1236 1236
 	// Reference: packages/dates/src/constants.ts:9
1237
-	__( 'Start Date & Time must be set before the End Date & Time', 'event_espresso' ),
1237
+	__('Start Date & Time must be set before the End Date & Time', 'event_espresso'),
1238 1238
 
1239 1239
 	// Reference: packages/dates/src/utils/misc.ts:16
1240
-	__( 'month(s)', 'event_espresso' ),
1240
+	__('month(s)', 'event_espresso'),
1241 1241
 
1242 1242
 	// Reference: packages/dates/src/utils/misc.ts:17
1243
-	__( 'week(s)', 'event_espresso' ),
1243
+	__('week(s)', 'event_espresso'),
1244 1244
 
1245 1245
 	// Reference: packages/dates/src/utils/misc.ts:18
1246
-	__( 'day(s)', 'event_espresso' ),
1246
+	__('day(s)', 'event_espresso'),
1247 1247
 
1248 1248
 	// Reference: packages/dates/src/utils/misc.ts:19
1249
-	__( 'hour(s)', 'event_espresso' ),
1249
+	__('hour(s)', 'event_espresso'),
1250 1250
 
1251 1251
 	// Reference: packages/dates/src/utils/misc.ts:20
1252
-	__( 'minute(s)', 'event_espresso' ),
1252
+	__('minute(s)', 'event_espresso'),
1253 1253
 
1254 1254
 	// Reference: packages/edtr-services/src/apollo/mutations/useReorderEntities.ts:63
1255
-	__( 'order updated', 'event_espresso' ),
1255
+	__('order updated', 'event_espresso'),
1256 1256
 
1257 1257
 	// Reference: packages/edtr-services/src/constants.ts:24
1258
-	__( 'datetime', 'event_espresso' ),
1258
+	__('datetime', 'event_espresso'),
1259 1259
 
1260 1260
 	// Reference: packages/edtr-services/src/constants.ts:27
1261
-	__( 'price', 'event_espresso' ),
1261
+	__('price', 'event_espresso'),
1262 1262
 
1263 1263
 	// Reference: packages/edtr-services/src/constants.ts:28
1264 1264
 	// Reference: packages/tpc/src/components/price/input/Type.tsx:30
1265
-	__( 'price type', 'event_espresso' ),
1265
+	__('price type', 'event_espresso'),
1266 1266
 
1267 1267
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:38
1268 1268
 	// Reference: packages/ui-components/src/EditDateRangeButton/EditDateRangeButton.tsx:39
1269
-	__( 'End date has been adjusted', 'event_espresso' ),
1269
+	__('End date has been adjusted', 'event_espresso'),
1270 1270
 
1271 1271
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:59
1272
-	__( 'Required', 'event_espresso' ),
1272
+	__('Required', 'event_espresso'),
1273 1273
 
1274 1274
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:64
1275
-	__( 'Start Date is required', 'event_espresso' ),
1275
+	__('Start Date is required', 'event_espresso'),
1276 1276
 
1277 1277
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:68
1278
-	__( 'End Date is required', 'event_espresso' ),
1278
+	__('End Date is required', 'event_espresso'),
1279 1279
 
1280 1280
 	// Reference: packages/ee-components/src/EntityList/EntityList.tsx:30
1281
-	__( 'no results found', 'event_espresso' ),
1281
+	__('no results found', 'event_espresso'),
1282 1282
 
1283 1283
 	// Reference: packages/ee-components/src/EntityList/EntityList.tsx:31
1284
-	__( 'try changing filter settings', 'event_espresso' ),
1284
+	__('try changing filter settings', 'event_espresso'),
1285 1285
 
1286 1286
 	// Reference: packages/ee-components/src/bulkEdit/ActionCheckbox.tsx:38
1287 1287
 	/* translators: %d entity id */
1288
-	__( 'select entity with id %d', 'event_espresso' ),
1288
+	__('select entity with id %d', 'event_espresso'),
1289 1289
 
1290 1290
 	// Reference: packages/ee-components/src/bulkEdit/ActionCheckbox.tsx:41
1291
-	__( 'select all entities', 'event_espresso' ),
1291
+	__('select all entities', 'event_espresso'),
1292 1292
 
1293 1293
 	// Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:21
1294
-	__( 'Note: ', 'event_espresso' ),
1294
+	__('Note: ', 'event_espresso'),
1295 1295
 
1296 1296
 	// Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:21
1297
-	__( 'any changes will be applied to ALL of the selected entities.', 'event_espresso' ),
1297
+	__('any changes will be applied to ALL of the selected entities.', 'event_espresso'),
1298 1298
 
1299 1299
 	// Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:28
1300
-	__( 'Bulk edit details', 'event_espresso' ),
1300
+	__('Bulk edit details', 'event_espresso'),
1301 1301
 
1302 1302
 	// Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:17
1303
-	__( 'Are you sure you want to bulk update the details?', 'event_espresso' ),
1303
+	__('Are you sure you want to bulk update the details?', 'event_espresso'),
1304 1304
 
1305 1305
 	// Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:18
1306
-	__( 'Bulk update details', 'event_espresso' ),
1306
+	__('Bulk update details', 'event_espresso'),
1307 1307
 
1308 1308
 	// Reference: packages/ee-components/src/filterBar/SortByControl/index.tsx:26
1309
-	__( 'set order', 'event_espresso' ),
1309
+	__('set order', 'event_espresso'),
1310 1310
 
1311 1311
 	// Reference: packages/ee-components/src/filterBar/SortByControl/index.tsx:28
1312
-	__( 'Set Custom Dates Order - this is how dates are ordered on the frontend', 'event_espresso' ),
1312
+	__('Set Custom Dates Order - this is how dates are ordered on the frontend', 'event_espresso'),
1313 1313
 
1314 1314
 	// Reference: packages/ee-components/src/filterBar/SortByControl/index.tsx:29
1315
-	__( 'Set Custom Tickets Order - this is how tickets are ordered on the frontend', 'event_espresso' ),
1315
+	__('Set Custom Tickets Order - this is how tickets are ordered on the frontend', 'event_espresso'),
1316 1316
 
1317 1317
 	// Reference: packages/form-builder/src/FormElement/FormElementToolbar.tsx:33
1318
-	__( 'delete form element', 'event_espresso' ),
1318
+	__('delete form element', 'event_espresso'),
1319 1319
 
1320 1320
 	// Reference: packages/form-builder/src/FormElement/FormElementToolbar.tsx:50
1321
-	__( 'form element settings', 'event_espresso' ),
1321
+	__('form element settings', 'event_espresso'),
1322 1322
 
1323 1323
 	// Reference: packages/form-builder/src/FormElement/FormElementToolbar.tsx:60
1324
-	__( 'copy form element', 'event_espresso' ),
1324
+	__('copy form element', 'event_espresso'),
1325 1325
 
1326 1326
 	// Reference: packages/form-builder/src/FormElement/FormElementToolbar.tsx:70
1327
-	__( 'click, hold, and drag to reorder form element', 'event_espresso' ),
1327
+	__('click, hold, and drag to reorder form element', 'event_espresso'),
1328 1328
 
1329 1329
 	// Reference: packages/form-builder/src/FormElement/Tabs/FieldOption.tsx:20
1330
-	__( 'remove option', 'event_espresso' ),
1330
+	__('remove option', 'event_espresso'),
1331 1331
 
1332 1332
 	// Reference: packages/form-builder/src/FormElement/Tabs/FieldOption.tsx:42
1333
-	__( 'value', 'event_espresso' ),
1333
+	__('value', 'event_espresso'),
1334 1334
 
1335 1335
 	// Reference: packages/form-builder/src/FormElement/Tabs/FieldOption.tsx:52
1336
-	__( 'label', 'event_espresso' ),
1336
+	__('label', 'event_espresso'),
1337 1337
 
1338 1338
 	// Reference: packages/form-builder/src/FormElement/Tabs/FieldOption.tsx:63
1339
-	__( 'click, hold, and drag to reorder field option', 'event_espresso' ),
1339
+	__('click, hold, and drag to reorder field option', 'event_espresso'),
1340 1340
 
1341 1341
 	// Reference: packages/form-builder/src/FormElement/Tabs/FieldOptions.tsx:61
1342
-	__( 'Options are the choices you give people to select from.', 'event_espresso' ),
1342
+	__('Options are the choices you give people to select from.', 'event_espresso'),
1343 1343
 
1344 1344
 	// Reference: packages/form-builder/src/FormElement/Tabs/FieldOptions.tsx:63
1345
-	__( 'The value is a simple key that will be saved to the database and the label is what is shown to the user.', 'event_espresso' ),
1345
+	__('The value is a simple key that will be saved to the database and the label is what is shown to the user.', 'event_espresso'),
1346 1346
 
1347 1347
 	// Reference: packages/form-builder/src/FormElement/Tabs/FieldOptions.tsx:96
1348
-	__( 'add new option', 'event_espresso' ),
1348
+	__('add new option', 'event_espresso'),
1349 1349
 
1350 1350
 	// Reference: packages/form-builder/src/FormElement/Tabs/FormElementTabs.tsx:27
1351 1351
 	// Reference: packages/form-builder/src/FormSection/Tabs/FormSectionTabs.tsx:26
1352
-	__( 'Styles', 'event_espresso' ),
1352
+	__('Styles', 'event_espresso'),
1353 1353
 
1354 1354
 	// Reference: packages/form-builder/src/FormElement/Tabs/FormElementTabs.tsx:31
1355
-	__( 'Validation', 'event_espresso' ),
1355
+	__('Validation', 'event_espresso'),
1356 1356
 
1357 1357
 	// Reference: packages/form-builder/src/FormElement/Tabs/InputType.tsx:18
1358
-	__( 'Change input type', 'event_espresso' ),
1358
+	__('Change input type', 'event_espresso'),
1359 1359
 
1360 1360
 	// Reference: packages/form-builder/src/FormElement/Tabs/InputType.tsx:19
1361
-	__( 'Some configurations might be lost. Are you sure you want to change the input type?', 'event_espresso' ),
1361
+	__('Some configurations might be lost. Are you sure you want to change the input type?', 'event_espresso'),
1362 1362
 
1363 1363
 	// Reference: packages/form-builder/src/FormElement/Tabs/InputType.tsx:40
1364
-	__( 'type', 'event_espresso' ),
1364
+	__('type', 'event_espresso'),
1365 1365
 
1366 1366
 	// Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:26
1367 1367
 	// Reference: packages/form-builder/src/FormSection/Tabs/Settings.tsx:17
1368
-	__( 'public label', 'event_espresso' ),
1368
+	__('public label', 'event_espresso'),
1369 1369
 
1370 1370
 	// Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:33
1371 1371
 	// Reference: packages/form-builder/src/FormSection/Tabs/Settings.tsx:22
1372
-	__( 'admin label', 'event_espresso' ),
1372
+	__('admin label', 'event_espresso'),
1373 1373
 
1374 1374
 	// Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:40
1375
-	__( 'content', 'event_espresso' ),
1375
+	__('content', 'event_espresso'),
1376 1376
 
1377 1377
 	// Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:48
1378
-	__( 'options', 'event_espresso' ),
1378
+	__('options', 'event_espresso'),
1379 1379
 
1380 1380
 	// Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:51
1381
-	__( 'placeholder', 'event_espresso' ),
1381
+	__('placeholder', 'event_espresso'),
1382 1382
 
1383 1383
 	// Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:57
1384
-	__( 'admin only', 'event_espresso' ),
1384
+	__('admin only', 'event_espresso'),
1385 1385
 
1386 1386
 	// Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:62
1387
-	__( 'help text', 'event_espresso' ),
1387
+	__('help text', 'event_espresso'),
1388 1388
 
1389 1389
 	// Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:71
1390
-	__( 'maps to', 'event_espresso' ),
1390
+	__('maps to', 'event_espresso'),
1391 1391
 
1392 1392
 	// Reference: packages/form-builder/src/FormElement/Tabs/Styles.tsx:15
1393 1393
 	// Reference: packages/form-builder/src/FormSection/Tabs/Styles.tsx:13
1394
-	__( 'css class', 'event_espresso' ),
1394
+	__('css class', 'event_espresso'),
1395 1395
 
1396 1396
 	// Reference: packages/form-builder/src/FormElement/Tabs/Styles.tsx:20
1397
-	__( 'help text css class', 'event_espresso' ),
1397
+	__('help text css class', 'event_espresso'),
1398 1398
 
1399 1399
 	// Reference: packages/form-builder/src/FormElement/Tabs/Styles.tsx:27
1400
-	__( 'size', 'event_espresso' ),
1400
+	__('size', 'event_espresso'),
1401 1401
 
1402 1402
 	// Reference: packages/form-builder/src/FormElement/Tabs/Styles.tsx:35
1403
-	__( 'step', 'event_espresso' ),
1403
+	__('step', 'event_espresso'),
1404 1404
 
1405 1405
 	// Reference: packages/form-builder/src/FormElement/Tabs/Styles.tsx:41
1406
-	__( 'maxlength', 'event_espresso' ),
1406
+	__('maxlength', 'event_espresso'),
1407 1407
 
1408 1408
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:123
1409
-	__( 'min', 'event_espresso' ),
1409
+	__('min', 'event_espresso'),
1410 1410
 
1411 1411
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:128
1412
-	__( 'max', 'event_espresso' ),
1412
+	__('max', 'event_espresso'),
1413 1413
 
1414 1414
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:28
1415
-	__( 'Germany', 'event_espresso' ),
1415
+	__('Germany', 'event_espresso'),
1416 1416
 
1417 1417
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:32
1418
-	__( 'France', 'event_espresso' ),
1418
+	__('France', 'event_espresso'),
1419 1419
 
1420 1420
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:36
1421
-	__( 'United Kingdom', 'event_espresso' ),
1421
+	__('United Kingdom', 'event_espresso'),
1422 1422
 
1423 1423
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:40
1424
-	__( 'United States', 'event_espresso' ),
1424
+	__('United States', 'event_espresso'),
1425 1425
 
1426 1426
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:44
1427
-	__( 'Custom', 'event_espresso' ),
1427
+	__('Custom', 'event_espresso'),
1428 1428
 
1429 1429
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:54
1430
-	__( 'required', 'event_espresso' ),
1430
+	__('required', 'event_espresso'),
1431 1431
 
1432 1432
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:59
1433
-	__( 'required text', 'event_espresso' ),
1433
+	__('required text', 'event_espresso'),
1434 1434
 
1435 1435
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:66
1436
-	__( 'autocomplete', 'event_espresso' ),
1436
+	__('autocomplete', 'event_espresso'),
1437 1437
 
1438 1438
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:74
1439
-	__( 'custom format', 'event_espresso' ),
1439
+	__('custom format', 'event_espresso'),
1440 1440
 
1441 1441
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:75
1442
-	__( 'format', 'event_espresso' ),
1442
+	__('format', 'event_espresso'),
1443 1443
 
1444 1444
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:83
1445
-	__( 'pattern', 'event_espresso' ),
1445
+	__('pattern', 'event_espresso'),
1446 1446
 
1447 1447
 	// Reference: packages/form-builder/src/FormSection/AddFormElementPopover.tsx:110
1448
-	__( 'add new form element', 'event_espresso' ),
1448
+	__('add new form element', 'event_espresso'),
1449 1449
 
1450 1450
 	// Reference: packages/form-builder/src/FormSection/AddFormElementPopover.tsx:117
1451 1451
 	// Reference: packages/form/src/renderers/RepeatableRenderer.tsx:52
1452
-	__( 'Add', 'event_espresso' ),
1452
+	__('Add', 'event_espresso'),
1453 1453
 
1454 1454
 	// Reference: packages/form-builder/src/FormSection/AddFormElementPopover.tsx:76
1455
-	__( 'Add Form Element', 'event_espresso' ),
1455
+	__('Add Form Element', 'event_espresso'),
1456 1456
 
1457 1457
 	// Reference: packages/form-builder/src/FormSection/AddFormElementPopover.tsx:85
1458
-	__( 'form element order can be changed after adding by using the drag handles in the form element toolbar', 'event_espresso' ),
1458
+	__('form element order can be changed after adding by using the drag handles in the form element toolbar', 'event_espresso'),
1459 1459
 
1460 1460
 	// Reference: packages/form-builder/src/FormSection/AddFormElementPopover.tsx:92
1461
-	__( 'load existing form section', 'event_espresso' ),
1461
+	__('load existing form section', 'event_espresso'),
1462 1462
 
1463 1463
 	// Reference: packages/form-builder/src/FormSection/FormSectionToolbar.tsx:33
1464
-	__( 'delete form section', 'event_espresso' ),
1464
+	__('delete form section', 'event_espresso'),
1465 1465
 
1466 1466
 	// Reference: packages/form-builder/src/FormSection/FormSectionToolbar.tsx:48
1467
-	__( 'form section settings', 'event_espresso' ),
1467
+	__('form section settings', 'event_espresso'),
1468 1468
 
1469 1469
 	// Reference: packages/form-builder/src/FormSection/FormSectionToolbar.tsx:58
1470
-	__( 'copy form section', 'event_espresso' ),
1470
+	__('copy form section', 'event_espresso'),
1471 1471
 
1472 1472
 	// Reference: packages/form-builder/src/FormSection/FormSectionToolbar.tsx:75
1473
-	__( 'click, hold, and drag to reorder form section', 'event_espresso' ),
1473
+	__('click, hold, and drag to reorder form section', 'event_espresso'),
1474 1474
 
1475 1475
 	// Reference: packages/form-builder/src/FormSection/FormSections.tsx:27
1476
-	__( 'Add Form Section', 'event_espresso' ),
1476
+	__('Add Form Section', 'event_espresso'),
1477 1477
 
1478 1478
 	// Reference: packages/form-builder/src/FormSection/SaveSection.tsx:47
1479
-	__( 'save form section for use in other forms', 'event_espresso' ),
1479
+	__('save form section for use in other forms', 'event_espresso'),
1480 1480
 
1481 1481
 	// Reference: packages/form-builder/src/FormSection/SaveSection.tsx:51
1482
-	__( 'save as', 'event_espresso' ),
1482
+	__('save as', 'event_espresso'),
1483 1483
 
1484 1484
 	// Reference: packages/form-builder/src/FormSection/SaveSection.tsx:55
1485
-	__( 'default', 'event_espresso' ),
1485
+	__('default', 'event_espresso'),
1486 1486
 
1487 1487
 	// Reference: packages/form-builder/src/FormSection/SaveSection.tsx:60
1488
-	__( ' a copy of this form section will be automatically added to ALL new events', 'event_espresso' ),
1488
+	__(' a copy of this form section will be automatically added to ALL new events', 'event_espresso'),
1489 1489
 
1490 1490
 	// Reference: packages/form-builder/src/FormSection/SaveSection.tsx:64
1491
-	__( 'shared', 'event_espresso' ),
1491
+	__('shared', 'event_espresso'),
1492 1492
 
1493 1493
 	// Reference: packages/form-builder/src/FormSection/SaveSection.tsx:67
1494
-	__( 'a copy of this form section will be saved for use in other events but not loaded by default', 'event_espresso' ),
1494
+	__('a copy of this form section will be saved for use in other events but not loaded by default', 'event_espresso'),
1495 1495
 
1496 1496
 	// Reference: packages/form-builder/src/FormSection/Tabs/Settings.tsx:27
1497
-	__( 'show label', 'event_espresso' ),
1497
+	__('show label', 'event_espresso'),
1498 1498
 
1499 1499
 	// Reference: packages/form-builder/src/FormSection/Tabs/Settings.tsx:33
1500
-	__( 'applies to', 'event_espresso' ),
1500
+	__('applies to', 'event_espresso'),
1501 1501
 
1502 1502
 	// Reference: packages/form-builder/src/constants.ts:102
1503 1503
 	// Reference: packages/form-builder/src/state/utils.ts:436
1504
-	__( 'URL', 'event_espresso' ),
1504
+	__('URL', 'event_espresso'),
1505 1505
 
1506 1506
 	// Reference: packages/form-builder/src/constants.ts:104
1507
-	__( 'adds a text input for entering a URL address', 'event_espresso' ),
1507
+	__('adds a text input for entering a URL address', 'event_espresso'),
1508 1508
 
1509 1509
 	// Reference: packages/form-builder/src/constants.ts:107
1510
-	__( 'Date', 'event_espresso' ),
1510
+	__('Date', 'event_espresso'),
1511 1511
 
1512 1512
 	// Reference: packages/form-builder/src/constants.ts:109
1513
-	__( 'adds a text input that allows users to enter a date directly via keyboard or a datepicker', 'event_espresso' ),
1513
+	__('adds a text input that allows users to enter a date directly via keyboard or a datepicker', 'event_espresso'),
1514 1514
 
1515 1515
 	// Reference: packages/form-builder/src/constants.ts:112
1516 1516
 	// Reference: packages/form-builder/src/state/utils.ts:369
1517
-	__( 'Local Date', 'event_espresso' ),
1517
+	__('Local Date', 'event_espresso'),
1518 1518
 
1519 1519
 	// Reference: packages/form-builder/src/constants.ts:117
1520
-	__( 'Month', 'event_espresso' ),
1520
+	__('Month', 'event_espresso'),
1521 1521
 
1522 1522
 	// Reference: packages/form-builder/src/constants.ts:119
1523
-	__( 'adds a text input that allows users to enter a month and year directly via keyboard or a datepicker', 'event_espresso' ),
1523
+	__('adds a text input that allows users to enter a month and year directly via keyboard or a datepicker', 'event_espresso'),
1524 1524
 
1525 1525
 	// Reference: packages/form-builder/src/constants.ts:122
1526
-	__( 'Time', 'event_espresso' ),
1526
+	__('Time', 'event_espresso'),
1527 1527
 
1528 1528
 	// Reference: packages/form-builder/src/constants.ts:124
1529
-	__( 'adds a text input that allows users to enter a time directly via keyboard or a timepicker', 'event_espresso' ),
1529
+	__('adds a text input that allows users to enter a time directly via keyboard or a timepicker', 'event_espresso'),
1530 1530
 
1531 1531
 	// Reference: packages/form-builder/src/constants.ts:127
1532
-	__( 'Week', 'event_espresso' ),
1532
+	__('Week', 'event_espresso'),
1533 1533
 
1534 1534
 	// Reference: packages/form-builder/src/constants.ts:129
1535
-	__( 'adds a text input that allows users to enter a week and year directly via keyboard or a datepicker', 'event_espresso' ),
1535
+	__('adds a text input that allows users to enter a week and year directly via keyboard or a datepicker', 'event_espresso'),
1536 1536
 
1537 1537
 	// Reference: packages/form-builder/src/constants.ts:132
1538
-	__( 'Day Selector', 'event_espresso' ),
1538
+	__('Day Selector', 'event_espresso'),
1539 1539
 
1540 1540
 	// Reference: packages/form-builder/src/constants.ts:134
1541
-	__( 'adds a dropdown selector that allows users to select the day of the month (01 to 31)', 'event_espresso' ),
1541
+	__('adds a dropdown selector that allows users to select the day of the month (01 to 31)', 'event_espresso'),
1542 1542
 
1543 1543
 	// Reference: packages/form-builder/src/constants.ts:137
1544
-	__( 'Month Selector', 'event_espresso' ),
1544
+	__('Month Selector', 'event_espresso'),
1545 1545
 
1546 1546
 	// Reference: packages/form-builder/src/constants.ts:139
1547
-	__( 'adds a dropdown selector that allows users to select the month of the year (01 to 12)', 'event_espresso' ),
1547
+	__('adds a dropdown selector that allows users to select the month of the year (01 to 12)', 'event_espresso'),
1548 1548
 
1549 1549
 	// Reference: packages/form-builder/src/constants.ts:142
1550
-	__( 'Year Selector', 'event_espresso' ),
1550
+	__('Year Selector', 'event_espresso'),
1551 1551
 
1552 1552
 	// Reference: packages/form-builder/src/constants.ts:144
1553
-	__( 'adds a dropdown selector that allows users to select the year from a configurable range', 'event_espresso' ),
1553
+	__('adds a dropdown selector that allows users to select the year from a configurable range', 'event_espresso'),
1554 1554
 
1555 1555
 	// Reference: packages/form-builder/src/constants.ts:147
1556
-	__( 'Radio Buttons', 'event_espresso' ),
1556
+	__('Radio Buttons', 'event_espresso'),
1557 1557
 
1558 1558
 	// Reference: packages/form-builder/src/constants.ts:149
1559
-	__( 'adds one or more radio buttons that allow users to only select one option from those provided', 'event_espresso' ),
1559
+	__('adds one or more radio buttons that allow users to only select one option from those provided', 'event_espresso'),
1560 1560
 
1561 1561
 	// Reference: packages/form-builder/src/constants.ts:152
1562 1562
 	// Reference: packages/form-builder/src/state/utils.ts:375
1563
-	__( 'Decimal Number', 'event_espresso' ),
1563
+	__('Decimal Number', 'event_espresso'),
1564 1564
 
1565 1565
 	// Reference: packages/form-builder/src/constants.ts:154
1566
-	__( 'adds a text input that only accepts numbers whose value is a decimal (float)', 'event_espresso' ),
1566
+	__('adds a text input that only accepts numbers whose value is a decimal (float)', 'event_espresso'),
1567 1567
 
1568 1568
 	// Reference: packages/form-builder/src/constants.ts:157
1569 1569
 	// Reference: packages/form-builder/src/state/utils.ts:378
1570
-	__( 'Whole Number', 'event_espresso' ),
1570
+	__('Whole Number', 'event_espresso'),
1571 1571
 
1572 1572
 	// Reference: packages/form-builder/src/constants.ts:159
1573
-	__( 'adds a text input that only accepts numbers whose value is an integer (whole number)', 'event_espresso' ),
1573
+	__('adds a text input that only accepts numbers whose value is an integer (whole number)', 'event_espresso'),
1574 1574
 
1575 1575
 	// Reference: packages/form-builder/src/constants.ts:162
1576
-	__( 'Number Range', 'event_espresso' ),
1576
+	__('Number Range', 'event_espresso'),
1577 1577
 
1578 1578
 	// Reference: packages/form-builder/src/constants.ts:167
1579
-	__( 'Phone Number', 'event_espresso' ),
1579
+	__('Phone Number', 'event_espresso'),
1580 1580
 
1581 1581
 	// Reference: packages/form-builder/src/constants.ts:172
1582
-	__( 'Dropdown', 'event_espresso' ),
1582
+	__('Dropdown', 'event_espresso'),
1583 1583
 
1584 1584
 	// Reference: packages/form-builder/src/constants.ts:174
1585
-	__( 'adds a dropdown selector that accepts a single value', 'event_espresso' ),
1585
+	__('adds a dropdown selector that accepts a single value', 'event_espresso'),
1586 1586
 
1587 1587
 	// Reference: packages/form-builder/src/constants.ts:177
1588
-	__( 'Multi Select', 'event_espresso' ),
1588
+	__('Multi Select', 'event_espresso'),
1589 1589
 
1590 1590
 	// Reference: packages/form-builder/src/constants.ts:179
1591
-	__( 'adds a dropdown selector that accepts multiple values', 'event_espresso' ),
1591
+	__('adds a dropdown selector that accepts multiple values', 'event_espresso'),
1592 1592
 
1593 1593
 	// Reference: packages/form-builder/src/constants.ts:182
1594
-	__( 'Toggle/Switch', 'event_espresso' ),
1594
+	__('Toggle/Switch', 'event_espresso'),
1595 1595
 
1596 1596
 	// Reference: packages/form-builder/src/constants.ts:184
1597
-	__( 'adds a toggle or a switch to accept true or false value', 'event_espresso' ),
1597
+	__('adds a toggle or a switch to accept true or false value', 'event_espresso'),
1598 1598
 
1599 1599
 	// Reference: packages/form-builder/src/constants.ts:187
1600
-	__( 'Multi Checkbox', 'event_espresso' ),
1600
+	__('Multi Checkbox', 'event_espresso'),
1601 1601
 
1602 1602
 	// Reference: packages/form-builder/src/constants.ts:189
1603
-	__( 'adds checkboxes that allow users to select zero or more options from those provided', 'event_espresso' ),
1603
+	__('adds checkboxes that allow users to select zero or more options from those provided', 'event_espresso'),
1604 1604
 
1605 1605
 	// Reference: packages/form-builder/src/constants.ts:192
1606
-	__( 'Country Selector', 'event_espresso' ),
1606
+	__('Country Selector', 'event_espresso'),
1607 1607
 
1608 1608
 	// Reference: packages/form-builder/src/constants.ts:194
1609
-	__( 'adds a dropdown selector populated with names of countries that are enabled for the site', 'event_espresso' ),
1609
+	__('adds a dropdown selector populated with names of countries that are enabled for the site', 'event_espresso'),
1610 1610
 
1611 1611
 	// Reference: packages/form-builder/src/constants.ts:197
1612
-	__( 'State Selector', 'event_espresso' ),
1612
+	__('State Selector', 'event_espresso'),
1613 1613
 
1614 1614
 	// Reference: packages/form-builder/src/constants.ts:202
1615
-	__( 'Button', 'event_espresso' ),
1615
+	__('Button', 'event_espresso'),
1616 1616
 
1617 1617
 	// Reference: packages/form-builder/src/constants.ts:204
1618
-	__( 'adds a button to the form that can be used for triggering fucntionality (requires custom coding)', 'event_espresso' ),
1618
+	__('adds a button to the form that can be used for triggering fucntionality (requires custom coding)', 'event_espresso'),
1619 1619
 
1620 1620
 	// Reference: packages/form-builder/src/constants.ts:207
1621
-	__( 'Reset Button', 'event_espresso' ),
1621
+	__('Reset Button', 'event_espresso'),
1622 1622
 
1623 1623
 	// Reference: packages/form-builder/src/constants.ts:209
1624
-	__( 'adds a button that will reset the form back to its original state.', 'event_espresso' ),
1624
+	__('adds a button that will reset the form back to its original state.', 'event_espresso'),
1625 1625
 
1626 1626
 	// Reference: packages/form-builder/src/constants.ts:55
1627
-	__( 'Form Section', 'event_espresso' ),
1627
+	__('Form Section', 'event_espresso'),
1628 1628
 
1629 1629
 	// Reference: packages/form-builder/src/constants.ts:57
1630
-	__( 'Used for creating logical groupings for questions and form elements. Need to add a heading or description? Use the HTML form element.', 'event_espresso' ),
1630
+	__('Used for creating logical groupings for questions and form elements. Need to add a heading or description? Use the HTML form element.', 'event_espresso'),
1631 1631
 
1632 1632
 	// Reference: packages/form-builder/src/constants.ts:62
1633
-	__( 'HTML Block', 'event_espresso' ),
1633
+	__('HTML Block', 'event_espresso'),
1634 1634
 
1635 1635
 	// Reference: packages/form-builder/src/constants.ts:64
1636
-	__( 'allows you to add HTML like headings or text paragraphs to your form', 'event_espresso' ),
1636
+	__('allows you to add HTML like headings or text paragraphs to your form', 'event_espresso'),
1637 1637
 
1638 1638
 	// Reference: packages/form-builder/src/constants.ts:69
1639
-	__( 'adds a text input that only accepts plain text', 'event_espresso' ),
1639
+	__('adds a text input that only accepts plain text', 'event_espresso'),
1640 1640
 
1641 1641
 	// Reference: packages/form-builder/src/constants.ts:72
1642
-	__( 'Plain Text Area', 'event_espresso' ),
1642
+	__('Plain Text Area', 'event_espresso'),
1643 1643
 
1644 1644
 	// Reference: packages/form-builder/src/constants.ts:74
1645
-	__( 'adds a textarea block that only accepts plain text', 'event_espresso' ),
1645
+	__('adds a textarea block that only accepts plain text', 'event_espresso'),
1646 1646
 
1647 1647
 	// Reference: packages/form-builder/src/constants.ts:77
1648
-	__( 'HTML Text Area', 'event_espresso' ),
1648
+	__('HTML Text Area', 'event_espresso'),
1649 1649
 
1650 1650
 	// Reference: packages/form-builder/src/constants.ts:79
1651
-	__( 'adds a textarea block that accepts text including simple HTML markup', 'event_espresso' ),
1651
+	__('adds a textarea block that accepts text including simple HTML markup', 'event_espresso'),
1652 1652
 
1653 1653
 	// Reference: packages/form-builder/src/constants.ts:84
1654
-	__( 'adds a text input that only accepts a valid email address', 'event_espresso' ),
1654
+	__('adds a text input that only accepts a valid email address', 'event_espresso'),
1655 1655
 
1656 1656
 	// Reference: packages/form-builder/src/constants.ts:87
1657
-	__( 'Email Confirmation', 'event_espresso' ),
1657
+	__('Email Confirmation', 'event_espresso'),
1658 1658
 
1659 1659
 	// Reference: packages/form-builder/src/constants.ts:92
1660
-	__( 'Password', 'event_espresso' ),
1660
+	__('Password', 'event_espresso'),
1661 1661
 
1662 1662
 	// Reference: packages/form-builder/src/constants.ts:94
1663
-	__( 'adds a text input that accepts text but masks what the user enters', 'event_espresso' ),
1663
+	__('adds a text input that accepts text but masks what the user enters', 'event_espresso'),
1664 1664
 
1665 1665
 	// Reference: packages/form-builder/src/constants.ts:97
1666
-	__( 'Password Confirmation', 'event_espresso' ),
1666
+	__('Password Confirmation', 'event_espresso'),
1667 1667
 
1668 1668
 	// Reference: packages/form-builder/src/data/useElementMutator.ts:54
1669
-	__( 'element', 'event_espresso' ),
1669
+	__('element', 'event_espresso'),
1670 1670
 
1671 1671
 	// Reference: packages/form-builder/src/data/useSectionMutator.ts:54
1672
-	__( 'section', 'event_espresso' ),
1672
+	__('section', 'event_espresso'),
1673 1673
 
1674 1674
 	// Reference: packages/form-builder/src/state/utils.ts:360
1675
-	__( 'click', 'event_espresso' ),
1675
+	__('click', 'event_espresso'),
1676 1676
 
1677 1677
 	// Reference: packages/form-builder/src/state/utils.ts:363
1678
-	__( 'checkboxes', 'event_espresso' ),
1678
+	__('checkboxes', 'event_espresso'),
1679 1679
 
1680 1680
 	// Reference: packages/form-builder/src/state/utils.ts:366
1681
-	__( 'date', 'event_espresso' ),
1681
+	__('date', 'event_espresso'),
1682 1682
 
1683 1683
 	// Reference: packages/form-builder/src/state/utils.ts:372
1684
-	__( 'day', 'event_espresso' ),
1684
+	__('day', 'event_espresso'),
1685 1685
 
1686 1686
 	// Reference: packages/form-builder/src/state/utils.ts:381
1687
-	__( 'email address', 'event_espresso' ),
1687
+	__('email address', 'event_espresso'),
1688 1688
 
1689 1689
 	// Reference: packages/form-builder/src/state/utils.ts:384
1690
-	__( 'confirm email address', 'event_espresso' ),
1690
+	__('confirm email address', 'event_espresso'),
1691 1691
 
1692 1692
 	// Reference: packages/form-builder/src/state/utils.ts:388
1693
-	__( 'month', 'event_espresso' ),
1693
+	__('month', 'event_espresso'),
1694 1694
 
1695 1695
 	// Reference: packages/form-builder/src/state/utils.ts:391
1696
-	__( 'password', 'event_espresso' ),
1696
+	__('password', 'event_espresso'),
1697 1697
 
1698 1698
 	// Reference: packages/form-builder/src/state/utils.ts:394
1699
-	__( 'confirm password', 'event_espresso' ),
1699
+	__('confirm password', 'event_espresso'),
1700 1700
 
1701 1701
 	// Reference: packages/form-builder/src/state/utils.ts:397
1702
-	__( 'radio buttons', 'event_espresso' ),
1702
+	__('radio buttons', 'event_espresso'),
1703 1703
 
1704 1704
 	// Reference: packages/form-builder/src/state/utils.ts:400
1705
-	__( 'number range', 'event_espresso' ),
1705
+	__('number range', 'event_espresso'),
1706 1706
 
1707 1707
 	// Reference: packages/form-builder/src/state/utils.ts:403
1708
-	__( 'selection dropdown', 'event_espresso' ),
1708
+	__('selection dropdown', 'event_espresso'),
1709 1709
 
1710 1710
 	// Reference: packages/form-builder/src/state/utils.ts:406
1711
-	__( 'country', 'event_espresso' ),
1711
+	__('country', 'event_espresso'),
1712 1712
 
1713 1713
 	// Reference: packages/form-builder/src/state/utils.ts:409
1714
-	__( 'multi-select dropdown', 'event_espresso' ),
1714
+	__('multi-select dropdown', 'event_espresso'),
1715 1715
 
1716 1716
 	// Reference: packages/form-builder/src/state/utils.ts:412
1717
-	__( 'state/province', 'event_espresso' ),
1717
+	__('state/province', 'event_espresso'),
1718 1718
 
1719 1719
 	// Reference: packages/form-builder/src/state/utils.ts:415
1720
-	__( 'on/off switch', 'event_espresso' ),
1720
+	__('on/off switch', 'event_espresso'),
1721 1721
 
1722 1722
 	// Reference: packages/form-builder/src/state/utils.ts:418
1723
-	__( 'reset', 'event_espresso' ),
1723
+	__('reset', 'event_espresso'),
1724 1724
 
1725 1725
 	// Reference: packages/form-builder/src/state/utils.ts:421
1726
-	__( 'phone number', 'event_espresso' ),
1726
+	__('phone number', 'event_espresso'),
1727 1727
 
1728 1728
 	// Reference: packages/form-builder/src/state/utils.ts:424
1729
-	__( 'text', 'event_espresso' ),
1729
+	__('text', 'event_espresso'),
1730 1730
 
1731 1731
 	// Reference: packages/form-builder/src/state/utils.ts:427
1732
-	__( 'simple textarea', 'event_espresso' ),
1732
+	__('simple textarea', 'event_espresso'),
1733 1733
 
1734 1734
 	// Reference: packages/form-builder/src/state/utils.ts:430
1735
-	__( 'html textarea', 'event_espresso' ),
1735
+	__('html textarea', 'event_espresso'),
1736 1736
 
1737 1737
 	// Reference: packages/form-builder/src/state/utils.ts:439
1738
-	__( 'week', 'event_espresso' ),
1738
+	__('week', 'event_espresso'),
1739 1739
 
1740 1740
 	// Reference: packages/form-builder/src/state/utils.ts:442
1741
-	__( 'year', 'event_espresso' ),
1741
+	__('year', 'event_espresso'),
1742 1742
 
1743 1743
 	// Reference: packages/form/src/adapters/WPMediaImage.tsx:13
1744
-	__( 'Select Image', 'event_espresso' ),
1744
+	__('Select Image', 'event_espresso'),
1745 1745
 
1746 1746
 	// Reference: packages/form/src/adapters/WPMediaImage.tsx:45
1747 1747
 	// Reference: packages/rich-text-editor/src/components/AdvancedTextEditor/toolbarButtons/WPMedia.tsx:11
1748 1748
 	// Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:12
1749 1749
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityTemplate.tsx:32
1750
-	__( 'Select', 'event_espresso' ),
1750
+	__('Select', 'event_espresso'),
1751 1751
 
1752 1752
 	// Reference: packages/form/src/renderers/FormRenderer.tsx:51
1753
-	__( 'Form Errors', 'event_espresso' ),
1753
+	__('Form Errors', 'event_espresso'),
1754 1754
 
1755 1755
 	// Reference: packages/form/src/renderers/RepeatableRenderer.tsx:36
1756 1756
 	/* translators: %d the entry number */
1757
-	__( 'Entry %d', 'event_espresso' ),
1757
+	__('Entry %d', 'event_espresso'),
1758 1758
 
1759 1759
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:11
1760 1760
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:17
1761
-	__( 'sold out', 'event_espresso' ),
1761
+	__('sold out', 'event_espresso'),
1762 1762
 
1763 1763
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:14
1764 1764
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:14
1765
-	__( 'expired', 'event_espresso' ),
1765
+	__('expired', 'event_espresso'),
1766 1766
 
1767 1767
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:17
1768
-	__( 'upcoming', 'event_espresso' ),
1768
+	__('upcoming', 'event_espresso'),
1769 1769
 
1770 1770
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:20
1771
-	__( 'active', 'event_espresso' ),
1771
+	__('active', 'event_espresso'),
1772 1772
 
1773 1773
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:23
1774 1774
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:11
1775
-	__( 'trashed', 'event_espresso' ),
1775
+	__('trashed', 'event_espresso'),
1776 1776
 
1777 1777
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:26
1778
-	__( 'cancelled', 'event_espresso' ),
1778
+	__('cancelled', 'event_espresso'),
1779 1779
 
1780 1780
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:29
1781
-	__( 'postponed', 'event_espresso' ),
1781
+	__('postponed', 'event_espresso'),
1782 1782
 
1783 1783
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:33
1784
-	__( 'inactive', 'event_espresso' ),
1784
+	__('inactive', 'event_espresso'),
1785 1785
 
1786 1786
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:20
1787
-	__( 'pending', 'event_espresso' ),
1787
+	__('pending', 'event_espresso'),
1788 1788
 
1789 1789
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:23
1790
-	__( 'on sale', 'event_espresso' ),
1790
+	__('on sale', 'event_espresso'),
1791 1791
 
1792 1792
 	// Reference: packages/helpers/src/tickets/ticketVisibilityOptions.ts:7
1793
-	__( 'Where the ticket can be viewed throughout the UI. ', 'event_espresso' ),
1793
+	__('Where the ticket can be viewed throughout the UI. ', 'event_espresso'),
1794 1794
 
1795 1795
 	// Reference: packages/predicates/src/registration/statusOptions.ts:16
1796
-	__( 'Declined', 'event_espresso' ),
1796
+	__('Declined', 'event_espresso'),
1797 1797
 
1798 1798
 	// Reference: packages/predicates/src/registration/statusOptions.ts:21
1799
-	__( 'Incomplete', 'event_espresso' ),
1799
+	__('Incomplete', 'event_espresso'),
1800 1800
 
1801 1801
 	// Reference: packages/predicates/src/registration/statusOptions.ts:26
1802
-	__( 'Not Approved', 'event_espresso' ),
1802
+	__('Not Approved', 'event_espresso'),
1803 1803
 
1804 1804
 	// Reference: packages/predicates/src/registration/statusOptions.ts:31
1805
-	__( 'Pending Payment', 'event_espresso' ),
1805
+	__('Pending Payment', 'event_espresso'),
1806 1806
 
1807 1807
 	// Reference: packages/predicates/src/registration/statusOptions.ts:36
1808
-	__( 'Wait List', 'event_espresso' ),
1808
+	__('Wait List', 'event_espresso'),
1809 1809
 
1810 1810
 	// Reference: packages/predicates/src/registration/statusOptions.ts:6
1811
-	__( 'Approved', 'event_espresso' ),
1811
+	__('Approved', 'event_espresso'),
1812 1812
 
1813 1813
 	// Reference: packages/rich-text-editor/src/components/AdvancedTextEditor/toolbarButtons/WPMedia.tsx:9
1814 1814
 	// Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:10
1815
-	__( 'Select media', 'event_espresso' ),
1815
+	__('Select media', 'event_espresso'),
1816 1816
 
1817 1817
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/RichTextEditor.tsx:84
1818
-	__( 'Write something…', 'event_espresso' ),
1818
+	__('Write something…', 'event_espresso'),
1819 1819
 
1820 1820
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/Toolbar.tsx:20
1821
-	__( 'RTE Toolbar', 'event_espresso' ),
1821
+	__('RTE Toolbar', 'event_espresso'),
1822 1822
 
1823 1823
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:11
1824
-	__( 'Normal', 'event_espresso' ),
1824
+	__('Normal', 'event_espresso'),
1825 1825
 
1826 1826
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:12
1827
-	__( 'H1', 'event_espresso' ),
1827
+	__('H1', 'event_espresso'),
1828 1828
 
1829 1829
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:13
1830
-	__( 'H2', 'event_espresso' ),
1830
+	__('H2', 'event_espresso'),
1831 1831
 
1832 1832
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:14
1833
-	__( 'H3', 'event_espresso' ),
1833
+	__('H3', 'event_espresso'),
1834 1834
 
1835 1835
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:15
1836
-	__( 'H4', 'event_espresso' ),
1836
+	__('H4', 'event_espresso'),
1837 1837
 
1838 1838
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:16
1839
-	__( 'H5', 'event_espresso' ),
1839
+	__('H5', 'event_espresso'),
1840 1840
 
1841 1841
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:17
1842
-	__( 'H6', 'event_espresso' ),
1842
+	__('H6', 'event_espresso'),
1843 1843
 
1844 1844
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:18
1845
-	__( 'Block quote', 'event_espresso' ),
1845
+	__('Block quote', 'event_espresso'),
1846 1846
 
1847 1847
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:19
1848
-	__( 'Code', 'event_espresso' ),
1848
+	__('Code', 'event_espresso'),
1849 1849
 
1850 1850
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:36
1851
-	__( 'Set color', 'event_espresso' ),
1851
+	__('Set color', 'event_espresso'),
1852 1852
 
1853 1853
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:45
1854
-	__( 'Text color', 'event_espresso' ),
1854
+	__('Text color', 'event_espresso'),
1855 1855
 
1856 1856
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:47
1857
-	__( 'Background color', 'event_espresso' ),
1857
+	__('Background color', 'event_espresso'),
1858 1858
 
1859 1859
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:39
1860
-	__( 'Add image', 'event_espresso' ),
1860
+	__('Add image', 'event_espresso'),
1861 1861
 
1862 1862
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:51
1863
-	__( 'Image URL', 'event_espresso' ),
1863
+	__('Image URL', 'event_espresso'),
1864 1864
 
1865 1865
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:55
1866
-	__( 'Alt text', 'event_espresso' ),
1866
+	__('Alt text', 'event_espresso'),
1867 1867
 
1868 1868
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:56
1869
-	__( 'Width', 'event_espresso' ),
1869
+	__('Width', 'event_espresso'),
1870 1870
 
1871 1871
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:60
1872
-	__( 'Height', 'event_espresso' ),
1872
+	__('Height', 'event_espresso'),
1873 1873
 
1874 1874
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/link/Component.tsx:54
1875
-	__( 'Edit link', 'event_espresso' ),
1875
+	__('Edit link', 'event_espresso'),
1876 1876
 
1877 1877
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/link/Component.tsx:64
1878
-	__( 'URL title', 'event_espresso' ),
1878
+	__('URL title', 'event_espresso'),
1879 1879
 
1880 1880
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:11
1881
-	__( 'Unordered list', 'event_espresso' ),
1881
+	__('Unordered list', 'event_espresso'),
1882 1882
 
1883 1883
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:12
1884
-	__( 'Ordered list', 'event_espresso' ),
1884
+	__('Ordered list', 'event_espresso'),
1885 1885
 
1886 1886
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:13
1887 1887
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:13
1888
-	__( 'Indent', 'event_espresso' ),
1888
+	__('Indent', 'event_espresso'),
1889 1889
 
1890 1890
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:14
1891 1891
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:14
1892
-	__( 'Outdent', 'event_espresso' ),
1892
+	__('Outdent', 'event_espresso'),
1893 1893
 
1894 1894
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:11
1895
-	__( 'Unordered textalign', 'event_espresso' ),
1895
+	__('Unordered textalign', 'event_espresso'),
1896 1896
 
1897 1897
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:12
1898
-	__( 'Ordered textalign', 'event_espresso' ),
1898
+	__('Ordered textalign', 'event_espresso'),
1899 1899
 
1900 1900
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/render/Image/Toolbar.tsx:32
1901
-	__( 'Image toolbar', 'event_espresso' ),
1901
+	__('Image toolbar', 'event_espresso'),
1902 1902
 
1903 1903
 	// Reference: packages/rich-text-editor/src/components/WithEditMode/WithEditMode.tsx:62
1904 1904
 	// Reference: packages/rich-text-editor/src/rte-old/components/RTEWithEditMode/RTEWithEditMode.tsx:35
1905
-	__( 'Visual editor', 'event_espresso' ),
1905
+	__('Visual editor', 'event_espresso'),
1906 1906
 
1907 1907
 	// Reference: packages/rich-text-editor/src/components/WithEditMode/WithEditMode.tsx:66
1908 1908
 	// Reference: packages/rich-text-editor/src/rte-old/components/RTEWithEditMode/RTEWithEditMode.tsx:39
1909
-	__( 'HTML editor', 'event_espresso' ),
1909
+	__('HTML editor', 'event_espresso'),
1910 1910
 
1911 1911
 	// Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:68
1912
-	__( 'Add Media', 'event_espresso' ),
1912
+	__('Add Media', 'event_espresso'),
1913 1913
 
1914 1914
 	// Reference: packages/tpc/src/buttons/AddPriceModifierButton.tsx:16
1915
-	__( 'add new price modifier after this row', 'event_espresso' ),
1915
+	__('add new price modifier after this row', 'event_espresso'),
1916 1916
 
1917 1917
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:14
1918
-	__( 'Delete all prices', 'event_espresso' ),
1918
+	__('Delete all prices', 'event_espresso'),
1919 1919
 
1920 1920
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:27
1921
-	__( 'Are you sure you want to delete all of this ticket\'s prices and make it free? This action is permanent and can not be undone.', 'event_espresso' ),
1921
+	__('Are you sure you want to delete all of this ticket\'s prices and make it free? This action is permanent and can not be undone.', 'event_espresso'),
1922 1922
 
1923 1923
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:31
1924
-	__( 'Delete all prices?', 'event_espresso' ),
1924
+	__('Delete all prices?', 'event_espresso'),
1925 1925
 
1926 1926
 	// Reference: packages/tpc/src/buttons/DeletePriceModifierButton.tsx:12
1927
-	__( 'delete price modifier', 'event_espresso' ),
1927
+	__('delete price modifier', 'event_espresso'),
1928 1928
 
1929 1929
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:14
1930
-	__( 'Ticket base price is being reverse calculated from bottom to top starting with the ticket total. Entering a new ticket total will reverse calculate the ticket base price after applying all price modifiers in reverse. Click to turn off reverse calculations', 'event_espresso' ),
1930
+	__('Ticket base price is being reverse calculated from bottom to top starting with the ticket total. Entering a new ticket total will reverse calculate the ticket base price after applying all price modifiers in reverse. Click to turn off reverse calculations', 'event_espresso'),
1931 1931
 
1932 1932
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:17
1933
-	__( 'Ticket total is being calculated normally from top to bottom starting from the base price. Entering a new ticket base price will recalculate the ticket total after applying all price modifiers. Click to turn on reverse calculations', 'event_espresso' ),
1933
+	__('Ticket total is being calculated normally from top to bottom starting from the base price. Entering a new ticket base price will recalculate the ticket total after applying all price modifiers. Click to turn on reverse calculations', 'event_espresso'),
1934 1934
 
1935 1935
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:21
1936
-	__( 'Disable reverse calculate', 'event_espresso' ),
1936
+	__('Disable reverse calculate', 'event_espresso'),
1937 1937
 
1938 1938
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:21
1939
-	__( 'Enable reverse calculate', 'event_espresso' ),
1939
+	__('Enable reverse calculate', 'event_espresso'),
1940 1940
 
1941 1941
 	// Reference: packages/tpc/src/buttons/TicketPriceCalculatorButton.tsx:28
1942
-	__( 'ticket price calculator', 'event_espresso' ),
1942
+	__('ticket price calculator', 'event_espresso'),
1943 1943
 
1944 1944
 	// Reference: packages/tpc/src/buttons/taxes/AddDefaultTaxesButton.tsx:9
1945
-	__( 'Add default taxes', 'event_espresso' ),
1945
+	__('Add default taxes', 'event_espresso'),
1946 1946
 
1947 1947
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:10
1948
-	__( 'Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso' ),
1948
+	__('Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso'),
1949 1949
 
1950 1950
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:14
1951
-	__( 'Remove all taxes?', 'event_espresso' ),
1951
+	__('Remove all taxes?', 'event_espresso'),
1952 1952
 
1953 1953
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:7
1954
-	__( 'Remove taxes', 'event_espresso' ),
1954
+	__('Remove taxes', 'event_espresso'),
1955 1955
 
1956 1956
 	// Reference: packages/tpc/src/components/AddDefaultPricesButton.tsx:9
1957
-	__( 'Add default prices', 'event_espresso' ),
1957
+	__('Add default prices', 'event_espresso'),
1958 1958
 
1959 1959
 	// Reference: packages/tpc/src/components/DefaultPricesInfo.tsx:29
1960
-	__( 'Modify default prices.', 'event_espresso' ),
1960
+	__('Modify default prices.', 'event_espresso'),
1961 1961
 
1962 1962
 	// Reference: packages/tpc/src/components/DefaultTaxesInfo.tsx:29
1963
-	__( 'New default taxes are available. Click the - Add default taxes - button to add them now.', 'event_espresso' ),
1963
+	__('New default taxes are available. Click the - Add default taxes - button to add them now.', 'event_espresso'),
1964 1964
 
1965 1965
 	// Reference: packages/tpc/src/components/LockedTicketsBanner.tsx:12
1966 1966
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:74
1967
-	__( 'Price editing is disabled!', 'event_espresso' ),
1967
+	__('Price editing is disabled!', 'event_espresso'),
1968 1968
 
1969 1969
 	// Reference: packages/tpc/src/components/NoPriceTypesBanner.tsx:12
1970
-	__( 'One or more price types are missing. Maybe they were placed in the trash?', 'event_espresso' ),
1970
+	__('One or more price types are missing. Maybe they were placed in the trash?', 'event_espresso'),
1971 1971
 
1972 1972
 	// Reference: packages/tpc/src/components/NoPriceTypesBanner.tsx:17
1973 1973
 	/* translators: %s link to price types admin */
1974
-	__( 'Go to the%sto restore (untrash) your price types and/or create some new ones.', 'event_espresso' ),
1974
+	__('Go to the%sto restore (untrash) your price types and/or create some new ones.', 'event_espresso'),
1975 1975
 
1976 1976
 	// Reference: packages/tpc/src/components/NoPriceTypesBanner.tsx:18
1977
-	__( 'price types admin page', 'event_espresso' ),
1977
+	__('price types admin page', 'event_espresso'),
1978 1978
 
1979 1979
 	// Reference: packages/tpc/src/components/NoPriceTypesBanner.tsx:26
1980
-	__( 'Missing Price Types!', 'event_espresso' ),
1980
+	__('Missing Price Types!', 'event_espresso'),
1981 1981
 
1982 1982
 	// Reference: packages/tpc/src/components/NoPricesBanner.tsx:14
1983
-	__( 'This Ticket is Currently Free', 'event_espresso' ),
1983
+	__('This Ticket is Currently Free', 'event_espresso'),
1984 1984
 
1985 1985
 	// Reference: packages/tpc/src/components/NoPricesBanner.tsx:21
1986 1986
 	/* translators: %s default prices */
1987
-	__( 'Click the button below to load your %s into the calculator.', 'event_espresso' ),
1987
+	__('Click the button below to load your %s into the calculator.', 'event_espresso'),
1988 1988
 
1989 1989
 	// Reference: packages/tpc/src/components/NoPricesBanner.tsx:22
1990
-	__( 'default prices', 'event_espresso' ),
1990
+	__('default prices', 'event_espresso'),
1991 1991
 
1992 1992
 	// Reference: packages/tpc/src/components/NoPricesBanner.tsx:29
1993
-	__( 'Additional ticket price modifiers can be added or removed.', 'event_espresso' ),
1993
+	__('Additional ticket price modifiers can be added or removed.', 'event_espresso'),
1994 1994
 
1995 1995
 	// Reference: packages/tpc/src/components/NoPricesBanner.tsx:31
1996
-	__( 'Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso' ),
1996
+	__('Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso'),
1997 1997
 
1998 1998
 	// Reference: packages/tpc/src/components/TicketPriceCalculatorModal.tsx:22
1999 1999
 	// Reference: packages/ui-components/src/Confirm/ConfirmClose.tsx:7
2000 2000
 	// Reference: packages/ui-components/src/Confirm/useConfirmWithButton.tsx:10
2001 2001
 	// Reference: packages/ui-components/src/Confirm/useConfirmationDialog.tsx:52
2002
-	__( 'Changes will be lost if you proceed.', 'event_espresso' ),
2002
+	__('Changes will be lost if you proceed.', 'event_espresso'),
2003 2003
 
2004 2004
 	// Reference: packages/tpc/src/components/TicketPriceCalculatorModal.tsx:33
2005 2005
 	/* translators: %s ticket name */
2006
-	__( 'Price Calculator for Ticket: %s', 'event_espresso' ),
2006
+	__('Price Calculator for Ticket: %s', 'event_espresso'),
2007 2007
 
2008 2008
 	// Reference: packages/tpc/src/components/price/input/Description.tsx:15
2009
-	__( 'price description', 'event_espresso' ),
2009
+	__('price description', 'event_espresso'),
2010 2010
 
2011 2011
 	// Reference: packages/tpc/src/components/price/input/Description.tsx:18
2012
-	__( 'description…', 'event_espresso' ),
2012
+	__('description…', 'event_espresso'),
2013 2013
 
2014 2014
 	// Reference: packages/tpc/src/components/price/input/ID.tsx:7
2015
-	__( 'price id', 'event_espresso' ),
2015
+	__('price id', 'event_espresso'),
2016 2016
 
2017 2017
 	// Reference: packages/tpc/src/components/price/input/Name.tsx:15
2018
-	__( 'price name', 'event_espresso' ),
2018
+	__('price name', 'event_espresso'),
2019 2019
 
2020 2020
 	// Reference: packages/tpc/src/components/price/input/Name.tsx:18
2021
-	__( 'label…', 'event_espresso' ),
2021
+	__('label…', 'event_espresso'),
2022 2022
 
2023 2023
 	// Reference: packages/tpc/src/components/price/input/Order.tsx:21
2024
-	__( 'price order', 'event_espresso' ),
2024
+	__('price order', 'event_espresso'),
2025 2025
 
2026 2026
 	// Reference: packages/tpc/src/components/price/input/amount/Amount.tsx:85
2027
-	__( 'amount', 'event_espresso' ),
2027
+	__('amount', 'event_espresso'),
2028 2028
 
2029 2029
 	// Reference: packages/tpc/src/components/price/input/amount/Amount.tsx:89
2030
-	__( 'amount…', 'event_espresso' ),
2030
+	__('amount…', 'event_espresso'),
2031 2031
 
2032 2032
 	// Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:50
2033
-	__( 'Total', 'event_espresso' ),
2033
+	__('Total', 'event_espresso'),
2034 2034
 
2035 2035
 	// Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:59
2036
-	__( 'ticket total', 'event_espresso' ),
2036
+	__('ticket total', 'event_espresso'),
2037 2037
 
2038 2038
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:29
2039
-	__( 'Order', 'event_espresso' ),
2039
+	__('Order', 'event_espresso'),
2040 2040
 
2041 2041
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:35
2042
-	__( 'Price Type', 'event_espresso' ),
2042
+	__('Price Type', 'event_espresso'),
2043 2043
 
2044 2044
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:41
2045
-	__( 'Label', 'event_espresso' ),
2045
+	__('Label', 'event_espresso'),
2046 2046
 
2047 2047
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:53
2048
-	__( 'Amount', 'event_espresso' ),
2048
+	__('Amount', 'event_espresso'),
2049 2049
 
2050 2050
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:22
2051
-	__( 'Copy ticket', 'event_espresso' ),
2051
+	__('Copy ticket', 'event_espresso'),
2052 2052
 
2053 2053
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:26
2054
-	__( 'Copy and archive this ticket', 'event_espresso' ),
2054
+	__('Copy and archive this ticket', 'event_espresso'),
2055 2055
 
2056 2056
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:29
2057
-	__( 'OK', 'event_espresso' ),
2057
+	__('OK', 'event_espresso'),
2058 2058
 
2059 2059
 	// Reference: packages/tpc/src/utils/constants.ts:8
2060
-	__( 'Ticket price modifications are blocked for Tickets that have already been sold to registrants, because doing so would negatively affect internal accounting for the event. If you still need to modify ticket prices, then create a copy of those tickets, edit the prices for the new tickets, and then trash the old tickets.', 'event_espresso' ),
2060
+	__('Ticket price modifications are blocked for Tickets that have already been sold to registrants, because doing so would negatively affect internal accounting for the event. If you still need to modify ticket prices, then create a copy of those tickets, edit the prices for the new tickets, and then trash the old tickets.', 'event_espresso'),
2061 2061
 
2062 2062
 	// Reference: packages/ui-components/src/ActiveFilters/ActiveFilters.tsx:8
2063
-	__( 'active filters:', 'event_espresso' ),
2063
+	__('active filters:', 'event_espresso'),
2064 2064
 
2065 2065
 	// Reference: packages/ui-components/src/ActiveFilters/FilterTag/index.tsx:15
2066 2066
 	/* translators: %s filter name */
2067
-	__( 'remove filter - %s', 'event_espresso' ),
2067
+	__('remove filter - %s', 'event_espresso'),
2068 2068
 
2069 2069
 	// Reference: packages/ui-components/src/Address/Address.tsx:105
2070
-	__( 'Country:', 'event_espresso' ),
2070
+	__('Country:', 'event_espresso'),
2071 2071
 
2072 2072
 	// Reference: packages/ui-components/src/Address/Address.tsx:113
2073
-	__( 'Zip:', 'event_espresso' ),
2073
+	__('Zip:', 'event_espresso'),
2074 2074
 
2075 2075
 	// Reference: packages/ui-components/src/Address/Address.tsx:81
2076
-	__( 'Address:', 'event_espresso' ),
2076
+	__('Address:', 'event_espresso'),
2077 2077
 
2078 2078
 	// Reference: packages/ui-components/src/Address/Address.tsx:89
2079
-	__( 'City:', 'event_espresso' ),
2079
+	__('City:', 'event_espresso'),
2080 2080
 
2081 2081
 	// Reference: packages/ui-components/src/Address/Address.tsx:97
2082
-	__( 'State:', 'event_espresso' ),
2082
+	__('State:', 'event_espresso'),
2083 2083
 
2084 2084
 	// Reference: packages/ui-components/src/CalendarDateRange/CalendarDateRange.tsx:37
2085
-	__( 'to', 'event_espresso' ),
2085
+	__('to', 'event_espresso'),
2086 2086
 
2087 2087
 	// Reference: packages/ui-components/src/CalendarPageDate/CalendarPageDate.tsx:54
2088
-	__( 'TO', 'event_espresso' ),
2088
+	__('TO', 'event_espresso'),
2089 2089
 
2090 2090
 	// Reference: packages/ui-components/src/ColorPicker/ColorPicker.tsx:60
2091
-	__( 'Custom color', 'event_espresso' ),
2091
+	__('Custom color', 'event_espresso'),
2092 2092
 
2093 2093
 	// Reference: packages/ui-components/src/ColorPicker/Swatch.tsx:23
2094 2094
 	/* translators: color name */
2095
-	__( 'Color: %s', 'event_espresso' ),
2095
+	__('Color: %s', 'event_espresso'),
2096 2096
 
2097 2097
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:13
2098
-	__( 'Cyan bluish gray', 'event_espresso' ),
2098
+	__('Cyan bluish gray', 'event_espresso'),
2099 2099
 
2100 2100
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:17
2101
-	__( 'White', 'event_espresso' ),
2101
+	__('White', 'event_espresso'),
2102 2102
 
2103 2103
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:21
2104
-	__( 'Pale pink', 'event_espresso' ),
2104
+	__('Pale pink', 'event_espresso'),
2105 2105
 
2106 2106
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:25
2107
-	__( 'Vivid red', 'event_espresso' ),
2107
+	__('Vivid red', 'event_espresso'),
2108 2108
 
2109 2109
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:29
2110
-	__( 'Luminous vivid orange', 'event_espresso' ),
2110
+	__('Luminous vivid orange', 'event_espresso'),
2111 2111
 
2112 2112
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:33
2113
-	__( 'Luminous vivid amber', 'event_espresso' ),
2113
+	__('Luminous vivid amber', 'event_espresso'),
2114 2114
 
2115 2115
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:37
2116
-	__( 'Light green cyan', 'event_espresso' ),
2116
+	__('Light green cyan', 'event_espresso'),
2117 2117
 
2118 2118
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:41
2119
-	__( 'Vivid green cyan', 'event_espresso' ),
2119
+	__('Vivid green cyan', 'event_espresso'),
2120 2120
 
2121 2121
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:45
2122
-	__( 'Pale cyan blue', 'event_espresso' ),
2122
+	__('Pale cyan blue', 'event_espresso'),
2123 2123
 
2124 2124
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:49
2125
-	__( 'Vivid cyan blue', 'event_espresso' ),
2125
+	__('Vivid cyan blue', 'event_espresso'),
2126 2126
 
2127 2127
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:53
2128
-	__( 'Vivid purple', 'event_espresso' ),
2128
+	__('Vivid purple', 'event_espresso'),
2129 2129
 
2130 2130
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:9
2131
-	__( 'Black', 'event_espresso' ),
2131
+	__('Black', 'event_espresso'),
2132 2132
 
2133 2133
 	// Reference: packages/ui-components/src/Confirm/ConfirmClose.tsx:8
2134 2134
 	// Reference: packages/ui-components/src/Modal/ModalWithAlert.tsx:24
2135
-	__( 'Are you sure you want to close this?', 'event_espresso' ),
2135
+	__('Are you sure you want to close this?', 'event_espresso'),
2136 2136
 
2137 2137
 	// Reference: packages/ui-components/src/Confirm/ConfirmClose.tsx:9
2138 2138
 	// Reference: packages/ui-components/src/Modal/ModalWithAlert.tsx:25
2139
-	__( 'Yes, discard changes', 'event_espresso' ),
2139
+	__('Yes, discard changes', 'event_espresso'),
2140 2140
 
2141 2141
 	// Reference: packages/ui-components/src/Confirm/ConfirmDelete.tsx:7
2142
-	__( 'Are you sure you want to delete this?', 'event_espresso' ),
2142
+	__('Are you sure you want to delete this?', 'event_espresso'),
2143 2143
 
2144 2144
 	// Reference: packages/ui-components/src/Confirm/useConfirmWithButton.tsx:11
2145
-	__( 'Please confirm this action.', 'event_espresso' ),
2145
+	__('Please confirm this action.', 'event_espresso'),
2146 2146
 
2147 2147
 	// Reference: packages/ui-components/src/Confirm/useConfirmationDialog.tsx:39
2148
-	__( 'cancel', 'event_espresso' ),
2148
+	__('cancel', 'event_espresso'),
2149 2149
 
2150 2150
 	// Reference: packages/ui-components/src/Confirm/useConfirmationDialog.tsx:40
2151
-	__( 'confirm', 'event_espresso' ),
2151
+	__('confirm', 'event_espresso'),
2152 2152
 
2153 2153
 	// Reference: packages/ui-components/src/CurrencyDisplay/CurrencyDisplay.tsx:34
2154
-	__( 'free', 'event_espresso' ),
2154
+	__('free', 'event_espresso'),
2155 2155
 
2156 2156
 	// Reference: packages/ui-components/src/DateTimeRangePicker/DateTimeRangePicker.tsx:117
2157 2157
 	// Reference: packages/ui-components/src/Popover/PopoverForm/PopoverForm.tsx:44
2158
-	__( 'save', 'event_espresso' ),
2158
+	__('save', 'event_espresso'),
2159 2159
 
2160 2160
 	// Reference: packages/ui-components/src/DebugInfo/DebugInfo.tsx:36
2161
-	__( 'Hide Debug Info', 'event_espresso' ),
2161
+	__('Hide Debug Info', 'event_espresso'),
2162 2162
 
2163 2163
 	// Reference: packages/ui-components/src/DebugInfo/DebugInfo.tsx:36
2164
-	__( 'Show Debug Info', 'event_espresso' ),
2164
+	__('Show Debug Info', 'event_espresso'),
2165 2165
 
2166 2166
 	// Reference: packages/ui-components/src/EditDateRangeButton/EditDateRangeButton.tsx:49
2167
-	__( 'Edit Start and End Dates and Times', 'event_espresso' ),
2167
+	__('Edit Start and End Dates and Times', 'event_espresso'),
2168 2168
 
2169 2169
 	// Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/CopyEntity.tsx:8
2170
-	__( 'copy', 'event_espresso' ),
2170
+	__('copy', 'event_espresso'),
2171 2171
 
2172 2172
 	// Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/EditEntity.tsx:8
2173
-	__( 'edit', 'event_espresso' ),
2173
+	__('edit', 'event_espresso'),
2174 2174
 
2175 2175
 	// Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/TrashEntity.tsx:8
2176
-	__( 'trash', 'event_espresso' ),
2176
+	__('trash', 'event_espresso'),
2177 2177
 
2178 2178
 	// Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/Untrash.tsx:8
2179
-	__( 'untrash', 'event_espresso' ),
2179
+	__('untrash', 'event_espresso'),
2180 2180
 
2181 2181
 	// Reference: packages/ui-components/src/EntityList/EntityList.tsx:23
2182
-	__( 'OOPS!', 'event_espresso' ),
2182
+	__('OOPS!', 'event_espresso'),
2183 2183
 
2184 2184
 	// Reference: packages/ui-components/src/EntityList/EntityList.tsx:23
2185
-	__( 'Error Loading Entites List', 'event_espresso' ),
2185
+	__('Error Loading Entites List', 'event_espresso'),
2186 2186
 
2187 2187
 	// Reference: packages/ui-components/src/EntityList/RegistrationsLink/index.tsx:12
2188
-	__( 'click to open the registrations admin page in a new tab or window', 'event_espresso' ),
2188
+	__('click to open the registrations admin page in a new tab or window', 'event_espresso'),
2189 2189
 
2190 2190
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/CardViewFilterButton.tsx:22
2191
-	__( 'card view', 'event_espresso' ),
2191
+	__('card view', 'event_espresso'),
2192 2192
 
2193 2193
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/TableViewFilterButton.tsx:21
2194
-	__( 'table view', 'event_espresso' ),
2194
+	__('table view', 'event_espresso'),
2195 2195
 
2196 2196
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleBulkActionsButton.tsx:8
2197
-	__( 'hide bulk actions', 'event_espresso' ),
2197
+	__('hide bulk actions', 'event_espresso'),
2198 2198
 
2199 2199
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleBulkActionsButton.tsx:8
2200
-	__( 'show bulk actions', 'event_espresso' ),
2200
+	__('show bulk actions', 'event_espresso'),
2201 2201
 
2202 2202
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleFiltersButton.tsx:23
2203
-	__( 'filters', 'event_espresso' ),
2203
+	__('filters', 'event_espresso'),
2204 2204
 
2205 2205
 	// Reference: packages/ui-components/src/Legend/ToggleLegendButton.tsx:38
2206
-	__( 'legend', 'event_espresso' ),
2206
+	__('legend', 'event_espresso'),
2207 2207
 
2208 2208
 	// Reference: packages/ui-components/src/LoadingNotice/LoadingNotice.tsx:11
2209
-	__( 'loading…', 'event_espresso' ),
2209
+	__('loading…', 'event_espresso'),
2210 2210
 
2211 2211
 	// Reference: packages/ui-components/src/Modal/Modal.tsx:59
2212
-	__( 'close modal', 'event_espresso' ),
2212
+	__('close modal', 'event_espresso'),
2213 2213
 
2214 2214
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:10
2215
-	__( 'jump to previous', 'event_espresso' ),
2215
+	__('jump to previous', 'event_espresso'),
2216 2216
 
2217 2217
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:11
2218
-	__( 'jump to next', 'event_espresso' ),
2218
+	__('jump to next', 'event_espresso'),
2219 2219
 
2220 2220
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:12
2221
-	__( 'page', 'event_espresso' ),
2221
+	__('page', 'event_espresso'),
2222 2222
 
2223 2223
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:8
2224
-	__( 'previous', 'event_espresso' ),
2224
+	__('previous', 'event_espresso'),
2225 2225
 
2226 2226
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:9
2227
-	__( 'next', 'event_espresso' ),
2227
+	__('next', 'event_espresso'),
2228 2228
 
2229 2229
 	// Reference: packages/ui-components/src/Pagination/PerPage.tsx:45
2230 2230
 	/* translators: %1$d is first item #, %2$d is last item #, %3$d is total items, ex: 20-30 of 100 items */
2231
-	__( '%1$d-%2$d of %3$d items', 'event_espresso' ),
2231
+	__('%1$d-%2$d of %3$d items', 'event_espresso'),
2232 2232
 
2233 2233
 	// Reference: packages/ui-components/src/Pagination/PerPage.tsx:54
2234
-	__( 'items per page', 'event_espresso' ),
2234
+	__('items per page', 'event_espresso'),
2235 2235
 
2236 2236
 	// Reference: packages/ui-components/src/Pagination/constants.ts:11
2237 2237
 	/* translators: %s is per page value */
2238
-	__( '%s / page', 'event_espresso' ),
2238
+	__('%s / page', 'event_espresso'),
2239 2239
 
2240 2240
 	// Reference: packages/ui-components/src/Pagination/constants.ts:12
2241
-	__( 'show all', 'event_espresso' ),
2241
+	__('show all', 'event_espresso'),
2242 2242
 
2243 2243
 	// Reference: packages/ui-components/src/Pagination/constants.ts:15
2244
-	__( 'Next Page', 'event_espresso' ),
2244
+	__('Next Page', 'event_espresso'),
2245 2245
 
2246 2246
 	// Reference: packages/ui-components/src/Pagination/constants.ts:16
2247
-	__( 'Previous Page', 'event_espresso' ),
2247
+	__('Previous Page', 'event_espresso'),
2248 2248
 
2249 2249
 	// Reference: packages/ui-components/src/PercentSign/index.tsx:10
2250
-	__( '%', 'event_espresso' ),
2250
+	__('%', 'event_espresso'),
2251 2251
 
2252 2252
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:31
2253 2253
 	/* translators: entity type to select */
2254
-	__( 'Select an existing %s to use as a template.', 'event_espresso' ),
2254
+	__('Select an existing %s to use as a template.', 'event_espresso'),
2255 2255
 
2256 2256
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:38
2257
-	__( 'or', 'event_espresso' ),
2257
+	__('or', 'event_espresso'),
2258 2258
 
2259 2259
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:43
2260 2260
 	/* translators: entity type to add */
2261
-	__( 'Add a new %s and insert details manually', 'event_espresso' ),
2261
+	__('Add a new %s and insert details manually', 'event_espresso'),
2262 2262
 
2263 2263
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:48
2264
-	__( 'Add New', 'event_espresso' ),
2264
+	__('Add New', 'event_espresso'),
2265 2265
 
2266 2266
 	// Reference: packages/ui-components/src/Stepper/buttons/Next.tsx:8
2267
-	__( 'Next', 'event_espresso' ),
2267
+	__('Next', 'event_espresso'),
2268 2268
 
2269 2269
 	// Reference: packages/ui-components/src/Stepper/buttons/Previous.tsx:8
2270
-	__( 'Previous', 'event_espresso' ),
2270
+	__('Previous', 'event_espresso'),
2271 2271
 
2272 2272
 	// Reference: packages/ui-components/src/Steps/Steps.tsx:31
2273
-	__( 'Steps', 'event_espresso' ),
2273
+	__('Steps', 'event_espresso'),
2274 2274
 
2275 2275
 	// Reference: packages/ui-components/src/TabbableText/index.tsx:21
2276
-	__( 'click to edit…', 'event_espresso' ),
2276
+	__('click to edit…', 'event_espresso'),
2277 2277
 
2278 2278
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:14
2279
-	__( 'The Website\'s Time Zone', 'event_espresso' ),
2279
+	__('The Website\'s Time Zone', 'event_espresso'),
2280 2280
 
2281 2281
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:19
2282
-	__( 'UTC (Greenwich Mean Time)', 'event_espresso' ),
2282
+	__('UTC (Greenwich Mean Time)', 'event_espresso'),
2283 2283
 
2284 2284
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:9
2285
-	__( 'Your Local Time Zone', 'event_espresso' ),
2285
+	__('Your Local Time Zone', 'event_espresso'),
2286 2286
 
2287 2287
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:25
2288
-	__( 'click for timezone information', 'event_espresso' ),
2288
+	__('click for timezone information', 'event_espresso'),
2289 2289
 
2290 2290
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:30
2291
-	__( 'This Date Converted To:', 'event_espresso' ),
2291
+	__('This Date Converted To:', 'event_espresso'),
2292 2292
 
2293 2293
 	// Reference: packages/ui-components/src/VenueSelector/VenueSelector.tsx:120
2294
-	__( 'Add New Venue', 'event_espresso' ),
2294
+	__('Add New Venue', 'event_espresso'),
2295 2295
 
2296 2296
 	// Reference: packages/ui-components/src/VenueSelector/VenueSelector.tsx:36
2297
-	__( '~ no venue ~', 'event_espresso' ),
2297
+	__('~ no venue ~', 'event_espresso'),
2298 2298
 
2299 2299
 	// Reference: packages/ui-components/src/VenueSelector/VenueSelector.tsx:43
2300
-	__( 'assign venue…', 'event_espresso' ),
2300
+	__('assign venue…', 'event_espresso'),
2301 2301
 
2302 2302
 	// Reference: packages/ui-components/src/VenueSelector/VenueSelector.tsx:44
2303
-	__( 'click to select a venue…', 'event_espresso' ),
2303
+	__('click to select a venue…', 'event_espresso'),
2304 2304
 
2305 2305
 	// Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:51
2306
-	__( 'select all', 'event_espresso' ),
2306
+	__('select all', 'event_espresso'),
2307 2307
 
2308 2308
 	// Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:54
2309
-	__( 'apply', 'event_espresso' )
2309
+	__('apply', 'event_espresso')
2310 2310
 );
2311 2311
 /* THIS IS THE END OF THE GENERATED FILE */
Please login to merge, or discard this patch.