| @@ -62,8 +62,9 @@ | ||
| 62 | 62 | public $is_sandbox; |
| 63 | 63 | private $current_gateway_type; |
| 64 | 64 | |
| 65 | 65 | private $rest; |
| 66 | + private $secure_price_notice; | |
| 66 | 67 | |
| 67 | 68 | public static function get_instance_id(): string { |
| 68 | 69 | return 'gateways'; |
| 69 | 70 | } |
| @@ -108,8 +109,10 @@ | ||
| 108 | 109 | 'jet-form-builder/default-process-event/executors', |
| 109 | 110 | array( $this, 'add_executor_to_default_process' ) |
| 110 | 111 | ); |
| 111 | 112 | add_filter( 'jet-form-builder/editor/config', array( $this, 'on_localize_editor_config' ) ); |
| 113 | + | |
| 114 | + $this->secure_price_notice->init_hooks(); | |
| 112 | 115 | } |
| 113 | 116 | |
| 114 | 117 | public function remove_hooks() { |
| 115 | 118 | remove_action( 'rest_api_init', array( $this->get_rest(), 'register_routes' ) ); |
| @@ -132,8 +135,10 @@ | ||
| 132 | 135 | 'jet-form-builder/default-process-event/executors', |
| 133 | 136 | array( $this, 'add_executor_to_default_process' ) |
| 134 | 137 | ); |
| 135 | 138 | remove_filter( 'jet-form-builder/editor/config', array( $this, 'on_localize_editor_config' ) ); |
| 139 | + | |
| 140 | + $this->secure_price_notice->remove_hooks(); | |
| 136 | 141 | } |
| 137 | 142 | |
| 138 | 143 | public function on_install() { |
| 139 | 144 | // backward compatibility |
| @@ -152,9 +157,10 @@ | ||
| 152 | 157 | $this->is_sandbox = $options['enable_test_mode']; |
| 153 | 158 | } |
| 154 | 159 | |
| 155 | 160 | // rest api |
| 156 | - $this->rest = new Rest_Api_Controller(); | |
| 161 | + $this->rest = new Rest_Api_Controller(); | |
| 162 | + $this->secure_price_notice = new Secure_Price_Notice(); | |
| 157 | 163 | |
| 158 | 164 | // catch webhook by get param |
| 159 | 165 | $this->catch_payment_result(); |
| 160 | 166 | } |
| @@ -163,8 +169,9 @@ | ||
| 163 | 169 | // install tab handlers for Settings page |
| 164 | 170 | Tab_Handler_Manager::instance()->uninstall( new Tab_Handlers\Payments_Gateways_Handler() ); |
| 165 | 171 | |
| 166 | 172 | unset( $this->is_sandbox, $this->rest ); |
| 173 | + $this->secure_price_notice = null; | |
| 167 | 174 | } |
| 168 | 175 | |
| 169 | 176 | public function rep_instances(): array { |
| 170 | 177 | return array( |