Skip to content
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

Develop koa #136

Draft
wants to merge 14 commits into
base: develop-juniper
Choose a base branch
from
Draft

Develop koa #136

wants to merge 14 commits into from

Conversation

marslanabdulrauf
Copy link

@marslanabdulrauf marslanabdulrauf commented Aug 18, 2023

Temporary, NEVER MERGE

marslanabdulrauf and others added 14 commits August 10, 2023 13:56
* add warning that docs are out of date; update devstack link (openedx-unsupported#3093)

* ENT-2939: removing waffle flag and utility function used in enterprise-catalog transition (openedx-unsupported#3077)

* removing waffle flag and utility function used in enterprise-catalog transition

* updating tests to accommodate new default logic

* incorporating review feedback

* Removed usages of package six, part 5

* Removed usages of package six, part 6

* Removed usages of package six, part 7

* Removed usages of package six, part 8

* REV-1237: prevent duplicate seats in basket

* Specify CELERY_* serializers to match Celery 3 defaults

* Removed usages of package six, part 9

* Requirements upgrade

* Merge pull request openedx-unsupported#3098 from edx/emma-green/REV-1302/add-payment-processor-event

add new segment event to fire after payment processor response

* DISCO-1540: Force default id_verified for professional entitlements

* Upgrade to celery 4

* Unpin the redis client to allow it to match with celery 4

* [REV-1278] Create metadata table for SDN fallback (openedx-unsupported#3087)

We are adding a metadata table to keep track of the current state of the SDN fallback csv data in the database in order to keep track of the current state of the SDN fallback csv data.

* Flex Microform Spike

* Remove dynamic discount code to reduce cognitive load in payment processors

* Induce a baseclass for both views that handle cybersource payment flows

* Induce a baseclass for both views that initiate cybersource payment validation

* Pull checkSDN code into a separate class

* Capture exception logging status as an attribute on the exception

* Move handling/logging for cybersource specific payment errors into a decorator

* Separate payment exception logging from database atomicity

* Move pycodestyle config to an actual per-project config file

* Flip order of notification and ppr arguments in logging function

* Move the notification message extraction up into the logging caller

* Move the default notification_msg value into the base logging function

* Add a TODO for an existing bug in error handling

* Extract payment_response custom metrics into the base CybersourceOrderCompletionView

* Move data extraction in authorize_payment closer to where it is used

* Split authorize_payment into two methods, initiate_payment and handle_payment_response

* Rename return_data to payment_processor_response in initiate_payment and handle_payment_response

* Extract authorize_payment out into the single place it's used

* Extract Cybersource REST api specifics into a separate payment processor subclass

* Move del_none out of Cybersource PaymentProcessor

* Push CyberSourceProcessorMixin mixing down into the specific view classes

* Switch CibresourceAuthorizeAPIView to use CybersourceREST as payment_processor for all methods

* Add an Enum to capture known decision values

* Use Decision values that match the Cybersource strings

* Add a dataclass to capture all data needed for handling a cybersource response

* Use UnhandledProcessorResponse in handle_processer_response for computing output

* Move construction of UnhandledProcessorResponse to an internal (overrideable) method

* Pull record_processor_response call out of handle_payment_response

* Remove redundant argument from handle_payment_response

* Move CyberSourceRESTProcessorMixin closer to where it's used

* Capture the payment_token and capture_context in __init__ of CybersourceREST

* Add a _normalize_processor_response for CybersourceREST

* Convert to using CybersourceREST.handle_processor_response for CybersourceAuthorizeAPIView

* Remove unusued handle_payment_response method

* Fix linting errors in cybersource.py files

* Move validate_notification up to CybersourceOrderCompletionView

* Rename validate_notification to validate_order_completion

* Rename notification to order_completion_message in validate_order_completion

* Rename get_ids_from_notification to get_ids_from_order_completion

* Initialized transaction_id, order_number, and basket_id at the beginning of CybersourceInterstitialView.post

* Stop using get_ids_from_order_completion in favor of the initialized instance attributes

* Remove unused get_ids_from_order_completion

* Initialize transaction_id, order_number, and basket_id at the beginning of CybersourceAuthorizeAPIView.form_valid

* Use initialized order_number in a CybersourceInterstitialView utility methods

* Move _merge_old_basket_into_new up to CybersourceOrderCompletionView

* Remove extraneous argument to _merge_old_basket_into_new

* Remove extraneous argument to redirect_to_receipt_page

* Extract absolute_redirects in CybersourceInterstitialView into a method

* Move order completion validation and redirection into the base CybersourceOrderCompletionView

* Push redirecting to a url back down into the Interstitial view

* Move create_order and handle_poster_order calls into validate_order_completion_or_redirect (and change method name)

* Rename notification to order_completion_message in complete_order

* Extract TransactionAPI BillingAddress construction into a separate method

* Narrow the specification of redirect used for payment errors

* Extract redirect when transaction is declined to a separate method

* Add AuthorizeAPI equivalents for the three types of redirects used on order completion

* Use redirect methods in AuthorizeAPI view

* Use complete_order in AuthorizationAPI view

* Add cybersource-rest-client

* Fix invalid query counting ids

* Remove --rebuild from secondary runs of pip-compile to reuse the existing cache

* Add specific number of digits to string-formatted decimals

* Add flex_microform_enabled to expected response data

* Upgrade celery by upgrading it in ecommerce-worker

* Remove python3.5 testing environments

* Fix quality errors

* fix isort test failures

* address codecov failures

* address codecov failures

* remove unresolved merge conflict

* Bumped ecommerce-worker to 0.8.2 (openedx-unsupported#3109)

Bumping ecommerce-worker to 0.7.5 to incorporate recent
changes, adding a new email template for Enterprise Portal

ENT-3300

* ENT-3171: Optimized _get_not_redeemed_usages method (openedx-unsupported#3106)

* Allow e2e tests to run via py35 or py38

* Pin pytest-selenium to a py3.5 compatible version

* Disable cybersource logging for now (openedx-unsupported#3118)

We do not have write-access to the log directory, disable logging from the new flex-form acceptance cybersource client for now

* removed 'with transaction.atomic():' after discussing with Cale; it's unnecessary and having it meant transaction rollback prevented track_segment_event firing, since it uses transaction.on_commit (openedx-unsupported#3120)

* adding &nbsp with \n newline tag (openedx-unsupported#3121)

* Refactor SDNFallbackMetadata model unit tests (openedx-unsupported#3112)

Refactored the SDNFallbackMetadata model unit tests (REV-1278 / https://github.com/edx/ecommerce/pull/3087) to use the Factory pattern to create dummy SDNFallbackMetadata objects to make the unit tests more readable.

* Catch all errors while generating capture_contexts

* add logs for voucher offers

ENT-3198

* Add SDNFallbackData model for looking up an individual when official SDN check is down (openedx-unsupported#3102)

Add SDNFallbackData model and filter current list by source and SDN type
REV-1280

* reverting _get_not_assigned_usages code to previous implementation with loop. (openedx-unsupported#3130)

* Extract reason_code and payment_response_message into arguments to set_payment_response_custom_metrics

* Extract _get_basket into base OrderCompletionView

* Use extracted payment_response_message for logging purposes

* Move order_completion_message normalization earlier in the processing path

* Store the raw_json of the CyberSource API response so that it can be recorded

* Put the reason_code and payment_response_method onto the UnhandledCyberSourceResponse

* Handle duplicate payment errors that have no previously created order, and no amount details to create an order

* Move BillingAddress creation into processor response normalization

* Move signature validation into handle_processor_response

* Remove underscore prefix from _normalize_processor_response

* Only attempt to use the billing address for creating new orders

* Fix linting hints

* Create a capture context / public key endpoint for flex-form work (openedx-unsupported#3127)

Create capture context api endpoint; for now the payment endpoint continues to include the capture context / public key data

* Use python3.8 for ecommerce e2e tests

* Fix the commands for py38-e2e tox target

* Move order_completion_message normalization inside the only method it's used by

* Rename normalized order_completion_message

* Extract raw_json extraction to a separate method

* Use the extracted method to get the serialized order_completion_message for logging

* Extract reason_code into a separate method

* Only extract reason_code at the point of use

* Extract payment_response_message into a separate method

* Use the extract_payment_response_message directly where it's used

* Record payment response and payment_response_custom_metrics even if the payment response normalization fails

* Catch all cybersource api errors, not just Exception-subclass ones

* Bump is-my-json-valid from 2.16.1 to 2.20.5

Bumps [is-my-json-valid](https://github.com/mafintosh/is-my-json-valid) from 2.16.1 to 2.20.5.
- [Release notes](https://github.com/mafintosh/is-my-json-valid/releases)
- [Commits](mafintosh/is-my-json-valid@v2.16.1...v2.20.5)

Signed-off-by: dependabot[bot] <[email protected]>

* Strip trailing slashes from flex_target_origin

* Add comment about why we don't need to validate the CyberSource signature in the new API path

* ENT-3199 | Added course mode in manual enrollment API.

* Failing the order with non-paid modes courses.

* [REV-1311] download SDN csv file for fallback  (openedx-unsupported#3128)

added SDN download management command for use in fallback when trade.gov API is down

* ENT-3399 - Adds management command to update contract discounts for API orders (openedx-unsupported#3144)

* Adds management command to update contract discounts for API orders

* Add guards against missing offers and conditions

* Add test for management command

* Quality cleanup

* fix credit track course offer data

ENT-3198

* Append the flex_microform flag to the payment url when the flex microform is enabled to immediately put credit cards into a loading state

* Fix the url-joining parameter for flex microform waffle flag

* Fix key error in capture context endpoint (openedx-unsupported#3151)

Pushed methods only used by CaptureContextApiView down out of the mixin; eliminated copy-pasta it doesn't need

* Add a metric that specifies which payment processor class is being used for cybersource transactions

* Add PaymentProcessor class name to Cybersource payment view log messages

* Add a different NAME to the CybersourceREST payment processor

* Use the correct field from the Cybersource REST api for the transaction id so that refunds work

* [REV-1311] SDN download code improvements (tempfile, remove url parameter, improved error handling)

* Teach the e2e tests to use the flex microform for credit card information

* Stop vending capture key from payment endpoint (openedx-unsupported#3158)

Stop vending capture key from basket endpoint

* Add functions to import the SDN CSV into the database
Adds Django management command to import the SDN (Consolidated Screening List) CSV.
REV-1310

* Use http protocol for local development (openedx-unsupported#3126)

The django server cannot handle https calls

* Fix addressing of flex-microform iframe in e2e test

* Use base.txt and pins.txt as constraints for the e2e test versions

* Pass SELENIUM_* variables into the e2e test environment

* Make the CybersourceREST processer independently addressable to handle refunds

* Fix exception that happens during log when the file is unchanged

* Add functions to import the SDN CSV into the database
Adds Django management command to import the SDN (Consolidated Screening List) CSV.
REV-1310

* move sdn code to a new file

* Update comments in processor response methods and SDN fallback tests (openedx-unsupported#3164)

Add "refund" in PaymentProcessorResponse and other methods

* [REV-1323] Remove accents from unicode characters where possible (openedx-unsupported#3159)

Transliterate unicode characters into ascii (e.g. replace characters that have accents with non-accented characters) for the name/address fields when importing the SDN fallback CSV in order to normalize the input SDN characters to make it easier to search + find matches

* update ecommerce to use ecommerce-worker 0.8.3 (openedx-unsupported#3165)

* [REV-1337] Add function that checks an individual against the SDN Fallback (openedx-unsupported#3157)

* Add function that checks an individual against the SDN Fallback

REV-1337

* docs: Replace all .(lms|cms).(\w+|_)?\.json to .(lms|cms).(\w+|_)?\.yml

* [REV-1442] Add success log when the script completes successfully (openedx-unsupported#3168)

Added a success log to note when the script completes successfully so we have confirmation that the script completed successfully (regardless of whether the file was imported or downloaded). This will allow us to set the appropriate alerting + monitoring on the script.

* ENT-3331: Adds in public/private flag to products for code batches (openedx-unsupported#3167)

* Add configurable timeouts for the cybersource rest api calls

* Fix the payment e2e tests by referencing microform fields correctly

* ENT-3337 | Create and Assign a new code upon enterprise unenrollment within the refund period (openedx-unsupported#3162)

* Added create_refunded_voucher API.

* feedback from irfan

* Replacing &nbsp with \n newline tag in remind and revoke emails (openedx-unsupported#3173)

* ENT-3478 Update requirements (openedx-unsupported#3174)

* Replace __unicode__ with __str__ (openedx-unsupported#3092)

* BOM-2030 (openedx-unsupported#3175)

Inside ecom-worker httpretty chaned with responses.
Updating the package version here.

* Upgrade ecom-worker (openedx-unsupported#3177)

* Upgrade django-ses (openedx-unsupported#3161)

Amazon's SES is making a change on October 1st that will cause any email sent to this service via the older boto package to fail so we are upgrading django-ses package as it is already using boto3 to send emails since version 1.0.0 [https://github.com/django-ses/django-ses/releases/tag/v1.0.0]

Relevant JIRA : https://openedx.atlassian.net/browse/BOM-2022

* ENT-3463: Add Scholarship Category in Enterprise Coupon (openedx-unsupported#3179)

* PCI-102 gracefully handle total_amount null (openedx-unsupported#3181)

* If total_amount is null use authorized_amount

* use basket_id for custom metrics rather than basket.id; basket could be None

* Guard for missing amount_details

* Guard for missing tokenized card (openedx-unsupported#3184)

* Guard for missing tokenized card

* Mark AUTHORIZED_PENDING_REVIEW as Decision.decline

* MICROBA-613 Remove journals app (openedx-unsupported#3183)

* Use the CybersourceREST processor_response.id as the transaction_id for logging

* REV-1338: Add shadow call to  SDNFallback to compare with results from SDN API (openedx-unsupported#3176)

* Bump http-proxy from 1.16.2 to 1.18.1 (openedx-unsupported#3146)

Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.16.2 to 1.18.1.
- [Release notes](https://github.com/http-party/node-http-proxy/releases)
- [Changelog](https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md)
- [Commits](http-party/node-http-proxy@1.16.2...1.18.1)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump handlebars from 4.0.11 to 4.7.6 (openedx-unsupported#3143)

Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.0.11 to 4.7.6.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md)
- [Commits](handlebars-lang/handlebars.js@v4.0.11...v4.7.6)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Minor typo in BFF ADR (openedx-unsupported#3108)

Fixes typo in 0005-payment-microfrontend-support-and-bff-apis.rst

* removed deprecated elements from openedx.yaml (openedx-unsupported#3107)

* Pass base enterprise url to sailthru (openedx-unsupported#3182)

For use in an email template
base_enterprise_url is not required and has sensible defaults

* PCI-104 log processor request info (openedx-unsupported#3192)

Simple hack to stuff the CybersourceREST request into the processor response model for analysis

* Increase the default api_read_timeout to 5 seconds

* Add the flex-microform flag when redirecting back to the payment frontend on payment denied

* Redirect to the payment frontend when payment is declined in the new cybersource-rest processor

* Add a test of a CybersourceREST payment processor response

* Add another test of a different transaction decline from CybersourceREST

* Add a test of normalizing an authorized CybersourceREST processor response

* On a decline, redirect microform users to the non-microform version of the page

* ENT-3332: Adds in visibility for vouchers and API endpoint to toggle (openedx-unsupported#3188)

* Fix send_offer_assignment_email call (openedx-unsupported#3196)

base_enterprise_url was mistakenly being sent as site_code

* Revert "Fix send_offer_assignment_email call (openedx-unsupported#3196)" (openedx-unsupported#3197)

This reverts commit 3ed881a.

* Don't force users out of the microform flow when they get declined

* Fix send_offer_assignment_email call (openedx-unsupported#3198)

base_enterprise_url was mistakenly being sent as site_code
Pass in site_code as none so that base_enterprise_url is passed correctly to ecommerce worker

* Bump ecommerce-worker version number (openedx-unsupported#3199)

* Removed one-off management commands.

* Record capture contexts that aren't yet expired to better handle multiple tabs

* push is not a method on lists. Use insert.

* ENT-3479 | Added save and add more functionality in enterprise coupon creation page.

* Suppress PII from receipt page (openedx-unsupported#3205)

* Remove hotjar suppression from payment method (openedx-unsupported#3208)

* Bump ecom-worker verison (openedx-unsupported#3209)

* ENT-3484 | Added new model for template of Code assignment nudge emails.

* ...

* Update Travis tests to use mysql5.7 (openedx-unsupported#3210)

* Make upgrade (openedx-unsupported#3217)

* ENT-3589 | Added new celery task for ending the code assignment nudge emails. Adding the new ecommerce-worker version and adding new task in celery routes.

* Implement SDNFallback if SDN API is down (openedx-unsupported#3201)

REV-1538

* Updrading ecom-worker version.

* Default tests under pytest to no-migrations, and use a fixture to pre-populate the required test data

* Improve assertions about coupon categories so that they failures are move obvious

* Prevent Referral.objects.get patch from leaking out of the test

* Set selenium page timeout lower

* Prevent post_checkout.send patches from leaking

* Run acceptance tests separately

* Add a happy-path unit test of the new Cybersource REST payment flow

* Mock out network requests in AuthorizeAPI test cases

* Add a test of a duplicate payment response in CybersourceREST

* Add a test of a declined transaction

* Refactor common patterns for setting up CybersourceREST responses

* Freeze the basket before initiating payment in the CybersourceREST api

* Test that we return a 400 when a general invalid request is made

* Count coverage on CybersourceREST

* Generate the order number from the basket id when testing CybersourceREST payment flow

* Remove payment.cybersource.flex_microform_enabled references

* Revert "Remove payment.cybersource.flex_microform_enabled references" (openedx-unsupported#3228)

This reverts commit 441c363.

* ENT-3485 | Added a management command to send the code assignment nudge emails.

* Add exec ed cert type

* Updating Python Requirements (openedx-unsupported#3229)

* Revert "Revert "Remove payment.cybersource.flex_microform_enabled references" (openedx-unsupported#3228)"

This reverts commit 5731af0.

* Revert "Revert "Revert "Remove payment.cybersource.flex_microform_enabled references" (openedx-unsupported#3228)""

This reverts commit d2b387d.

* Updrading ecom-worker version. (openedx-unsupported#3234)

* Automatically reverse payments that were AUTHORIZED_PENDING_APPROVAL

* ENT-3486 | Added the subscribe functionality for code assignment nudge emails.

* ENT-3148: Create Snowflake tables for code assignment emails (openedx-unsupported#3194)

* unsubscribe users from receiving nudge emails on voucher redeem and
revoke

ENT-3487

* ecommerce-worker version bump up.

* ENT-3622 | Reverting the management command to the original code after doing the testing.

* ENT-3622 | Added templates in CodeAssignmentNudgeEmailTemplates model through data migration.

* Upgrade Ubuntu 16.04 to 20.04 (openedx-unsupported#3220)

REV-1578 Travis/Devstack upgrade

* Update Travis pip install command  (openedx-unsupported#3244)

REV-1578

* set last reminder date on sending nudge emails (openedx-unsupported#3241)

* Update BROKER_URL default value

(cherry picked from commit fc0a0ce)

* chore: upgrade Django to 2.2.18

* chore: upgrade Django to 2.2.19

* Allows setting default currency from environment (openedx-unsupported#2916)

(cherry picked from commit 5190470)

Co-authored-by: Jillian Vogel <[email protected]>
(cherry picked from commit d1c17fe)

* chore: upgrade Django to 2.2.20

* chore: upgrade Django to 2.2.21

* chore: upgrade Django to 2.2.22

* chore: upgrade Django to 2.2.23

* chore: upgrade Django to 2.2.24

* migrations fixed

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: taliaedX <[email protected]>
Co-authored-by: Jeff Chaves <[email protected]>
Co-authored-by: usamasadiq <[email protected]>
Co-authored-by: Diane Kaplan <[email protected]>
Co-authored-by: Calen Pennington <[email protected]>
Co-authored-by: Emma Green <[email protected]>
Co-authored-by: Jason Myatt <[email protected]>
Co-authored-by: JJ <[email protected]>
Co-authored-by: Gabe Mulley <[email protected]>
Co-authored-by: Matthew Piatetsky <[email protected]>
Co-authored-by: Mike OConnell <[email protected]>
Co-authored-by: Sameen Fatima <[email protected]>
Co-authored-by: Ben Holt <[email protected]>
Co-authored-by: Zaman Afzal <[email protected]>
Co-authored-by: muhammad-ammar <[email protected]>
Co-authored-by: julianajlk <[email protected]>
Co-authored-by: Hammad Ahmad Waqas <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hasnain.naveed <[email protected]>
Co-authored-by: George Babey <[email protected]>
Co-authored-by: Lael Birch <[email protected]>
Co-authored-by: Gábor Boros <[email protected]>
Co-authored-by: Jeff LaJoie <[email protected]>
Co-authored-by: Muhammad Soban Javed <[email protected]>
Co-authored-by: Awais Qureshi <[email protected]>
Co-authored-by: M. Zulqarnain <[email protected]>
Co-authored-by: Christie Rice <[email protected]>
Co-authored-by: edX requirements bot <[email protected]>
Co-authored-by: Hassan Javeed <[email protected]>
Co-authored-by: Zainab Amir <[email protected]>
Co-authored-by: Adam Blackwell <[email protected]>
Co-authored-by: Matt Tuchfarber <[email protected]>
Co-authored-by: Calen Pennington <[email protected]>
Co-authored-by: 0x29a <[email protected]>
Co-authored-by: Ned Batchelder <[email protected]>
Co-authored-by: Ned Batchelder <[email protected]>
Co-authored-by: Samuel Walladge <[email protected]>
improvements: define contants and remove whitespace
Cybersource flex microform v0.11 EDLY-6137
Anas/edly 6314: Add support for super admin in the middleware check.
Fixed sorting for actual price and price columns in subscriptions tab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants