Design Patterns · Middle · Question 54 of 75
Why wrap an external payment SDK in your own Gateway?
- ✓Correct answer: To isolate its API behind your interface, simplify testing with fakes and limit changes when switching providers
- 2To make the SDK faster
- 3Because SDKs can't be imported directly
Explanation
The rest of the app talks in your domain terms (charge(order)), not the vendor's types and quirks.