How does the tax work?

I am interested in the question of how the booking tax is paid. That is, I have a price and I pay it to the guest, and from that I pay a commission. Or the guest pays a commission and I get my value for the object?


Price- discount, * number of nights, + tax, 

Then minus commission


I believe