From 563e2954b97dc674b4fb8d24d5862a4f5d703379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Fernanda=20Magallanes?= <35668326+MaferMazu@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:25:40 -0500 Subject: [PATCH] fix: avoid using the email enrollment endpoint to fix a bug in versions without email support (#59) --- .../model/class-openedx-woocommerce-plugin-api-calls.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/model/class-openedx-woocommerce-plugin-api-calls.php b/includes/model/class-openedx-woocommerce-plugin-api-calls.php index 09a2ee6..18b054a 100644 --- a/includes/model/class-openedx-woocommerce-plugin-api-calls.php +++ b/includes/model/class-openedx-woocommerce-plugin-api-calls.php @@ -136,7 +136,7 @@ public function request_handler( $enrollment_data, $enrollment_action ) { if ( 'enrollment_process' === $enrollment_action ) { - $request_with_email_body = $this->get_enrollment_process_body( $enrollment_data, false, $access_token_string, $enrollment_action ); + $request_with_email_body = $this->get_enrollment_process_body( $enrollment_data, true, $access_token_string, $enrollment_action ); return $this->process_enrollment_action( $enrollment_data, $enrollment_action, $access_token_string, $request_with_email_body, self::API_ENROLLMENT, 'POST' ); } elseif ( 'enrollment_allowed' === $enrollment_action ) { @@ -150,7 +150,7 @@ public function request_handler( $enrollment_data, $enrollment_action ) { } } elseif ( 'enrollment_force' === $enrollment_action ) { - $request_with_email_body = $this->get_enrollment_process_body( $enrollment_data, false, $access_token_string, $enrollment_action ); + $request_with_email_body = $this->get_enrollment_process_body( $enrollment_data, true, $access_token_string, $enrollment_action ); return $this->process_enrollment_action( $enrollment_data, $enrollment_action, $access_token_string, $request_with_email_body, self::API_ENROLLMENT, 'POST' ); } elseif ( 'enrollment_allowed_force' === $enrollment_action ) { @@ -166,7 +166,7 @@ public function request_handler( $enrollment_data, $enrollment_action ) { if ( 'enrollment_process' === $enrollment_action ) { - $request_with_email_body = $this->get_enrollment_process_body( $enrollment_data, false, $access_token_string, $enrollment_action ); + $request_with_email_body = $this->get_enrollment_process_body( $enrollment_data, true, $access_token_string, $enrollment_action ); return $this->process_enrollment_action( $enrollment_data, $enrollment_action, $access_token_string, $request_with_email_body, self::API_ENROLLMENT, 'POST' ); } elseif ( 'enrollment_allowed' === $enrollment_action ) { @@ -180,7 +180,7 @@ public function request_handler( $enrollment_data, $enrollment_action ) { } } elseif ( 'enrollment_force' === $enrollment_action ) { - $request_with_email_body = $this->get_enrollment_process_body( $enrollment_data, false, $access_token_string, $enrollment_action ); + $request_with_email_body = $this->get_enrollment_process_body( $enrollment_data, true, $access_token_string, $enrollment_action ); return $this->process_enrollment_action( $enrollment_data, $enrollment_action, $access_token_string, $request_with_email_body, self::API_ENROLLMENT, 'POST' ); } elseif ( 'enrollment_allowed_force' === $enrollment_action ) {