A similar can be implemented with this, too.
Basically, when you want to buy something, instead of sending bitcoin manually, the marketplace generates a payment request for you, with two outputs — merchant (the good price) & marketplace (the fee) + some unique ID in the comment field so that the service can link your payment to the order. It can be a QR code or bitcoin:// link or something.