Your Ticket 🎫
You've just joined FinTech Co. and inherited the payment processing code.
It "works" — but every time a new payment method is added, someone breaks
existing ones. The team is afraid to touch it.
Your mission:
Refactor
PaymentProcessor so that:
1. Adding a new payment method never requires touching existing code
2. The processor doesn't depend on concrete gateway classes
3. Logging and persistence are injected, not hard-coded
The code must still handle Visa, Mastercard, and PayPal correctly.
You'll be scored on *structure*, not runtime behavior.