بسم الله الرحمن الرحيم
(Fatwa: 894/726/D=11/1437)
In the question mentioned above since the semen was discharged in the state of fasting hence your fast broke. Only its qaza is wajib, not kaffarah.
أو استمنيی بكفه فأنزل – قضی (الدر المختار مع الشامى 3/379 زكريا).
Allah knows Best!
Darul Ifta,
Darul Uloom Deoband
