O you who have believed, be persistently standing firm in justice, witnesses for Allāh, even if it be against yourselves or parents and relatives. Whether one is rich or poor, Allāh is more worthy of both.1 So follow not [personal] inclination, lest you not be just. And if you distort [your testimony] or refuse [to give it], then indeed Allāh is ever, of what you do, Aware.
Translation: Saheeh International (English)
1 i.e., more knowledgeable of their best interests. Therefore, adhere to what He has enjoined upon you and testify honestly.
O you who have faith in Allah and follow His Messenger, uphold justice in all conditions: testifying to the truth with respect to every person, even if that means you have to admit a right due on you, your parents or your relatives. A person’s being poor or rich should not make you give or avoid giving testimony, because Allah is closer to the poor or rich person than you are; and He knows what is in their best interests. Do not be led by your desires in your testimony, so that you do not deviate from the truth in it. If you distort the testimony by giving it inaccurately or if you turn away from fulfilling it, then Allah knows what you do.