-
Notifications
You must be signed in to change notification settings - Fork 73
chore: remove CC_Payment_Gateway class #11195
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR removes the legacy CC_Payment_Gateway class, which was a leftover from previous checkout implementations. The class was simply extending WC_Payment_Gateway_WCPay without any additional functionality, making it redundant.
- Deletes the
CC_Payment_Gatewayclass file - Replaces all references to
CC_Payment_Gateway::GATEWAY_IDwithWC_Payment_Gateway_WCPay::GATEWAY_ID - Removes unused import statements across the codebase
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| includes/payment-methods/class-cc-payment-gateway.php | Removes the entire legacy CC_Payment_Gateway class file |
| includes/class-wc-payments.php | Removes the include statement for the deleted class file |
| includes/class-wc-payments-token-service.php | Removes unused import and updates gateway ID references from CC_Payment_Gateway::GATEWAY_ID to WC_Payment_Gateway_WCPay::GATEWAY_ID |
| includes/class-payment-information.php | Removes unused import statement |
| tests/unit/test-class-payment-information.php | Removes unused import and updates all test references from CC_Payment_Gateway::GATEWAY_ID to WC_Payment_Gateway_WCPay::GATEWAY_ID |
| changelog/chore-remove-cc-payment-gateway-class | Adds changelog entry documenting the removal of the legacy class |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
|
Size Change: 0 B Total Size: 927 kB ℹ️ View Unchanged
|
RadoslavGeorgiev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup! Tests seem alright, and the change is simple enough. Thank you for taking things forward with your simplification efforts!
Fixes WOOPMNT-5560
Changes proposed in this Pull Request
Once upon a time, there were a myriad of checkout implementations.
Now, there's just the "split UPE with deferred intent" one.
There is a leftover from #7944 - the
CC_Payment_Gateway.All of its references can be safely replaced with
WC_Payment_Gateway_WCPay, and theCC_Payment_Gatewaycan finish to exist.The class is not instantiated anywhere.
There are no external references to
CC_Payment_Gateway:Plus, it's an internal class name - it shouldn't be referenced by 3PD.
Testing instructions
npm run changelogto add a changelog file, choosepatchto leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge