The short answer is you can buy votes then. If you can prove to me who you voted for, I'll give you $5 or whatever.
I know it's not foolproof as you could request a new ballot, but I'm guessing those buying votes aren't the smartest folk. Plus you'd be crazy to not accept the money upfront, as there's no way they're actually going to pay out after the fact and it's not like you can take someone to court for not upholding their end of an illegal bargain.
For example, voting machines could drop duplicate receipts into a bucket that voters are free to rummage around in.