default-process-event.php
3 years ago
default-process-executor.php
3 years ago
default-with-gateway-executor.php
3 years ago
default-process-event.php
43 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Actions\Events\Default_Process; |
| 5 | |
| 6 | |
| 7 | use Jet_Form_Builder\Actions\Events\Base_Event; |
| 8 | |
| 9 | class Default_Process_Event extends Base_Event { |
| 10 | |
| 11 | public function get_id(): string { |
| 12 | return 'DEFAULT.PROCESS'; |
| 13 | } |
| 14 | |
| 15 | public function get_label(): string { |
| 16 | return __( 'When the Form was submitted', 'jet-form-builder' ); |
| 17 | } |
| 18 | |
| 19 | public function get_help(): string { |
| 20 | return __( |
| 21 | 'the moment when all actions are executed. |
| 22 | The event takes place at the same stage as the actions previously performed. |
| 23 | It is necessary for forms where payment functionality (PayPal/Stripe) |
| 24 | is enabled to let the plugin know which actions |
| 25 | to perform before redirecting to checkout;', |
| 26 | 'jet-form-builder' |
| 27 | ); |
| 28 | } |
| 29 | |
| 30 | public function executors(): array { |
| 31 | return array( |
| 32 | new Default_With_Gateway_Executor(), |
| 33 | new Default_Process_Executor(), |
| 34 | ); |
| 35 | } |
| 36 | |
| 37 | public function to_array(): array { |
| 38 | return parent::to_array() + array( |
| 39 | 'always' => true, |
| 40 | ); |
| 41 | } |
| 42 | |
| 43 | } |