beginnerDesign Patterns~55 min
Unified Payments (Adapter Pattern)
Two payment gateways, two incompatible SDKs, one checkout button. The Adapter pattern wraps each mismatched provider API in a common interface so the rest of your system never has to care which gateway it is talking to. Build a Stripe adapter and a PayPal adapter behind a single charge() contract, write a client that works with either, map declines to a uniform result, and finish with a factory that hands you the right adapter by name.