Open-Closed Principle (OCP)
Open for extension closed for modification.
To fix above code, we can do something like this
Now when we have change-request in requirements to add paypal method, all we have to do is adding another paypal class implements same PaymentInterface and thats it, so we extended(open for extension) our application with paypal but we didn’t modify(closed for modification) any of previous code.