Skip to content

Commit

Permalink
fix: enrollment allowed handler evaluates force case
Browse files Browse the repository at this point in the history
  • Loading branch information
julianramirez2 committed Oct 11, 2023
1 parent 3115b56 commit a743779
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions includes/model/class-openedx-woocommerce-plugin-api-calls.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ public function enrollment_handle_old_or_new( $enrollment_data, $enrollment_acti
$status_code = '';

if ( 'error' === $response_new[0] ) {
$status_code = strval($response_new[2]);
$status_code = strval( $response_new[2] );
}
if ( 'enrollment_allowed' === $enrollment_action && '409' === $status_code ) {

if ( ( 'enrollment_allowed' === $enrollment_action || 'enrollment_allowed_force' === $enrollment_action ) && '409' === $status_code ) {

return $response_new;
} else {
} elseif ( ( 'enrollment_allowed' !== $enrollment_action || 'enrollment_allowed_force' !== $enrollment_action ) && '409' !== $status_code ) {
if ( 'success' === $response_new[0] ) {
return $response_new;
} else {
Expand Down

0 comments on commit a743779

Please sign in to comment.