Adapter: taking payments

Wrap a foreign interface in one class that speaks the interface your code expects.

Level Intermediate

What you will see

  1. A payment SDK that speaks its own language
  2. The SDK, everywhere
  3. The interface the shop wants
  4. The adapter translates
  5. Translating failures
  6. When not to use it

Before / after

Base: adapter-base-tsView the diff

Exercises