Skip to content

Commit

Permalink
fix: avoid using the email enrollment endpoint to fix a bug in versio…
Browse files Browse the repository at this point in the history
…ns without email support (#59)
  • Loading branch information
MaferMazu authored Nov 8, 2023
1 parent f240dc0 commit 563e295
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions includes/model/class-openedx-woocommerce-plugin-api-calls.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand All @@ -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 ) {

Expand All @@ -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 ) {
Expand All @@ -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 ) {

Expand Down

0 comments on commit 563e295

Please sign in to comment.