Completed
Push — master ( ee752b...a0d185 )
by Chris
01:24
created
class/class-edu-sveawebpay.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 use Svea\WebPay\Config\ConfigurationService;
9 9
 use Svea\WebPay\Response\SveaResponse;
10 10
 
11
-if ( ! class_exists( 'EDU_SveaWebPay' ) ):
11
+if ( !class_exists( 'EDU_SveaWebPay' ) ):
12 12
 
13 13
 	/**
14 14
 	 * EDU_SveaWebPay integrates EduAdmin-WordPress plugin with SveaWebPay as payment gateway
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 			$ebi = new EduAdmin_BookingInfo( $event_booking, $_customer, $_contact );
80 80
 
81
-			if ( ! empty( EDU()->session['svea-order-id'] ) && ! empty( $_GET['svea_order_id'] ) && EDU()->session['svea-order-id'] === $_GET['svea_order_id'] ) {
81
+			if ( !empty( EDU()->session['svea-order-id'] ) && !empty( $_GET['svea_order_id'] ) && EDU()->session['svea-order-id'] === $_GET['svea_order_id'] ) {
82 82
 				do_action( 'eduadmin-bookingcompleted', $ebi );
83 83
 			} else {
84 84
 				do_action( 'eduadmin-processbooking', $ebi );
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 				return;
95 95
 			}
96 96
 
97
-			if ( ! empty( $_POST['act'] ) && ( 'bookCourse' === $_POST['act'] || 'bookProgramme' === $_POST['act'] ) ) {
97
+			if ( !empty( $_POST['act'] ) && ( 'bookCourse' === $_POST['act'] || 'bookProgramme' === $_POST['act'] ) ) {
98 98
 				$ebi->NoRedirect = true;
99 99
 			}
100 100
 		}
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 			foreach ( $countries as $country ) {
187 187
 				if ( $invoiceCountry == $country['CountryName'] ) {
188 188
 					$selectedCountry = $country['CountryCode'];
189
-					if ( ! empty( $country['CultureName'] ) ) {
189
+					if ( !empty( $country['CultureName'] ) ) {
190 190
 						$selectedLocale = $country['CultureName'];
191 191
 					}
192 192
 					break;
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 			$locationCountry    = '';
207 207
 			$locationPostalCode = '';
208 208
 
209
-			if ( ! empty( $ebi->EventBooking['BookingId'] ) ) {
209
+			if ( !empty( $ebi->EventBooking['BookingId'] ) ) {
210 210
 				$booking_id   = intval( $ebi->EventBooking['BookingId'] );
211 211
 				$reference_id = $booking_id;
212 212
 
@@ -214,14 +214,14 @@  discard block
 block discarded – undo
214 214
 
215 215
 				$eventName = $_event['EventName'];
216 216
 
217
-				if ( ! empty( $_event['LocationAddress'] ) && $_event['LocationAdress'] != null ) {
217
+				if ( !empty( $_event['LocationAddress'] ) && $_event['LocationAdress'] != null ) {
218 218
 					$locationAddress    = $_event['LocationAddress']['Address'];
219 219
 					$locationCountry    = $_event['LocationAddress']['Country'];
220 220
 					$locationPostalCode = $_event['LocationAddress']['AddressZip'];
221 221
 				}
222 222
 			}
223 223
 
224
-			if ( ! empty( $ebi->EventBooking['ProgrammeBookingId'] ) ) {
224
+			if ( !empty( $ebi->EventBooking['ProgrammeBookingId'] ) ) {
225 225
 				$programme_booking_id = intval( $ebi->EventBooking['ProgrammeBookingId'] );
226 226
 				$reference_id         = $programme_booking_id;
227 227
 
@@ -250,19 +250,19 @@  discard block
 block discarded – undo
250 250
 
251 251
 			$customer = WebPayItem::companyCustomer();
252 252
 
253
-			$customerName  = ! empty( $ebi->Customer['BillingInfo']['InvoiceName'] ) ? $ebi->Customer['BillingInfo']['InvoiceName'] : $ebi->Customer['CustomerName'];
254
-			$streetAddress = ! empty( $ebi->Customer['BillingInfo']['Address'] ) ? $ebi->Customer['BillingInfo']['Address'] : $ebi->Customer['Address'];
255
-			$zipCode       = ! empty( $ebi->Customer['BillingInfo']['Zip'] ) ? $ebi->Customer['BillingInfo']['Zip'] : $ebi->Customer['Zip'];
253
+			$customerName  = !empty( $ebi->Customer['BillingInfo']['InvoiceName'] ) ? $ebi->Customer['BillingInfo']['InvoiceName'] : $ebi->Customer['CustomerName'];
254
+			$streetAddress = !empty( $ebi->Customer['BillingInfo']['Address'] ) ? $ebi->Customer['BillingInfo']['Address'] : $ebi->Customer['Address'];
255
+			$zipCode       = !empty( $ebi->Customer['BillingInfo']['Zip'] ) ? $ebi->Customer['BillingInfo']['Zip'] : $ebi->Customer['Zip'];
256 256
 			$city          = $ebi->Customer['BillingInfo']['City'] ? $ebi->Customer['BillingInfo']['City'] : $ebi->Customer['City'];
257 257
 			$phone         = $ebi->Customer['Phone'];
258
-			$email         = ! empty( $ebi->Customer['BillingInfo']['Email'] ) ? $ebi->Customer['BillingInfo']['Email'] : $ebi->Customer['Email'];
258
+			$email         = !empty( $ebi->Customer['BillingInfo']['Email'] ) ? $ebi->Customer['BillingInfo']['Email'] : $ebi->Customer['Email'];
259 259
 
260 260
 			$customer->setCompanyName( $customerName );
261 261
 			$customer->setStreetAddress( $streetAddress );
262 262
 			$customer->setZipCode( $zipCode );
263 263
 			$customer->setLocality( $city );
264 264
 
265
-			if ( ! empty( $phone ) ) {
265
+			if ( !empty( $phone ) ) {
266 266
 				$customer->setPhoneNumber( $phone );
267 267
 				$phonePreset = WebPayItem::presetValue()
268 268
 				                         ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::PHONE_NUMBER )
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 				->setConfirmationUri( $defaultThankYou )
336 336
 				->setPushUri( $defaultPushUrl )
337 337
 				->setCheckoutUri( $defaultCancel ); // We have no "checkout"-url.. So we just cancel the booking instead.
338
-			$wpForm  = $wpBuild->createOrder();
338
+			$wpForm = $wpBuild->createOrder();
339 339
 
340 340
 			EDU()->session['svea-order-id'] = $wpForm['OrderId'];
341 341
 
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 		}
344 344
 
345 345
 		public function process_paymentstatus() {
346
-			if ( ! empty( $_GET['svea_order_id'] ) && ! empty( $_GET['status'] ) ) {
346
+			if ( !empty( $_GET['svea_order_id'] ) && !empty( $_GET['status'] ) ) {
347 347
 
348 348
 				$booking_id           = intval( $_GET['booking_id'] );
349 349
 				$programme_booking_id = intval( $_GET['programme_booking_id'] );
Please login to merge, or discard this patch.
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.