Simple answer, the money belongs to the airline when you fly. But getting 'paid' is a process that's more complicated than outward appearance.
Not considering any of the many potential commercial variations, the above example would go like this:
- Passenger books with and pays Expedia.
- Expedia pays Delta, the ticketing carrier, who then pays Expedia their commission. But Delta doesn't count the money yet, it's set aside.
- After you fly to AMS, Delta pays KLM for flying you there.
- When you fly back from AMS, Delta pays itself for flying you back.
In the above example, there are at least 3/4 different payments processed at different stages of the journey.
- The airline gets the money when you pay the fare.
- The airline gets the revenue when you fly.
The airline does not get paid when the passenger checks in. A significant reason is there is still no guarantee the passenger will actually fly. So, the service is not rendered. Check in is a mostly an operational process, not financial.
Also keep in mind, even after check in, you can get bumped, reaccommodated, the flight cancelled, etc.
There's a whole settlement process that takes place post flight where tickets and payments are sorted out. Only then is the airline fully paid for the service.
Also keep in mind, there's a difference, accounting wise, between getting paid, having the money and recording the revenue. So, when you buy the ticket, the airline gets the money in house so they've been 'paid' but the money isn't really theirs yet until the service is performed, meaning the flight or whatever else you bought.