Library to handle Refund requests using Google Sheets integrations in Django
Project description
mitol-django-google-sheets-refunds
This is the Open Learning Django Google Sheets library for handling refund requests over Google Sheets
Setup
pip install mitol-django-google-sheets-refunds
Add the google sheets app:
INSTALLED_APPS = [
...
"mitol.google_sheets_refunds.apps.GoogleSheetsRefundsApp",
]
Configuration
Gather Values
-
The IDs of the refund and deferral sheets in the change of enrollment spreadsheet. These can be found by opening the spreadsheet, selecting the "Refunds" or "Deferrals" worksheets, and copying down the
gid
value in the URL.Example:
https://docs.google.com/spreadsheets/d/abcd1234efgh5678bQFCQ7SSFBH5xHip0Gx2wPKT4fUA/edit#gid=THIS_IS_THE_WORKSHEET_ID
-
The index of the first row where form-driven data begins in the refund worksheet. If you're starting with no data already filled in these sheets (recommended), just use the index of the first non-header row. Use the row index exactly as it appears in the spreadsheet.
Set the following:
-
MITOL_GOOGLE_SHEETS_REFUNDS_REQUEST_WORKSHEET_ID
ID of the worksheet within the refund change request spreadsheet that contains enrollment refund requests from step 2
-
MITOL_GOOGLE_SHEETS_REFUNDS_PROCESSOR_COL
The zero-based index of the refund change sheet column that contains the user that processed the row
-
MITOL_GOOGLE_SHEETS_REFUNDS_COMPLETED_DATE_COL
The zero-based index of the refund change sheet column that contains the row completion date
-
MITOL_GOOGLE_SHEETS_REFUNDS_ERROR_COL
The zero-based index of the refund change sheet column that contains row processing error messages
-
MITOL_GOOGLE_SHEETS_REFUNDS_SKIP_ROW_COL
The zero-based index of the refund change sheet column that indicates whether the row should be skipped
-
MITOL_GOOGLE_SHEETS_REFUNDS_FIRST_ROW
The first row (as it appears in the spreadsheet) of data that our scripts should consider processing in the refund request spreadsheet
settings.py
MITOL_GOOGLE_SHEETS_REFUNDS_PLUGINS = [ "ecommerce.plugins.RefundPlugin" ]
ecommerce/plugins.py
from mitol.google_sheets_refunds import hookimpl
class RefundPlugin:
@hookimpl
def refunds_process_request(refund_request: RefundRequestRow) -> RefundResult:
# TODO: look up the user/order
# TODO: mark the order as refunded
# TODO: unenroll the user
Usage
Processing refunds
refund_request_handler = RefundRequestHandler()
results = refund_request_handler.process_sheet()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mitol-django-google-sheets-refunds-0.8.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33cca37c6ee40ed81b27d65839ba572795b45545d94e2a9376d37dcb0c8a8419 |
|
MD5 | c715841025e58ecc13233f5a7c843f66 |
|
BLAKE2b-256 | 9ce2c2ae992279524fc063a82228b7c64e70a97510347d4861b42846955f9b67 |
Hashes for mitol_django_google_sheets_refunds-0.8.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c17ff60c5d52f9e802a6f32cb34ec0a99cfa4b7628368f745bb0492a6a49c438 |
|
MD5 | 6d43ab4aaa20247c246d553b567d5767 |
|
BLAKE2b-256 | 60f2af0c4a585f8bbf24b025fc518df83b0780fc945df1821df6bd73ce2113ac |