Switch statement - if transaction succeeds/fails