عن عائشة رضي الله عنها : "أن حَمْزَةَ بن عَمْرٍو الأَسْلَمِيَّ قال للنبي صلى الله عليه وسلم : أصوم في السفر؟ - وكان كثير الصيام- فقال: "إن شئتَ فصُم، وإن شئت فَأَفْطِرْ". [صحيح] - [متفق عليه] المزيــد ...
‘Ā'ishah (may Allah be pleased with her) reported: Hamzah ibn ‘Amr al-Aslami asked the Prophet (may Allah's peace and blessings be upon him): "Should I fast while traveling?" - and he used to fast often - He answered:"If you wish then fast, and if you wish then do not fast." Sahih/Authentic. - [Al-Bukhari and Muslim]
‘Ā'ishah (may Allah be pleased with her) reported that Hamzah ibn ‘Amr al-Aslami (may Allah be pleased with him) asked the Prophet (may Allah's peace and blessings be upon him) if he should fast while traveling, so the Prophet gave him the choice to either fast or not, saying:"If you wish then fast, and if you wish then do not fast."
What is intended here is the obligatory fasting, based on the Prophet's statement in another Hadīth:"It is a concession granted by Allah." It is implied here that Hamzah was asking about the obligatory fasting, and the proof for this is the narration in Abu Dawūd in which Hamzah said:"O Messenger of Allah, I own some riding animals and I use them. I myself travel on them and I rent them out. It is possible that this month (meaning Ramadan) comes (while I am traveling) and I find myself strong enough (to fast)."
There is also a possibility that Hamzah was asking about fasting in general, the obligatory and the voluntary, as ‘Ā’ishah said:"And he used to fast often."
Hence, it becomes clear that not fasting while traveling is a concession from Allah, so whoever takes advantage of the concession is correct and whoever chooses to fast, then this is also permissible, and his fasting fulfills the obligatory fast.