Refactored payment controller