PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.0.8
JetFormBuilder — Dynamic Blocks Form Builder v3.0.8
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / includes / gateways / base-scenario-gateway.php
jetformbuilder / includes / gateways Last commit date
db-models 3 years ago meta-boxes 3 years ago pages 3 years ago paypal 3 years ago query-views 3 years ago rest-api 3 years ago scenarios-abstract 3 years ago table-views 3 years ago base-gateway-action.php 3 years ago base-gateway.php 3 years ago base-scenario-gateway.php 3 years ago gateway-manager.php 3 years ago gateways-editor-data.php 3 years ago legacy-base-gateway.php 3 years ago migrate-legacy-data.php 3 years ago scenario-item.php 3 years ago
base-scenario-gateway.php
112 lines
1 <?php
2
3
4 namespace Jet_Form_Builder\Gateways;
5
6 use Jet_Form_Builder\Actions\Action_Handler;
7 use Jet_Form_Builder\Db_Queries\Exceptions\Skip_Exception;
8 use Jet_Form_Builder\Exceptions\Gateway_Exception;
9 use Jet_Form_Builder\Exceptions\Repository_Exception;
10 use Jet_Form_Builder\Gateways\Gateway_Manager as GM;
11 use Jet_Form_Builder\Gateways\Paypal\Scenarios_Manager;
12 use Jet_Form_Builder\Gateways\Scenarios_Abstract\Scenario_Logic_Base;
13
14 abstract class Base_Scenario_Gateway extends Base_Gateway {
15
16 /**
17 * @return Scenario_Logic_Base
18 * @throws Repository_Exception
19 */
20 public function get_scenario() {
21 return Scenarios_Manager::instance()->get_logic( $this );
22 }
23
24 /**
25 * @return Scenario_Logic_Base
26 * @throws Gateway_Exception
27 */
28 public function query_scenario() {
29 return Scenarios_Manager::instance()->query_logic();
30 }
31
32 /**
33 * Prevent unnecessary notifications processing before form is send.
34 *
35 * @return void
36 * @throws Repository_Exception
37 */
38 public function before_actions() {
39 $this->set_form_meta( GM::instance()->gateways() );
40 $this->get_scenario()->before_actions();
41 }
42
43 /**
44 * @param Action_Handler $handler
45 *
46 * @throws Repository_Exception
47 */
48 public function after_actions( Action_Handler $handler ) {
49 jet_fb_gateway_current()->get_scenario()->after_actions();
50 }
51
52 public function try_run_on_catch() {
53 try {
54 $scenario = $this->query_scenario();
55 } catch ( Gateway_Exception $exception ) {
56 return;
57 }
58
59 try {
60 /** set to $this->payment_token */
61 $this->set_payment_token();
62
63 } catch ( Skip_Exception $exception ) {
64 return;
65 }
66
67 /**
68 * Init actions for correct migrating
69 *
70 * Later should be deprecated
71 */
72 $scenario->init_request();
73 $scenario->init_actions();
74
75 /** set to $this->gateways_meta */
76 $this->set_form_gateways_meta();
77
78 $scenario->on_catch();
79 }
80
81 // statuses from scenario
82
83 /**
84 * @return mixed
85 * @throws Gateway_Exception
86 */
87 protected function retrieve_gateway_meta() {
88 return $this->query_scenario()->get_gateways_meta();
89 }
90
91 /**
92 * @return string|void
93 * @throws Gateway_Exception
94 */
95 public function get_payment_token() {
96 return $this->query_scenario()->get_queried_token();
97 }
98
99 /**
100 * Apply macros in string
101 *
102 * @param null $string
103 *
104 * @return string [description]
105 * @throws Gateway_Exception
106 */
107 public function apply_macros( $string = null ) {
108 return $this->query_scenario()->apply_macros( $string );
109 }
110
111 }
112