|
@@ -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']; |
|
|
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
|
241
|
$city = $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 ) |
|
@@ -366,7 +366,7 @@ discard block |
|
|
block discarded – undo |
|
366
|
366
|
} |
|
367
|
367
|
|
|
368
|
368
|
public function process_paymentstatus() { |
|
369
|
|
- if ( ! empty( $_GET['svea_order_id'] ) && intval( $_GET['svea_order_id'] ) != 0 && ! empty( $_GET['status'] ) ) { |
|
|
369
|
+ if ( !empty( $_GET['svea_order_id'] ) && intval( $_GET['svea_order_id'] ) != 0 && !empty( $_GET['status'] ) ) { |
|
370
|
370
|
|
|
371
|
371
|
$booking_id = intval( $_GET['booking_id'] ); |
|
372
|
372
|
$programme_booking_id = intval( $_GET['programme_booking_id'] ); |
|
@@ -376,7 +376,7 @@ discard block |
|
|
block discarded – undo |
|
376
|
376
|
exit( 0 ); |
|
377
|
377
|
} |
|
378
|
378
|
|
|
379
|
|
- if ( isset( $_REQUEST['edu-thankyou'] ) && isset( $_REQUEST['svea'] ) && ! empty( $_GET['status'] ) ) { |
|
|
379
|
+ if ( isset( $_REQUEST['edu-thankyou'] ) && isset( $_REQUEST['svea'] ) && !empty( $_GET['status'] ) ) { |
|
380
|
380
|
$booking_id = intval( $_GET['booking_id'] ); |
|
381
|
381
|
$programme_booking_id = intval( $_GET['programme_booking_id'] ); |
|
382
|
382
|
|