refactored checkout url generation