@@ -34,7 +34,7 @@ public function install()
3434 {
3535 $ this ->registerHook ('orderConfirmation ' );
3636 $ this ->registerHook ('return ' );
37- if (!parent ::install () || !$ this ->registerHook ('payment ' ) || !$ this ->registerHook ('return ' ) || !$ this ->registerHook ('orderConfirmation ' ) ||
37+ if (!parent ::install () || !$ this ->registerHook ('displayPayment ' ) || !$ this ->registerHook ('displayPaymentReturn ' ) || !$ this ->registerHook ('orderConfirmation ' ) ||
3838 !Db::getInstance ()->Execute ('CREATE TABLE IF NOT EXISTS ` ' ._DB_PREFIX_ .'paystack_txncodes` (
3939 `id` int(10) NOT NULL,
4040 `cart_id` int(11) NOT NULL,
@@ -50,38 +50,12 @@ public function install()
5050 }
5151 return true ;
5252 }
53- public function uninstall ()
54- {
55- // Uninstall parent and unregister Configuration
56- // Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'paystack_txncodes`');
57- // $orderState = new OrderState((int)Configuration::get('VOGU_WAITING_PAYMENT'));
58- // $orderState->delete();
59- // Configuration::deleteByName('VOGU_WAITING_PAYMENT');
60- if (!parent ::uninstall ()) {
61- return false ;
62- }
63- return true ;
64- }
65-
66- public function getHookController ($ hook_name )
67- {
68- // Include the controller file
69- require_once (dirname (__FILE__ ).'/controllers/hook/ ' .$ hook_name .'.php ' );
70-
71- // Build the controller name dynamically
72- $ controller_name = $ this ->name .$ hook_name .'Controller ' ;
73-
74- // Instantiate controller
75- $ controller = new $ controller_name ($ this , __FILE__ , $ this ->_path );
7653
77- // Return the controller
78- return $ controller ;
79- }
8054 public function installOrderState ()
8155 {
8256 if (Configuration::get ('PS_OS_PRESTAPAYSTACK_PAYMENT ' ) < 1 ) {
8357 $ order_state = new OrderState ();
84- $ order_state ->send_email = false ;
58+ $ order_state ->send_email = true ;
8559 $ order_state ->module_name = $ this ->name ;
8660 $ order_state ->invoice = false ;
8761 $ order_state ->color = '#98c3ff ' ;
@@ -121,11 +95,35 @@ public function installOrderState()
12195 }
12296 return true ;
12397 }
124- public function getContent ()
98+
99+ public function uninstall ()
125100 {
126- $ controller = $ this ->getHookController ('getContent ' );
127- return $ controller ->run ();
101+ // Uninstall parent and unregister Configuration
102+ // Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'paystack_txncodes`');
103+ // $orderState = new OrderState((int)Configuration::get('VOGU_WAITING_PAYMENT'));
104+ // $orderState->delete();
105+ // Configuration::deleteByName('VOGU_WAITING_PAYMENT');
106+ if (!parent ::uninstall ()) {
107+ return false ;
108+ }
109+ return true ;
110+ }
111+
112+ public function getHookController ($ hook_name )
113+ {
114+ // Include the controller file
115+ require_once (dirname (__FILE__ ).'/controllers/hook/ ' .$ hook_name .'.php ' );
116+
117+ // Build the controller name dynamically
118+ $ controller_name = $ this ->name .$ hook_name .'Controller ' ;
119+
120+ // Instantiate controller
121+ $ controller = new $ controller_name ($ this , __FILE__ , $ this ->_path );
122+
123+ // Return the controller
124+ return $ controller ;
128125 }
126+
129127 public function hookReturn ($ params )
130128 {
131129 $ this ->smarty ->assign (array ('vogURedirection ' => Tools::getShopDomainSsl (true , true ).__PS_BASE_URI__ .'modules/ ' .$ this ->name .'/ ' ));
@@ -197,4 +195,9 @@ public function hookDisplayPaymentReturn($params)
197195 $ controller = $ this ->getHookController ('displayPaymentReturn ' );
198196 return $ controller ->run ($ params );
199197 }
198+ public function getContent ()
199+ {
200+ $ controller = $ this ->getHookController ('getContent ' );
201+ return $ controller ->run ();
202+ }
200203}
0 commit comments