We should think of terms of rates here, not times. And we could base the payment on the rates.
$A$ can do $1$ job in $5$ days, so $A$'s rate of work is $1/5$.
$B$ can do $1$ job in $7$ days, so $B$'s rate of work is $1/7$.
Their combined rate is $\frac15+\frac17=\frac{12}{35}$.
$B$'s fraction of that work is $(\frac17)/(\frac{12}{35})=\frac5{12}$.
Therefore, $B$ should get $\frac5{12} \cdot 108=45$ Rs.
This is the same answer as Jasper's but with more detail (and more confidence, I hope).