code to store transaction