All perfect praise be to Allah, The Lord of the Worlds. I testify that none is worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and messenger.
Riba is one of the gravest major sins and most heinous crimes in all times and all ages. Shaving the beard is also something prohibited. There is no doubt that committing any sin, whether major or minor, contradicts and goes against the noble objectives of fasting. Allah, The Almighty, stated that the wisdom sought from enjoining fasting it is to attain taqwa (piety and righteousness). This is explained through his statement (which means): {O you who have believed, decreed upon you is fasting as it was decreed upon those before you that you may become righteous.} [Quran 2: 183]
Complete fasting cannot be achieved except by the one who fears Allah Almighty most, obeys his commands and avoids his prohibitions. As for the one who deals in riba during Ramadan or commits a sin such as shaving the beard or telling lies or the like, his fasting is really incomplete; rather, he may get nothing from it except hunger and thirst. It was narrated on the authority of Abu Hurayrah, may Allaah be pleased with him, that the Messenger of Allah, sallallaahu ‘alayhi wa sallam, said: “A fasting person’s share of the fast may be nothing but hunger and thirst.” [Ahmad and others]
In spite of this, the fasting in such a case is valid and the person is not obliged to make up for it.
Allah Knows best.