Customer pays inn money, airline gets the money when the customer boards the airplane. If the customer does not board the airplane as scheduled, or and the plane has left, airline still gets the money. If customer does not board due to cancelation or similar event, money is refunded back to customer.
With modern payment systems (at least here in Europe), the transfers are more or less instant.