@@ -6,41 +6,41 @@ |
||
6 | 6 | use Svea\WebPay\Config\ConfigurationService; |
7 | 7 | use Svea\WebPay\Checkout\Model\PresetValue; |
8 | 8 | |
9 | -if(!class_exists('EDU_SveaWebPay')): |
|
9 | +if ( ! class_exists( 'EDU_SveaWebPay' ) ): |
|
10 | 10 | |
11 | 11 | class EDU_SveaWebPay extends EDU_Integration { |
12 | 12 | public function __construct() { |
13 | 13 | $this->id = 'eduadmin-sveawebpay'; |
14 | - $this->displayName = __('Svea Webpay', 'eduadmin-sveawebpay'); |
|
14 | + $this->displayName = __( 'Svea Webpay', 'eduadmin-sveawebpay' ); |
|
15 | 15 | $this->description = ''; |
16 | 16 | |
17 | 17 | $this->init_form_fields(); |
18 | 18 | $this->init_settings(); |
19 | 19 | |
20 | - add_action( 'eduadmin-processbooking', array( $this, 'process_booking' ) ); |
|
20 | + add_action( 'eduadmin-processbooking', array ( $this, 'process_booking' ) ); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | public function init_form_fields() { |
24 | - $this->setting_fields = array( |
|
25 | - 'enabled' => array( |
|
24 | + $this->setting_fields = array ( |
|
25 | + 'enabled' => array ( |
|
26 | 26 | 'title' => __( 'Enabled', 'eduadmin-sveawebpay' ), |
27 | 27 | 'type' => 'checkbox', |
28 | 28 | 'description' => __( 'Enables/Disables the integration with Svea WebPay', 'eduadmin-sveawebpay' ), |
29 | 29 | 'default' => 'no', |
30 | 30 | ), |
31 | - 'testrun' => array( |
|
31 | + 'testrun' => array ( |
|
32 | 32 | 'title' => __( 'Sandbox mode', 'eduadmin-sveawebpay' ), |
33 | 33 | 'type' => 'checkbox', |
34 | 34 | 'description' => __( 'Activate sandbox mode', 'eduadmin-sveawebpay' ), |
35 | 35 | 'default' => 'no' |
36 | 36 | ), |
37 | - 'merchant_key' => array( |
|
37 | + 'merchant_key' => array ( |
|
38 | 38 | 'title' => __( 'Merchant key', 'eduadmin-sveawebpay' ), |
39 | 39 | 'type' => 'text', |
40 | 40 | 'description' => __( 'Please enter your merchant key from Svea WebPay.', 'eduadmin-sveawebpay' ), |
41 | 41 | 'placeholder' => __( 'Merchant key', 'eduadmin-sveawebpay' ), |
42 | 42 | ), |
43 | - 'merchant_secret' => array( |
|
43 | + 'merchant_secret' => array ( |
|
44 | 44 | 'title' => __( 'Merchant secret', 'eduadmin-sveawebpay' ), |
45 | 45 | 'type' => 'password', |
46 | 46 | 'description' => __( 'Please enter your merchant secret from Svea WebPay', 'eduadmin-sveawebpay' ), |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | |
9 | 9 | if(!class_exists('EDU_SveaWebPay')): |
10 | 10 | |
11 | -class EDU_SveaWebPay extends EDU_Integration { |
|
12 | - public function __construct() { |
|
11 | +class EDU_SveaWebPay extends EDU_Integration { |
|
12 | + public function __construct() { |
|
13 | 13 | $this->id = 'eduadmin-sveawebpay'; |
14 | 14 | $this->displayName = __('Svea Webpay', 'eduadmin-sveawebpay'); |
15 | 15 | $this->description = ''; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | add_action( 'eduadmin-processbooking', array( $this, 'process_booking' ) ); |
21 | 21 | } |
22 | 22 | |
23 | - public function init_form_fields() { |
|
23 | + public function init_form_fields() { |
|
24 | 24 | $this->setting_fields = array( |
25 | 25 | 'enabled' => array( |
26 | 26 | 'title' => __( 'Enabled', 'eduadmin-sveawebpay' ), |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | /** |
53 | 53 | * @param $bookingInfo EduAdminBookingInfo |
54 | 54 | */ |
55 | - public function process_booking( $bookingInfo = null ) { |
|
55 | + public function process_booking( $bookingInfo = null ) { |
|
56 | 56 | echo '<pre>' . print_r( $this, true ) . '</pre>'; |
57 | 57 | echo '<pre>' . print_r( $bookingInfo, true ) . '</pre>'; |
58 | 58 | } |
@@ -35,44 +35,44 @@ |
||
35 | 35 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
36 | 36 | */ |
37 | 37 | |
38 | - add_action('admin_init', 'checkForEduAdminPlugin'); |
|
38 | + add_action( 'admin_init', 'checkForEduAdminPlugin' ); |
|
39 | 39 | function checkForEduAdminPlugin() { |
40 | - if(is_admin() && current_user_can('activate_plugins') && !is_plugin_active('eduadmin/eduadmin.php')) |
|
40 | + if ( is_admin() && current_user_can( 'activate_plugins' ) && ! is_plugin_active( 'eduadmin/eduadmin.php' ) ) |
|
41 | 41 | { |
42 | - add_action('admin_notices', function() { |
|
43 | - ?><div class="error"><p><?php _e('This plugin requires the EduAdmin-WordPress-plugin to be installed and activated.', 'eduadmin-sveawebpay'); ?></p></div><?php |
|
42 | + add_action( 'admin_notices', function() { |
|
43 | + ?><div class="error"><p><?php _e( 'This plugin requires the EduAdmin-WordPress-plugin to be installed and activated.', 'eduadmin-sveawebpay' ); ?></p></div><?php |
|
44 | 44 | }); |
45 | - deactivate_plugins(plugin_basename( __FILE__ )); |
|
45 | + deactivate_plugins( plugin_basename( __FILE__ ) ); |
|
46 | 46 | |
47 | - if(isset($_GET['activate'])) { |
|
48 | - unset($_GET['activate']); |
|
47 | + if ( isset( $_GET['activate'] ) ) { |
|
48 | + unset( $_GET['activate'] ); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | -if(!class_exists('EDU_SveaWebPay_Loader')): |
|
53 | +if ( ! class_exists( 'EDU_SveaWebPay_Loader' ) ): |
|
54 | 54 | |
55 | 55 | final class EDU_SveaWebPay_Loader { |
56 | 56 | public function __construct() { |
57 | - add_action('plugins_loaded', array($this, 'init')); |
|
57 | + add_action( 'plugins_loaded', array ( $this, 'init' ) ); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | public function init() { |
61 | - if(class_exists('EDU_Integration')) |
|
61 | + if ( class_exists( 'EDU_Integration' ) ) |
|
62 | 62 | { |
63 | - require_once(__DIR__ . '/vendor/autoload.php'); // Load dependencies |
|
64 | - require_once(__DIR__ . '/class/class-edu-sveawebpay.php'); |
|
63 | + require_once( __DIR__ . '/vendor/autoload.php' ); // Load dependencies |
|
64 | + require_once( __DIR__ . '/class/class-edu-sveawebpay.php' ); |
|
65 | 65 | |
66 | - add_filter('edu_integrations', array($this, 'add_integration')); |
|
66 | + add_filter( 'edu_integrations', array ( $this, 'add_integration' ) ); |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | - public function add_integration($integrations) |
|
70 | + public function add_integration( $integrations ) |
|
71 | 71 | { |
72 | 72 | $integrations[] = 'EDU_SveaWebPay'; |
73 | 73 | return $integrations; |
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
77 | -$edu_sveawebpay_loader = new EDU_SveaWebPay_Loader(__FILE__); |
|
77 | +$edu_sveawebpay_loader = new EDU_SveaWebPay_Loader( __FILE__ ); |
|
78 | 78 | endif; |
79 | 79 | \ No newline at end of file |
@@ -36,15 +36,14 @@ discard block |
||
36 | 36 | */ |
37 | 37 | |
38 | 38 | add_action('admin_init', 'checkForEduAdminPlugin'); |
39 | - function checkForEduAdminPlugin() { |
|
40 | - if(is_admin() && current_user_can('activate_plugins') && !is_plugin_active('eduadmin/eduadmin.php')) |
|
41 | - { |
|
42 | - add_action('admin_notices', function() { |
|
39 | + function checkForEduAdminPlugin() { |
|
40 | + if(is_admin() && current_user_can('activate_plugins') && !is_plugin_active('eduadmin/eduadmin.php')) { |
|
41 | + add_action('admin_notices', function() { |
|
43 | 42 | ?><div class="error"><p><?php _e('This plugin requires the EduAdmin-WordPress-plugin to be installed and activated.', 'eduadmin-sveawebpay'); ?></p></div><?php |
44 | 43 | }); |
45 | 44 | deactivate_plugins(plugin_basename( __FILE__ )); |
46 | 45 | |
47 | - if(isset($_GET['activate'])) { |
|
46 | + if(isset($_GET['activate'])) { |
|
48 | 47 | unset($_GET['activate']); |
49 | 48 | } |
50 | 49 | } |
@@ -52,14 +51,13 @@ discard block |
||
52 | 51 | |
53 | 52 | if(!class_exists('EDU_SveaWebPay_Loader')): |
54 | 53 | |
55 | -final class EDU_SveaWebPay_Loader { |
|
56 | - public function __construct() { |
|
54 | +final class EDU_SveaWebPay_Loader { |
|
55 | + public function __construct() { |
|
57 | 56 | add_action('plugins_loaded', array($this, 'init')); |
58 | 57 | } |
59 | 58 | |
60 | - public function init() { |
|
61 | - if(class_exists('EDU_Integration')) |
|
62 | - { |
|
59 | + public function init() { |
|
60 | + if(class_exists('EDU_Integration')) { |
|
63 | 61 | require_once(__DIR__ . '/vendor/autoload.php'); // Load dependencies |
64 | 62 | require_once(__DIR__ . '/class/class-edu-sveawebpay.php'); |
65 | 63 | |
@@ -67,8 +65,7 @@ discard block |
||
67 | 65 | } |
68 | 66 | } |
69 | 67 | |
70 | - public function add_integration($integrations) |
|
71 | - { |
|
68 | + public function add_integration($integrations) { |
|
72 | 69 | $integrations[] = 'EDU_SveaWebPay'; |
73 | 70 | return $integrations; |
74 | 71 | } |