Factory Pattern

Use case: We want to hide the creational logic in our code from this Adapter pattern example because we don't want to repeat this step every time we want to create a payment method. It also makes it easy for us if want to modify the implementation we need to do this in one place only even though we use the payment method in various places in our app.