@@ -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 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | foreach ( $countries as $country ) { |
192 | 192 | if ( $invoiceCountry == $country['CountryName'] ) { |
193 | 193 | $selectedCountry = $country['CountryCode']; |
194 | - if ( ! empty( $country['CultureName'] ) ) { |
|
194 | + if ( !empty( $country['CultureName'] ) ) { |
|
195 | 195 | $selectedLocale = $country['CultureName']; |
196 | 196 | } |
197 | 197 | break; |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | |
208 | 208 | $eventName = ''; |
209 | 209 | |
210 | - if ( ! empty( $ebi->EventBooking['BookingId'] ) ) { |
|
210 | + if ( !empty( $ebi->EventBooking['BookingId'] ) ) { |
|
211 | 211 | $booking_id = intval( $ebi->EventBooking['BookingId'] ); |
212 | 212 | $reference_id = $booking_id; |
213 | 213 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $eventName = $_event['EventName']; |
217 | 217 | } |
218 | 218 | |
219 | - if ( ! empty( $ebi->EventBooking['ProgrammeBookingId'] ) ) { |
|
219 | + if ( !empty( $ebi->EventBooking['ProgrammeBookingId'] ) ) { |
|
220 | 220 | $programme_booking_id = intval( $ebi->EventBooking['ProgrammeBookingId'] ); |
221 | 221 | $reference_id = $programme_booking_id; |
222 | 222 | |
@@ -245,19 +245,19 @@ discard block |
||
245 | 245 | |
246 | 246 | $customer = WebPayItem::companyCustomer(); |
247 | 247 | |
248 | - $customerName = ! empty( $ebi->Customer['BillingInfo']['InvoiceName'] ) ? $ebi->Customer['BillingInfo']['InvoiceName'] : $ebi->Customer['CustomerName']; |
|
249 | - $streetAddress = ! empty( $ebi->Customer['BillingInfo']['Address'] ) ? $ebi->Customer['BillingInfo']['Address'] : $ebi->Customer['Address']; |
|
250 | - $zipCode = ! empty( $ebi->Customer['BillingInfo']['Zip'] ) ? $ebi->Customer['BillingInfo']['Zip'] : $ebi->Customer['Zip']; |
|
248 | + $customerName = !empty( $ebi->Customer['BillingInfo']['InvoiceName'] ) ? $ebi->Customer['BillingInfo']['InvoiceName'] : $ebi->Customer['CustomerName']; |
|
249 | + $streetAddress = !empty( $ebi->Customer['BillingInfo']['Address'] ) ? $ebi->Customer['BillingInfo']['Address'] : $ebi->Customer['Address']; |
|
250 | + $zipCode = !empty( $ebi->Customer['BillingInfo']['Zip'] ) ? $ebi->Customer['BillingInfo']['Zip'] : $ebi->Customer['Zip']; |
|
251 | 251 | $city = $ebi->Customer['BillingInfo']['City'] ? $ebi->Customer['BillingInfo']['City'] : $ebi->Customer['City']; |
252 | 252 | $phone = $ebi->Customer['Phone']; |
253 | - $email = ! empty( $ebi->Customer['BillingInfo']['Email'] ) ? $ebi->Customer['BillingInfo']['Email'] : $ebi->Customer['Email']; |
|
253 | + $email = !empty( $ebi->Customer['BillingInfo']['Email'] ) ? $ebi->Customer['BillingInfo']['Email'] : $ebi->Customer['Email']; |
|
254 | 254 | |
255 | 255 | $customer->setCompanyName( $customerName ); |
256 | 256 | $customer->setStreetAddress( $streetAddress ); |
257 | 257 | $customer->setZipCode( $zipCode ); |
258 | 258 | $customer->setLocality( $city ); |
259 | 259 | |
260 | - if ( ! empty( $phone ) ) { |
|
260 | + if ( !empty( $phone ) ) { |
|
261 | 261 | $customer->setPhoneNumber( $phone ); |
262 | 262 | $phonePreset = WebPayItem::presetValue() |
263 | 263 | ->setTypeName( \Svea\WebPay\Checkout\Model\PresetValue::PHONE_NUMBER ) |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | ->setConfirmationUri( $defaultThankYou ) |
329 | 329 | ->setPushUri( $defaultPushUrl ) |
330 | 330 | ->setCheckoutUri( $defaultCancel ); // We have no "checkout"-url.. So we just cancel the booking instead. |
331 | - $wpForm = $wpBuild->createOrder(); |
|
331 | + $wpForm = $wpBuild->createOrder(); |
|
332 | 332 | |
333 | 333 | EDU()->session['svea-order-id'] = $wpForm['OrderId']; |
334 | 334 | |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | } |
337 | 337 | |
338 | 338 | public function process_paymentstatus() { |
339 | - if ( ! empty( $_GET['svea_order_id'] ) && intval( $_GET['svea_order_id'] ) != 0 && ! empty( $_GET['status'] ) ) { |
|
339 | + if ( !empty( $_GET['svea_order_id'] ) && intval( $_GET['svea_order_id'] ) != 0 && !empty( $_GET['status'] ) ) { |
|
340 | 340 | |
341 | 341 | $booking_id = intval( $_GET['booking_id'] ); |
342 | 342 | $programme_booking_id = intval( $_GET['programme_booking_id'] ); |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | exit( 0 ); |
347 | 347 | } |
348 | 348 | |
349 | - if ( isset( $_REQUEST['edu-thankyou'] ) && isset( $_REQUEST['svea'] ) && ! empty( $_GET['status'] ) ) { |
|
349 | + if ( isset( $_REQUEST['edu-thankyou'] ) && isset( $_REQUEST['svea'] ) && !empty( $_GET['status'] ) ) { |
|
350 | 350 | $booking_id = intval( $_GET['booking_id'] ); |
351 | 351 | $programme_booking_id = intval( $_GET['programme_booking_id'] ); |
352 | 352 |