Skip to content

Remove ecommerce and Cybersource payment processing code#5447

Open
Copilot wants to merge 17 commits intomasterfrom
copilot/remove-ecommerce-cybersource-code
Open

Remove ecommerce and Cybersource payment processing code#5447
Copilot wants to merge 17 commits intomasterfrom
copilot/remove-ecommerce-cybersource-code

Conversation

Copy link
Contributor

Copilot AI commented Jan 8, 2026

Relevant Issues

Addresses issue requesting removal of discontinued payment processing code from 2021.

Summary

Payments were discontinued in 2021 when DEDP moved to mitxonline. This PR removes all ecommerce and Cybersource infrastructure while preserving database records for audit purposes.

Backend (~5,400 lines removed)

  • Deleted ecommerce/ app: models (Order, Line, Coupon), views, admin, 20 migrations
  • Removed Cybersource settings (ACCESS_KEY, SECURITY_KEY, PROFILE_ID, etc.)
  • Updated payment checks to return 0/False: get_payments_count_for_course(), get_number_of_attempts_left(), paid_but_missed_deadline()
  • Removed Order signal handlers from exams app
  • Marked payment-related management commands as obsolete

Frontend (~1,000 lines removed)

  • Deleted order_summary route, OrderSummaryPage, OrderSummary component
  • Removed checkout actions, reducers, API endpoints
  • Pay buttons now show "Payments Discontinued"

Tests

  • Skipped 12 payment-specific tests
  • Removed ecommerce imports and Order/Line factory usage

Data Preservation
No migrations included. All Order, Line, and Coupon records remain in database for historical reference.

Follow-up
Separate PR needed to remove Cybersource config from salt-ops pillar.

Original prompt

This section details on the original issue you should resolve

<issue_title>Remove ecommerce and cybersource code</issue_title>
<issue_description>### Description/Context

We stopped taking payments on micromasters.mit.edu in 2021 when we moved the DEDP program to mitxonline. We are no longer using Cybersource with this app and can now safely remove all references and code related to its use.

Plan/Design

  • remove ecommerce code
  • don't disturb the data
  • another PR should be submitted to remove all Cybersource references here</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Remove ecommerce and Cybersource code from application Remove ecommerce and Cybersource payment processing code Jan 8, 2026
Copilot AI requested a review from pdpinch January 8, 2026 21:52
@pdpinch
Copy link
Member

pdpinch commented Jan 9, 2026

Why are the tests failing?

Copilot AI and others added 3 commits January 15, 2026 15:06
Remove ecommerce backend integrations from settings, URLs, and dependent modules

Co-authored-by: pdpinch <430126+pdpinch@users.noreply.github.com>

Remove ecommerce frontend code and checkout functionality

Co-authored-by: pdpinch <430126+pdpinch@users.noreply.github.com>

Fix tests: remove or skip ecommerce-related test code

Co-authored-by: pdpinch <430126+pdpinch@users.noreply.github.com>

Fix code review issues: remove orphaned code and fix indentation

Co-authored-by: pdpinch <430126+pdpinch@users.noreply.github.com>

temp: financial aid removed

fix: issue

fix: lint issues

fix: issues

fix: lint

fix: test

fix: errors
@Anas12091101 Anas12091101 force-pushed the copilot/remove-ecommerce-cybersource-code branch from ef5030f to 71fd6d6 Compare January 15, 2026 11:20
@Anas12091101 Anas12091101 force-pushed the copilot/remove-ecommerce-cybersource-code branch from 2400510 to 84cd269 Compare January 16, 2026 16:23
@Anas12091101 Anas12091101 marked this pull request as ready for review January 16, 2026 16:26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the Selenium tests? They are not run in CI, and I also tried running them locally but they consistently failed, even on the master branch prior to the Django upgrade.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the Selenium tests?

@annagav my recollection is that the Selenium tests only ran on the courses portion of the dashboard which is now "unsupported." Is that right? Do you think we can remove them? Will it affect the remaining bits of the dashboard like the program letter?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, the Selenium tests are testing the dashboard side of things. I think we could remove them.

@annagav
Copy link
Contributor

annagav commented Jan 21, 2026

@Anas12091101 could you please add screenshots of where the removal affects the UI?

@Anas12091101
Copy link
Contributor

@annagav, this PR primarily focuses on removing the e-commerce and financial aid app code. Based on my understanding, the e-commerce UI logic is triggered when a user clicks the Enroll button on a CourseRow.

Screenshot 2026-01-22 at 8 47 50 PM

However, since we introduced a modal overlay to prevent user interaction with CourseRows in #5403, users cannot click the Enroll button unless the overlay is manually hidden via the browser’s dev tools.

Note: The Enroll button is only visible if the course run does not have a past end date.

@Anas12091101 Anas12091101 force-pushed the copilot/remove-ecommerce-cybersource-code branch from 0f149e3 to 12c77de Compare January 23, 2026 10:28
title = models.CharField(max_length=255)
live = models.BooleanField(default=False)
description = models.TextField(blank=True, null=True)
financial_aid_availability = models.BooleanField(default=False, null=False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we keep this?

Copy link
Contributor

@annagav annagav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. But I would say lets keep the financial_aid_availability on the model. Otherwise reversing this would break things.

@Anas12091101 Anas12091101 requested a review from annagav January 29, 2026 13:43
Copy link
Contributor

@annagav annagav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove ecommerce and cybersource code

5 participants