How does an online payment gateway work? Diagram