Dexter Sharpe pleaded guilty to possession with intent to supply class A drugs and possession of cannabis.
He was detained after he was caught smoking a joint outside Clapham Junction station in July 2022.
He was found to be carrying a mobile phone, more than £2,000 in cash and 25 wraps of more than £500 of heroin in his backpack.