updated transaction module to refactor controller and improve error handling in purchase complete view