In case there are multiple conflicting transactions (for double-spending purpose), the network will only accept the first one and reject the rest. So the micropayment processor needs to wait for a few seconds when it receives the first transaction in the mempool. If no other conflicting transactions arrive, the first transaction will be acccepted. These few seconds give the first transaction big advantage over the double-spending ones, as it will most likely be included in the block.
If the attacker sends the legit transaction and double-spending one at the same time, it will be detected due to the few seconds wait by the payment processor.