Gateways are an important part of Payments. Payment Gateways allow users to pay the site owner for things they want to purchase on their site.
When a user wants to pay for an order, the theme asks the customer to choose a method of payment. From there, the user picks one of the installed payment gateways and starts the payment process.
From there, Payments calls the installed gateway. The installed gateway is given the order to process and begins its work.
When the gateway has finished processing, it can mark the order as completed. After the order has been completed, the theme and other plugins are notified about the completed order.