It is forbidden to take payment for the delivery of testimony, for all mitzvot must be performed for free, and one who takes payment to testify, his testimony is void. If he returned the money, his testimony is valid, for this is not like other disqualifications that require a proclamation and repentance; rather, it is merely a penalty that the sages penalized him, that his testimony be voided when he took payment. Therefore, when he returned it, his testimony became fit. All this is specifically when he took from both parties, but when he took from one party, he is disqualified due to being an interested party, and even if he returned the money after he testified, he is disqualified [Netivot HaMishpat], since he was an interested party at the time of the delivery of the testimony. And that he should testify a second time after his return of the money is of no avail, for it is impossible for him to retract after he has testified once. And this entire prohibition is only regarding a witness who saw the act and is obligated to testify, for then it is forbidden for him to take payment for his delivery in beit din. But when he takes payment to go and see the matter, it is permitted, for he is not obligated to see the matter, and he takes payment for his exertion to go see the act and to be a witness afterward, like the witnesses of a get who take their payment to stand during the writing of the get and to be witnesses. And even this is not permitted except when he takes from both parties equally, or that the litigants agreed between them who would pay the fee for their exertion, like in a get where the man and his wife arrange between them who will pay the fee for the get, for in this it is as if he takes from both of them. But from one party, even this is forbidden for him to be a witness, unless he takes payment for idleness that is evident, such as where he is idled from his craft and his livelihood [ibid.]. And the general rule of those disqualified by transgression: when he committed a rabbinic transgression, he is disqualified rabbinically, and a Torah transgression, he is disqualified from the Torah. And according to the opinion of the Rambam, the Tur, and the Shulchan Aruch, specifically for a transgression that carries a liability of lashes; but in a matter of money, we do not require lashes. Therefore, a lender with fixed interest is disqualified from the Torah. And we have already written in section 2 that according to Rashi and Tosafot, it is possible that we do not specifically require lashes [and so it appears from the Gra, subsection 2]. However, since in money we do not require this condition, it can be said that in other matters they agree with the Rambam, as I wrote there; however, regarding interest they disagree, since he gave it of his own will, as I wrote there.
אסור ליטול שכר בעד הגדת עדות דכל המצות צריכים לעשות בחנם והנוטל שכר להעיד עדותו בטלה ואם החזיר הממון עדותו קיימת שאין זה כשארי פסולים שצריכין הכרזה ותשובה אלא קנסא בעלמא הוא שקנסוהו חכמים שיתבטל עדותו כשנטל שכר ולכן כשהחזיר נתכשרה עדותו וכל זה הוא דווקא כשנטל משני הצדדים אבל כשנטל מצד אחד פסול מטעם נוגע ואפילו החזיר הממון אחר שהעיד פסול [נה"מ] כיון שהיה נוגע בדבר בשעת הגדת העדות ושיגיד פעם שני אחר חזרתו אינו מועיל דא"א לו לחזור בו אחר שהגיד פעם אחת וכל איסור זה אינו אלא בעד שראה המעשה ומחוייב להעיד דאז אסור לו ליטול שכר בעד הגדתו בב"ד אבל כשנוטל שכר לילך ולראות הענין מותר דהא אינו מחוייב לראות הענין ונוטל שכר טרחתו שילך לראות המעשה ולהיות עד אח"כ כמו עידי הגט שנוטלין שכרן שיעמדו בכתיבת הגט ושיהיו עדים וגם זה אינו מותר רק כשנוטל משני הצדדים בשוה או שהבע"ד השוו ביניהם מי יתן שכר טרחתם כמו בגט שהאיש ואשתו עושים ביניהם מי יתן שכר הגט דבזה הוי כנוטל משניהם אבל מצד אחד גם זה אסור לו להיות עד אם לא שנוטל שכר בטילה דמוכח כגון שמתבטל ממלאכתו ומפרנסתו [שם] וכללא דפסולים בעבירה כשעבר עבירה דרבנן פסול מדרבנן ודאורייתא פסול מן התורה ולדעת הרמב"ם והטור והש"ע דווקא בעבירה שיש בה חיוב מלקות ובדבר שבממון לא בעינן מלקות ולכן מלוה בריבית קצוצה פסול מן התורה וכבר כתבנו בסעי' ב' דלרש"י ותוס' אפשר דלא בעינן דווקא מלקות [וכ"מ מהגר"א ס"ק ב'] אמנם כיון דבממון לא בעינן תנאי זה י"ל דבשארי דברים מודים להרמב"ם וכמ"ש שם אמנם בריבית חולקים כיון דמרצונו נתן כמ"ש שם: