feat: enrollment creation when an order is processed #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
A functionality has been created that allows a WooCommerce order, which has already been paid and is in the 'processing' state, to automatically create an Enrollment Request with the order information. In this case, the email used for processing will be the one associated with the billing information of the order.
This pull request includes only the 'happy path,' which means it works when all the information is correct and handles very basic errors. In other words, if there is a failure in the API request, it will be displayed in the notes, but if there are other types of errors, there is a possibility that the process may be interrupted.
Testing instructions
To test it:
Additional information
This is how a successful order looks like:
In the event of a failure in the Open edX API request, you will see the error message at the location indicated by the arrow on the right side of the screen.
Checklist for Merge