moved payment logic (TODO: remove unusued imports)