OOP and Design Patterns · Real-world situation · Beginner
Growing if-else for payment methods
Your checkout code has a growing if-else chain for card, PayPal, Apple Pay and bank transfer, and each new method means editing it. How do you improve it?
2:00