OK, so you have some options. Probably best to replace the shaft. If part of it got damaged then there could be other areas that might develop issues also. Best for safety.
Measure the collapsed length of the whole shaft. That is the minimum you need in a new shaft but also make sure the extended length of the new one is enough. You want about on third of the tube length or more to be overlap when the shaft is installed. Longer is ok because you cut to length. Make sure the shaft has the correct ends and is rated for the horsepower of the tractor. If you search a bunch on Amazon you can find one that will work for a reasonable cost.
Getting the half shaft may be somewhat costly and then you'll have to swap out the end onto the new shaft.