@@ -6,7 +6,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -11,11 +11,11 @@ discard block |
||
| 11 | 11 | /** |
| 12 | 12 | * EDU_SveaWebPay integrates EduAdmin-WordPress plugin with SveaWebPay as payment gateway |
| 13 | 13 | */ |
| 14 | - class EDU_SveaWebPay extends EDU_Integration { |
|
| 14 | + class EDU_SveaWebPay extends EDU_Integration {
|
|
| 15 | 15 | /** |
| 16 | 16 | * Constructor |
| 17 | 17 | */ |
| 18 | - public function __construct() { |
|
| 18 | + public function __construct() {
|
|
| 19 | 19 | $this->id = 'eduadmin-sveawebpay'; |
| 20 | 20 | $this->displayName = __( 'Svea Webpay (Checkout)', 'eduadmin-sveawebpay' ); |
| 21 | 21 | $this->description = ''; |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | /** |
| 36 | 36 | * @param $attributes |
| 37 | 37 | */ |
| 38 | - public function test_page( $attributes ) { |
|
| 38 | + public function test_page( $attributes ) {
|
|
| 39 | 39 | $attributes = shortcode_atts( |
| 40 | 40 | array( |
| 41 | 41 | 'bookingid' => 0, |
@@ -45,14 +45,14 @@ discard block |
||
| 45 | 45 | 'test_page' |
| 46 | 46 | ); |
| 47 | 47 | |
| 48 | - if ( $attributes['bookingid'] > 0 ) { |
|
| 48 | + if ( $attributes['bookingid'] > 0 ) {
|
|
| 49 | 49 | $event_booking = EDUAPI()->OData->Bookings->GetItem( |
| 50 | 50 | $attributes['bookingid'], |
| 51 | 51 | null, |
| 52 | 52 | 'Customer($select=CustomerId;),ContactPerson($select=PersonId;),OrderRows', |
| 53 | 53 | false |
| 54 | 54 | ); |
| 55 | - } elseif ( $attributes['programmebookingid'] > 0 ) { |
|
| 55 | + } elseif ( $attributes['programmebookingid'] > 0 ) {
|
|
| 56 | 56 | $event_booking = EDUAPI()->OData->ProgrammeBookings->GetItem( |
| 57 | 57 | $attributes['programmebookingid'], |
| 58 | 58 | null, |
@@ -77,9 +77,9 @@ discard block |
||
| 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 | - } else { |
|
| 82 | + } else {
|
|
| 83 | 83 | do_action( 'eduadmin-processbooking', $ebi ); |
| 84 | 84 | } |
| 85 | 85 | } |
@@ -88,12 +88,12 @@ discard block |
||
| 88 | 88 | /** |
| 89 | 89 | * @param EduAdmin_BookingInfo|null $ebi |
| 90 | 90 | */ |
| 91 | - public function intercept_booking( $ebi = null ) { |
|
| 92 | - if ( 'no' === $this->get_option( 'enabled', 'no' ) ) { |
|
| 91 | + public function intercept_booking( $ebi = null ) {
|
|
| 92 | + if ( 'no' === $this->get_option( 'enabled', 'no' ) ) {
|
|
| 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 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | /** |
| 102 | 102 | * Initializes the settingsfields |
| 103 | 103 | */ |
| 104 | - public function init_form_fields() { |
|
| 104 | + public function init_form_fields() {
|
|
| 105 | 105 | $this->setting_fields = array( |
| 106 | 106 | 'enabled' => array( |
| 107 | 107 | 'title' => __( 'Enabled', 'eduadmin-sveawebpay' ), |
@@ -133,12 +133,12 @@ discard block |
||
| 133 | 133 | /** |
| 134 | 134 | * |
| 135 | 135 | */ |
| 136 | - public function process_svearesponse() { |
|
| 137 | - if ( 'no' === $this->get_option( 'enabled', 'no' ) ) { |
|
| 136 | + public function process_svearesponse() {
|
|
| 137 | + if ( 'no' === $this->get_option( 'enabled', 'no' ) ) {
|
|
| 138 | 138 | return; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - if ( isset( $_REQUEST['edu-thankyou'] ) && isset( $_REQUEST['svea'] ) ) { |
|
| 141 | + if ( isset( $_REQUEST['edu-thankyou'] ) && isset( $_REQUEST['svea'] ) ) {
|
|
| 142 | 142 | $booking_id = intval( $_GET['booking_id'] ); |
| 143 | 143 | $programme_booking_id = intval( $_GET['programme_booking_id'] ); |
| 144 | 144 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | EDU()->session['svea-order-id'] = null; |
| 148 | 148 | |
| 149 | - if ( $deleted ) { |
|
| 149 | + if ( $deleted ) {
|
|
| 150 | 150 | $this->handle_cancelled_payment(); |
| 151 | 151 | } |
| 152 | 152 | } |
@@ -155,14 +155,14 @@ discard block |
||
| 155 | 155 | /** |
| 156 | 156 | * @param $ebi EduAdmin_BookingInfo|null $bookingInfo |
| 157 | 157 | */ |
| 158 | - public function process_booking( $ebi = null ) { |
|
| 159 | - if ( 'no' === $this->get_option( 'enabled', 'no' ) ) { |
|
| 158 | + public function process_booking( $ebi = null ) {
|
|
| 159 | + if ( 'no' === $this->get_option( 'enabled', 'no' ) ) {
|
|
| 160 | 160 | return; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | $ebi->NoRedirect = true; |
| 164 | 164 | |
| 165 | - if ( empty( $_GET['svea_order_id'] ) || empty( EDU()->session['svea-order-id'] ) ) { |
|
| 165 | + if ( empty( $_GET['svea_order_id'] ) || empty( EDU()->session['svea-order-id'] ) ) {
|
|
| 166 | 166 | $checkout = $this->create_checkout( $ebi ); |
| 167 | 167 | |
| 168 | 168 | $snippet = $checkout['Gui']['Snippet']; |
@@ -175,21 +175,21 @@ discard block |
||
| 175 | 175 | * |
| 176 | 176 | * @returns array |
| 177 | 177 | */ |
| 178 | - public function create_checkout( $ebi ) { |
|
| 178 | + public function create_checkout( $ebi ) {
|
|
| 179 | 179 | $countries = EDUAPI()->OData->Countries->Search()['value']; |
| 180 | 180 | |
| 181 | 181 | $selectedCountry = 'SE'; |
| 182 | 182 | $selectedLocale = 'sv-SE'; |
| 183 | 183 | |
| 184 | 184 | $invoiceCountry = $ebi->Customer['BillingInfo']['Country']; |
| 185 | - if ( empty( $invoiceCountry ) ) { |
|
| 185 | + if ( empty( $invoiceCountry ) ) {
|
|
| 186 | 186 | $invoiceCountry = $ebi->Customer['Country']; |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - foreach ( $countries as $country ) { |
|
| 190 | - if ( $invoiceCountry == $country['CountryName'] ) { |
|
| 189 | + foreach ( $countries as $country ) {
|
|
| 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 |
||
| 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 |
||
| 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 | |
@@ -225,9 +225,9 @@ discard block |
||
| 225 | 225 | |
| 226 | 226 | $currency = EDU()->get_option( 'eduadmin-currency', 'SEK' ); |
| 227 | 227 | |
| 228 | - if ( 'no' !== $this->get_option( 'testrun', 'no' ) ) { |
|
| 228 | + if ( 'no' !== $this->get_option( 'testrun', 'no' ) ) {
|
|
| 229 | 229 | $wpConfig = new EduSveaWebPayTestConfig( $this ); |
| 230 | - } else { |
|
| 230 | + } else {
|
|
| 231 | 231 | $wpConfig = new EduSveaWebPayProductionConfig( $this ); |
| 232 | 232 | } |
| 233 | 233 | |
@@ -247,7 +247,7 @@ discard block |
||
| 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 ) |
@@ -336,18 +336,18 @@ discard block |
||
| 336 | 336 | |
| 337 | 337 | $wpBuild->addOrderRow( $orderRow ); |
| 338 | 338 | |
| 339 | - foreach ( $ebi->EventBooking['OrderRows'] as $eduOrderRow ) { |
|
| 339 | + foreach ( $ebi->EventBooking['OrderRows'] as $eduOrderRow ) {
|
|
| 340 | 340 | $orderRow = WebPayItem::orderRow(); |
| 341 | 341 | $orderRow->setName( substr( $eduOrderRow['Description'], 0, 40 ) ); |
| 342 | 342 | $orderRow->setQuantity( $eduOrderRow['Quantity'] ); |
| 343 | 343 | |
| 344 | 344 | $orderRow->setVatPercent( $eduOrderRow['VatPercent'] ); |
| 345 | 345 | |
| 346 | - if ( $eduOrderRow['PriceIncVat'] ) { |
|
| 346 | + if ( $eduOrderRow['PriceIncVat'] ) {
|
|
| 347 | 347 | $orderRow->setAmountIncVat( $eduOrderRow['TotalPrice'] ); |
| 348 | - } else { |
|
| 348 | + } else {
|
|
| 349 | 349 | $priceInclVat = $eduOrderRow['TotalPrice']; |
| 350 | - if ( $eduOrderRow['VatPercent'] > 0 ) { |
|
| 350 | + if ( $eduOrderRow['VatPercent'] > 0 ) {
|
|
| 351 | 351 | $priceInclVat = $eduOrderRow['TotalPrice'] * ( 1 + ( $eduOrderRow['VatPercent'] / 100 ) ); |
| 352 | 352 | } |
| 353 | 353 | $orderRow->setAmountIncVat( $priceInclVat ); |
@@ -365,8 +365,8 @@ discard block |
||
| 365 | 365 | return $wpForm; |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | - public function process_paymentstatus() { |
|
| 369 | - if ( ! empty( $_GET['svea_order_id'] ) && intval( $_GET['svea_order_id'] ) != 0 && ! empty( $_GET['status'] ) ) { |
|
| 368 | + public function process_paymentstatus() {
|
|
| 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 |
||
| 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 | |
@@ -384,13 +384,13 @@ discard block |
||
| 384 | 384 | |
| 385 | 385 | EDU()->session['svea-order-id'] = null; |
| 386 | 386 | |
| 387 | - if ( $deleted ) { |
|
| 387 | + if ( $deleted ) {
|
|
| 388 | 388 | $this->handle_cancelled_payment(); |
| 389 | 389 | } |
| 390 | 390 | } |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | - private function handle_cancelled_payment() { |
|
| 393 | + private function handle_cancelled_payment() {
|
|
| 394 | 394 | @wp_redirect( get_home_url() ); |
| 395 | 395 | wp_add_inline_script( 'edu-svea-redirecthome', "location.href = '" . esc_js( get_home_url() ) . "';" ); |
| 396 | 396 | wp_enqueue_script( 'edu-svea-redirecthome', false, array( 'jquery' ) ); |
@@ -405,10 +405,10 @@ discard block |
||
| 405 | 405 | * @return bool If the booking was deleted, due to cancellation |
| 406 | 406 | * @throws \Svea\WebPay\BuildOrder\Validator\ValidationException |
| 407 | 407 | */ |
| 408 | - private function update_booking( $order_id, $booking_id, $programme_booking_id ) { |
|
| 409 | - if ( 'no' !== $this->get_option( 'testrun', 'no' ) ) { |
|
| 408 | + private function update_booking( $order_id, $booking_id, $programme_booking_id ) {
|
|
| 409 | + if ( 'no' !== $this->get_option( 'testrun', 'no' ) ) {
|
|
| 410 | 410 | $wpConfig = new EduSveaWebPayTestConfig( $this ); |
| 411 | - } else { |
|
| 411 | + } else {
|
|
| 412 | 412 | $wpConfig = new EduSveaWebPayProductionConfig( $this ); |
| 413 | 413 | } |
| 414 | 414 | |
@@ -422,39 +422,39 @@ discard block |
||
| 422 | 422 | $patch_booking = new stdClass(); |
| 423 | 423 | $patch_booking->PaymentMethodId = 2; |
| 424 | 424 | |
| 425 | - if ( 'Cancelled' === $order['Status'] ) { |
|
| 425 | + if ( 'Cancelled' === $order['Status'] ) {
|
|
| 426 | 426 | $patch_booking->Paid = false; |
| 427 | 427 | $delete_booking = true; |
| 428 | - } else if ( 'Final' === $order['Status'] ) { |
|
| 428 | + } else if ( 'Final' === $order['Status'] ) {
|
|
| 429 | 429 | $patch_booking->Paid = true; |
| 430 | - } else if ( 'Created' === $order['Status'] ) { |
|
| 430 | + } else if ( 'Created' === $order['Status'] ) {
|
|
| 431 | 431 | $patch_booking->Paid = false; |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | - if ( isset( $_GET['status'] ) && 'cancel' === $_GET['status'] ) { |
|
| 434 | + if ( isset( $_GET['status'] ) && 'cancel' === $_GET['status'] ) {
|
|
| 435 | 435 | $patch_booking->Paid = false; |
| 436 | 436 | $delete_booking = true; |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | - if ( $booking_id > 0 ) { |
|
| 439 | + if ( $booking_id > 0 ) {
|
|
| 440 | 440 | EDUAPI()->REST->Booking->PatchBooking( |
| 441 | 441 | $booking_id, |
| 442 | 442 | $patch_booking |
| 443 | 443 | ); |
| 444 | 444 | |
| 445 | - if ( $delete_booking ) { |
|
| 445 | + if ( $delete_booking ) {
|
|
| 446 | 446 | EDUAPI()->REST->Booking->DeleteBooking( $booking_id ); |
| 447 | 447 | } |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | - if ( $programme_booking_id > 0 ) { |
|
| 450 | + if ( $programme_booking_id > 0 ) {
|
|
| 451 | 451 | |
| 452 | 452 | EDUAPI()->REST->ProgrammeBooking->PatchBooking( |
| 453 | 453 | $programme_booking_id, |
| 454 | 454 | $patch_booking |
| 455 | 455 | ); |
| 456 | 456 | |
| 457 | - if ( $delete_booking ) { |
|
| 457 | + if ( $delete_booking ) {
|
|
| 458 | 458 | EDUAPI()->REST->ProgrammeBooking->DeleteBooking( $programme_booking_id ); |
| 459 | 459 | } |
| 460 | 460 | } |