-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Google Sheets-based refund workflow #222
Open
jkachel
wants to merge
7
commits into
main
Choose a base branch
from
jkachel/6042-add-refunds-pt-3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9074f77
to
6bc4c38
Compare
- Adds refunds app to store refunds-related code - Adds models, APIs, and views for refunds - Adds plugin system for refunds - used to generate notification emails, approval codes - Adds ol-django google_sheets and google_sheets_refunds dependencies (but doesn't use them yet) ..added F401, F811 because importing fixtures makes ruff unhappy
- Adds some more hooks for refund denied/issued - Adds some email stubs - Adds more tests and factories - Updates the refund processing code to call CyberSource (iow, actually issue the refund)
- Will now process rows that are added to the specified Google Sheet, using the ol-django apps for this - Set the order to refunded when an approved refund is completed - Adds a task to periodically check the Google Sheet - Adds some really basic documentation for the Google Sheet integration (which mostly punts you to ol-django)
6bc4c38
to
9245519
Compare
Changed the unique on transaction_id; didn't need to but forgot to put the field back.
Marking this as ready for review but: tests are currently failing because the two Google Sheets apps in ol-django have pending migrations. This needs to be fixed upstream but it doesn't affect the code in this PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Needs Review
An open Pull Request that is ready for review
product:unified-ecommerce
Issues related to the Unified Ecommerce project
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.
What are the relevant tickets?
Closes mitodl/hq#6042
Description (What does it do?)
This is the last part of the refunds processing support, and adds the Google Sheets processing code. This will allow the system to read a specific Google Sheet that has been set up in a particular way for refund requests, process those requests, and write the result back to the sheet.
This does not implement writing self-service requests into the Google Sheet. The existing functionality in ol-django doesn't expose an API for writing new rows, so this punts that down the road until that can be added.
How can this be tested?
Automated tests should work.
You will need to have a Google Sheet set up appropriately, and an API key set up that can access the sheet. Once you've done that, the system should check the sheet periodically and process rows within the sheet. You can also run the
process_google_sheet
command to trigger the task manually.The
README.md
is updated with links to the relevant documentation in theol-django
apps - follow those instructions for setup info. There is a Google Sheet that can be used in the Open Learning Engineering share that has been cleared out and has some updates to the form logic to work with UE order IDs - you can either copy this to your own Drive or use it as is.Once everything is set up, you should be able to request a refund via the Google Form and it should process in UE:
Additionally, this should fix some issues with the refunds processing code:
Additional Context
Punting writing new rows to the Google Sheet: with this, the system will process self-service and Google Forms requests, but these exist in different "buckets". The idea was that the self-service requests would also get written to the Google Sheet (for visibility) but the ol-django apps don't support writing new rows to a sheet. It's not strictly required though so focusing just on processing things in the sheet for now.