This isn't so much of a workplace-question as an extra-workplace question. I am a pretty junior employee - a developer, and I have joined this company only six months ago on my first ever job. Yesterday, I met a person in a restaurant who I have met with a couple of times before. Ours isn't a very big company and this person - let's call him G - was a former business partner of my bosses - the two directors of the company. So he isn't my boss, but he's someone who my bosses keep in touch with.
As I had met G before and he was sitting alone, he smiled when he saw me and I sat opposite him. We did a bit of small talk and as it seemed he'd already had something, he ordered coffee and I ordered something to eat.
We talked about my earlier experiences in the company and he offered me his views, which I liked. When I was done eating, he told the waiter to add my bill to his own. I hesitated, but when he insisted, I didn't refuse. Then I jokingly offered to pay his bill the next time we'd meet and shook hands, and he left the restaurant.
Was my course of action correct in this case? My parents said that senior people usually pay the junior person's bill when they meet in a restaurant.