The if didn't vanish: it moved to the edge
transcript
You replaced an if on payment names with small classes. So where did the if go? It's still there.
Before, the if sat in the middle of the price calculation. It ran for every order, and every new method edited it.
After, one lookup turns a name from outside into a payment method. The price calculation just calls it. It never asks which one.
A wallet is one new class and one line in the table. Zero existing classes are edited. Say that out loud, and say where the one line lands.
That one place reads a name from config or the user's account. It looks the name up in a table. An unknown name is an error, not zero. Then it hands back an object, and the price calculation never sees the name.
In an interview, don't say the if disappeared. Say it moved to one place at the edge. That's the honest answer.
Full breakdown in the lecture.