وَلَقَدۡ صَدَقَكُمُ ٱللَّهُ وَعۡدَهُۥٓ إِذۡ تَحُسُّونَهُم بِإِذۡنِهِۦۖ حَتَّىٰٓ إِذَا فَشِلۡتُمۡ وَتَنَٰزَعۡتُمۡ فِي ٱلۡأَمۡرِ وَعَصَيۡتُم مِّنۢ بَعۡدِ مَآ أَرَىٰكُم مَّا تُحِبُّونَۚ مِنكُم مَّن يُرِيدُ ٱلدُّنۡيَا وَمِنكُم مَّن يُرِيدُ ٱلۡأٓخِرَةَۚ ثُمَّ صَرَفَكُمۡ عَنۡهُمۡ لِيَبۡتَلِيَكُمۡۖ وَلَقَدۡ عَفَا عَنكُمۡۗ وَٱللَّهُ ذُو فَضۡلٍ عَلَى ٱلۡمُؤۡمِنِينَ ١٥٢
Allah did indeed fulfil His promise to you when ye with His permission Were about to annihilate your enemy,-until ye flinched and fell to disputing about the order, and disobeyed it after He brought you in sight (of the booty) which ye covet. Among you are some that hanker after this world and some that desire the Hereafter. Then did He divert you from your foes in order to test you but He forgave you: For Allah is full of grace to those who believe.
walaqad sadaqakumu allaahu wa‘dahu ’iz tahussuunahum bi’iznihi hattaa ’izaa fasyiltum watanaaza‘tum fii al’amri wa‘asaytum min ba‘di maa ’araakum maa tuhibbuuna minkum man yuriidu addun-yaa waminkum man yuriidu al’aakhirata summa sarafakum ‘anhum liyabtaliyakum walaqad ‘afaa ‘ankum wallaahu zuu fadlin ‘alaa almu’miniina
God is with them as they are with Him; and lest they sleep on their states without [seeking to acquire] the natural dispositions and so that they might be trained [spiritually] to be patient in adversity and to remain firm in the abodes [of their spiritual stations] and to become fixed in certainty making this a natural disposition of theirs and a station, and that they might verify [the truth of] that God does not alter the state of a people unless they have altered the state of their souls [Q. 13:11], and so that they might not incline to this world and its adornments or be distracted from the Truth or sell it in exchange for this world and the Hereafter; and so that it might be a punishment hastened for some of them now in order for them to be purged of their sins and to attain the degree of witnessing by the removal of the veils, especially the veil of the love of one's soul, and so that they might then encounter God as pure ones. That is why He says yet now He has pardoned you [Q. 3:152], for the trial was the cause of the pardon.