@@ -37,8 +37,8 @@ discard block |
||
| 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 |
||
| 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() { |
@@ -8,7 +8,7 @@ discard block |
||
| 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 |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | $ebi = new EduAdmin_BookingInfo( $event_booking, $_customer, $_contact ); |
| 81 | 81 | |
| 82 | - if ( ! empty( EDU()->session['svea-order-id'] ) && ! empty( $_GET['svea_order_id'] ) && EDU()->session['svea-order-id'] === $_GET['svea_order_id'] ) { |
|
| 82 | + if ( !empty( EDU()->session['svea-order-id'] ) && !empty( $_GET['svea_order_id'] ) && EDU()->session['svea-order-id'] === $_GET['svea_order_id'] ) { |
|
| 83 | 83 | do_action( 'eduadmin-bookingcompleted', $ebi ); |
| 84 | 84 | } else { |
| 85 | 85 | do_action( 'eduadmin-processbooking', $ebi ); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | return; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - if ( ! empty( $_POST['act'] ) && ( 'bookCourse' === $_POST['act'] || 'bookProgramme' === $_POST['act'] ) ) { |
|
| 98 | + if ( !empty( $_POST['act'] ) && ( 'bookCourse' === $_POST['act'] || 'bookProgramme' === $_POST['act'] ) ) { |
|
| 99 | 99 | $ebi->NoRedirect = true; |
| 100 | 100 | } |
| 101 | 101 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | foreach ( $countries as $country ) { |
| 194 | 194 | if ( $invoiceCountry == $country['CountryName'] ) { |
| 195 | 195 | $selectedCountry = $country['CountryCode']; |
| 196 | - if ( ! empty( $country['CultureName'] ) ) { |
|
| 196 | + if ( !empty( $country['CultureName'] ) ) { |
|
| 197 | 197 | $selectedLocale = $country['CultureName']; |
| 198 | 198 | } |
| 199 | 199 | break; |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $locationCountry = ''; |
| 214 | 214 | $locationPostalCode = ''; |
| 215 | 215 | |
| 216 | - if ( ! empty( $ebi->EventBooking['BookingId'] ) ) { |
|
| 216 | + if ( !empty( $ebi->EventBooking['BookingId'] ) ) { |
|
| 217 | 217 | $booking_id = intval( $ebi->EventBooking['BookingId'] ); |
| 218 | 218 | $reference_id = $booking_id; |
| 219 | 219 | |
@@ -221,14 +221,14 @@ discard block |
||
| 221 | 221 | |
| 222 | 222 | $eventName = $_event['EventName']; |
| 223 | 223 | |
| 224 | - if ( ! empty( $_event['LocationAddress'] ) && $_event['LocationAdress'] != null ) { |
|
| 224 | + if ( !empty( $_event['LocationAddress'] ) && $_event['LocationAdress'] != null ) { |
|
| 225 | 225 | $locationAddress = $_event['LocationAddress']['Address']; |
| 226 | 226 | $locationCountry = $_event['LocationAddress']['Country']; |
| 227 | 227 | $locationPostalCode = $_event['LocationAddress']['AddressZip']; |
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - if ( ! empty( $ebi->EventBooking['ProgrammeBookingId'] ) ) { |
|
| 231 | + if ( !empty( $ebi->EventBooking['ProgrammeBookingId'] ) ) { |
|
| 232 | 232 | $programme_booking_id = intval( $ebi->EventBooking['ProgrammeBookingId'] ); |
| 233 | 233 | $reference_id = $programme_booking_id; |
| 234 | 234 | |
@@ -257,19 +257,19 @@ discard block |
||
| 257 | 257 | |
| 258 | 258 | $customer = WebPayItem::companyCustomer(); |
| 259 | 259 | |
| 260 | - $customerName = ! empty( $ebi->Customer['BillingInfo']['InvoiceName'] ) ? $ebi->Customer['BillingInfo']['InvoiceName'] : $ebi->Customer['CustomerName']; |
|
| 261 | - $streetAddress = ! empty( $ebi->Customer['BillingInfo']['Address'] ) ? $ebi->Customer['BillingInfo']['Address'] : $ebi->Customer['Address']; |
|
| 262 | - $zipCode = ! empty( $ebi->Customer['BillingInfo']['Zip'] ) ? $ebi->Customer['BillingInfo']['Zip'] : $ebi->Customer['Zip']; |
|
| 260 | + $customerName = !empty( $ebi->Customer['BillingInfo']['InvoiceName'] ) ? $ebi->Customer['BillingInfo']['InvoiceName'] : $ebi->Customer['CustomerName']; |
|
| 261 | + $streetAddress = !empty( $ebi->Customer['BillingInfo']['Address'] ) ? $ebi->Customer['BillingInfo']['Address'] : $ebi->Customer['Address']; |
|
| 262 | + $zipCode = !empty( $ebi->Customer['BillingInfo']['Zip'] ) ? $ebi->Customer['BillingInfo']['Zip'] : $ebi->Customer['Zip']; |
|
| 263 | 263 | $city = $ebi->Customer['BillingInfo']['City'] ? $ebi->Customer['BillingInfo']['City'] : $ebi->Customer['City']; |
| 264 | 264 | $phone = $ebi->Customer['Phone']; |
| 265 | - $email = ! empty( $ebi->Customer['BillingInfo']['Email'] ) ? $ebi->Customer['BillingInfo']['Email'] : $ebi->Customer['Email']; |
|
| 265 | + $email = !empty( $ebi->Customer['BillingInfo']['Email'] ) ? $ebi->Customer['BillingInfo']['Email'] : $ebi->Customer['Email']; |
|
| 266 | 266 | |
| 267 | 267 | $customer->setCompanyName( $customerName ); |
| 268 | 268 | $customer->setStreetAddress( $streetAddress ); |
| 269 | 269 | $customer->setZipCode( $zipCode ); |
| 270 | 270 | $customer->setLocality( $city ); |
| 271 | 271 | |
| 272 | - if ( ! empty( $phone ) ) { |
|
| 272 | + if ( !empty( $phone ) ) { |
|
| 273 | 273 | $customer->setPhoneNumber( $phone ); |
| 274 | 274 | $phonePreset = WebPayItem::presetValue() |
| 275 | 275 | ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::PHONE_NUMBER ) |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | ->setConfirmationUri( $defaultThankYou ) |
| 341 | 341 | ->setPushUri( $defaultPushUrl ) |
| 342 | 342 | ->setCheckoutUri( $defaultCancel ); // We have no "checkout"-url.. So we just cancel the booking instead. |
| 343 | - $wpForm = $wpBuild->createOrder(); |
|
| 343 | + $wpForm = $wpBuild->createOrder(); |
|
| 344 | 344 | |
| 345 | 345 | EDU()->session['svea-order-id'] = $wpForm['OrderId']; |
| 346 | 346 | |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | public function process_paymentstatus() { |
| 351 | - if ( ! empty( $_GET['svea_order_id'] ) && intval( $_GET['svea_order_id'] ) != 0 && ! empty( $_GET['status'] ) ) { |
|
| 351 | + if ( !empty( $_GET['svea_order_id'] ) && intval( $_GET['svea_order_id'] ) != 0 && !empty( $_GET['status'] ) ) { |
|
| 352 | 352 | |
| 353 | 353 | $booking_id = intval( $_GET['booking_id'] ); |
| 354 | 354 | $programme_booking_id = intval( $_GET['programme_booking_id'] ); |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | exit( 0 ); |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | - if ( isset( $_REQUEST['edu-thankyou'] ) && isset( $_REQUEST['svea'] ) && ! empty( $_GET['status'] ) ) { |
|
| 361 | + if ( isset( $_REQUEST['edu-thankyou'] ) && isset( $_REQUEST['svea'] ) && !empty( $_GET['status'] ) ) { |
|
| 362 | 362 | $booking_id = intval( $_GET['booking_id'] ); |
| 363 | 363 | $programme_booking_id = intval( $_GET['programme_booking_id'] ); |
| 364 | 364 | |