Completed
Pull Request — master (#29)
by
unknown
17s
created
eduadmin-wordpress-sveawebpay.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
 
38 38
 add_action( 'admin_init', 'checkForEduAdminPlugin' );
39 39
 function checkForEduAdminPlugin() {
40
-	if ( is_admin() && current_user_can( 'activate_plugins' ) && ( ! is_plugin_active( 'eduadmin-booking/eduadmin.php' ) && ! is_plugin_active( 'eduadmin/eduadmin.php' ) ) ) {
41
-		add_action( 'admin_notices', function () {
40
+	if ( is_admin() && current_user_can( 'activate_plugins' ) && ( !is_plugin_active( 'eduadmin-booking/eduadmin.php' ) && !is_plugin_active( 'eduadmin/eduadmin.php' ) ) ) {
41
+		add_action( 'admin_notices', function() {
42 42
 			?>
43 43
             <div class="error">
44 44
             <p><?php _e( 'This plugin requires the EduAdmin-WordPress-plugin to be installed and activated.', 'eduadmin-sveawebpay' ); ?></p>
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	}
53 53
 }
54 54
 
55
-if ( ! class_exists( 'EDU_SveaWebPay_Loader' ) ):
55
+if ( !class_exists( 'EDU_SveaWebPay_Loader' ) ):
56 56
 
57 57
 	final class EDU_SveaWebPay_Loader {
58 58
 		public function __construct() {
Please login to merge, or discard this patch.
src/eduadmin-wordpress-sveawebpay.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
 
38 38
 add_action( 'admin_init', 'checkForEduAdminPlugin' );
39 39
 function checkForEduAdminPlugin() {
40
-	if ( is_admin() && current_user_can( 'activate_plugins' ) && ( ! is_plugin_active( 'eduadmin-booking/eduadmin.php' ) && ! is_plugin_active( 'eduadmin/eduadmin.php' ) ) ) {
41
-		add_action( 'admin_notices', function () {
40
+	if ( is_admin() && current_user_can( 'activate_plugins' ) && ( !is_plugin_active( 'eduadmin-booking/eduadmin.php' ) && !is_plugin_active( 'eduadmin/eduadmin.php' ) ) ) {
41
+		add_action( 'admin_notices', function() {
42 42
 			?>
43 43
             <div class="error">
44 44
             <p><?php _e( 'This plugin requires the EduAdmin-WordPress-plugin to be installed and activated.', 'eduadmin-sveawebpay' ); ?></p>
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	}
53 53
 }
54 54
 
55
-if ( ! class_exists( 'EDU_SveaWebPay_Loader' ) ):
55
+if ( !class_exists( 'EDU_SveaWebPay_Loader' ) ):
56 56
 
57 57
 	final class EDU_SveaWebPay_Loader {
58 58
 		public function __construct() {
Please login to merge, or discard this patch.
class/class-edu-sveawebpay.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 use Svea\WebPay\WebPay;
7 7
 use Svea\WebPay\WebPayItem;
8 8
 
9
-if ( ! class_exists( 'EDU_SveaWebPay' ) ):
9
+if ( !class_exists( 'EDU_SveaWebPay' ) ):
10 10
 
11 11
 	/**
12 12
 	 * EDU_SveaWebPay integrates EduAdmin-WordPress plugin with SveaWebPay as payment gateway
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
 			$ebi = new EduAdmin_BookingInfo( $event_booking, $_customer, $_contact );
79 79
 
80
-			if ( ! empty( EDU()->session['svea-order-id'] ) && ! empty( $_GET['svea_order_id'] ) && EDU()->session['svea-order-id'] === $_GET['svea_order_id'] ) {
80
+			if ( !empty( EDU()->session['svea-order-id'] ) && !empty( $_GET['svea_order_id'] ) && EDU()->session['svea-order-id'] === $_GET['svea_order_id'] ) {
81 81
 				do_action( 'eduadmin-bookingcompleted', $ebi );
82 82
 			} else {
83 83
 				do_action( 'eduadmin-processbooking', $ebi );
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 				return;
94 94
 			}
95 95
 
96
-			if ( ! empty( $_POST['act'] ) && ( 'bookCourse' === $_POST['act'] || 'bookProgramme' === $_POST['act'] ) ) {
96
+			if ( !empty( $_POST['act'] ) && ( 'bookCourse' === $_POST['act'] || 'bookProgramme' === $_POST['act'] ) ) {
97 97
 				$ebi->NoRedirect = true;
98 98
 			}
99 99
 		}
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 			foreach ( $countries as $country ) {
190 190
 				if ( $invoiceCountry == $country['CountryName'] ) {
191 191
 					$selectedCountry = $country['CountryCode'];
192
-					if ( ! empty( $country['CultureName'] ) ) {
192
+					if ( !empty( $country['CultureName'] ) ) {
193 193
 						$selectedLocale = $country['CultureName'];
194 194
 					}
195 195
 					break;
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 
206 206
 			$eventName = '';
207 207
 
208
-			if ( ! empty( $ebi->EventBooking['BookingId'] ) ) {
208
+			if ( !empty( $ebi->EventBooking['BookingId'] ) ) {
209 209
 				$booking_id   = intval( $ebi->EventBooking['BookingId'] );
210 210
 				$reference_id = $booking_id;
211 211
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 				$eventName = $_event['EventName'];
215 215
 			}
216 216
 
217
-			if ( ! empty( $ebi->EventBooking['ProgrammeBookingId'] ) ) {
217
+			if ( !empty( $ebi->EventBooking['ProgrammeBookingId'] ) ) {
218 218
 				$programme_booking_id = intval( $ebi->EventBooking['ProgrammeBookingId'] );
219 219
 				$reference_id         = $programme_booking_id;
220 220
 
@@ -235,19 +235,19 @@  discard block
 block discarded – undo
235 235
 
236 236
 			$customer = WebPayItem::companyCustomer();
237 237
 
238
-			$customerName  = ! empty( $ebi->Customer['BillingInfo']['InvoiceName'] ) ? $ebi->Customer['BillingInfo']['InvoiceName'] : $ebi->Customer['CustomerName'];
239
-			$streetAddress = ! empty( $ebi->Customer['BillingInfo']['Address'] ) ? $ebi->Customer['BillingInfo']['Address'] : $ebi->Customer['Address'];
240
-			$zipCode       = ! empty( $ebi->Customer['BillingInfo']['Zip'] ) ? $ebi->Customer['BillingInfo']['Zip'] : $ebi->Customer['Zip'];
241
-			$city          = ! empty ( $ebi->Customer['BillingInfo']['City'] ) ? $ebi->Customer['BillingInfo']['City'] : $ebi->Customer['City'];
238
+			$customerName  = !empty( $ebi->Customer['BillingInfo']['InvoiceName'] ) ? $ebi->Customer['BillingInfo']['InvoiceName'] : $ebi->Customer['CustomerName'];
239
+			$streetAddress = !empty( $ebi->Customer['BillingInfo']['Address'] ) ? $ebi->Customer['BillingInfo']['Address'] : $ebi->Customer['Address'];
240
+			$zipCode       = !empty( $ebi->Customer['BillingInfo']['Zip'] ) ? $ebi->Customer['BillingInfo']['Zip'] : $ebi->Customer['Zip'];
241
+			$city          = !empty ( $ebi->Customer['BillingInfo']['City'] ) ? $ebi->Customer['BillingInfo']['City'] : $ebi->Customer['City'];
242 242
 			$phone         = $ebi->Customer['Phone'];
243
-			$email         = ! empty( $ebi->Customer['BillingInfo']['Email'] ) ? $ebi->Customer['BillingInfo']['Email'] : $ebi->Customer['Email'];
243
+			$email         = !empty( $ebi->Customer['BillingInfo']['Email'] ) ? $ebi->Customer['BillingInfo']['Email'] : $ebi->Customer['Email'];
244 244
 
245 245
 			$customer->setCompanyName( $customerName );
246 246
 			$customer->setStreetAddress( $streetAddress );
247 247
 			$customer->setZipCode( $zipCode );
248 248
 			$customer->setLocality( $city );
249 249
 
250
-			if ( ! empty( $phone ) ) {
250
+			if ( !empty( $phone ) ) {
251 251
 				$customer->setPhoneNumber( $phone );
252 252
 				$phonePreset = WebPayItem::presetValue()
253 253
 				                         ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::PHONE_NUMBER )
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 		}
374 374
 
375 375
 		public function process_paymentstatus() {
376
-			if ( ! empty( $_GET['svea_order_id'] ) && intval( $_GET['svea_order_id'] ) != 0 && ! empty( $_GET['status'] ) ) {
376
+			if ( !empty( $_GET['svea_order_id'] ) && intval( $_GET['svea_order_id'] ) != 0 && !empty( $_GET['status'] ) ) {
377 377
 
378 378
 				$booking_id           = intval( $_GET['booking_id'] );
379 379
 				$programme_booking_id = intval( $_GET['programme_booking_id'] );
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 				exit( 0 );
384 384
 			}
385 385
 
386
-			if ( isset( $_REQUEST['edu-thankyou'] ) && isset( $_REQUEST['svea'] ) && ! empty( $_GET['status'] ) ) {
386
+			if ( isset( $_REQUEST['edu-thankyou'] ) && isset( $_REQUEST['svea'] ) && !empty( $_GET['status'] ) ) {
387 387
 				$booking_id           = intval( $_GET['booking_id'] );
388 388
 				$programme_booking_id = intval( $_GET['programme_booking_id'] );
389 389
 
Please login to merge, or discard this patch.