A new law will let checkout staff verify a customer's age through an app when buying alcohol, it has been revealed.