I willWe shall give an explicit correspondence between $R(d,n)$ and $I(d,n)$ based on the explicit correspondence between the representatives $Q$ of proper equivalence classes of quadratic forms of discriminant $d$ and representatives $I$ of the narrow ideal class group of $\mathbb{Q}(\sqrt{d})$. I will be brief, but all the ingredients will be given.
We recall that to each representative quadratic form $Q$, there exists a unique representative ideal $I$ and an oriented basis $(\omega_1,\omega_2)$ of $I$ such that $$Q(r,s)=N(r\omega_1+\omega_2 s)/N(I).$$ Oriented basis means that $I=\mathbb{Z}\omega_1+\mathbb{Z}\omega_2$ and $\bar\omega_1\omega_2-\omega_1\bar\omega_2=N(I)\sqrt{d}$, where $\sqrt{d}$ is a fixed square-root of $d$ (independent of $I$). Now to each integral representation $Q(x,y)=n$, we associate the ideal $(x\omega_1+y\omega_2)/I$ of norm $n$. The range of this map is clearly $I(d,n)$. Moreover, two integral representations $Q(x,y)=n$ and $Q'(x',y')=n$ give rise to the same ideal if and only if $Q=Q'$ and $(x,y)$ only differs from $(x',y')$ by an automorph of $Q$. That is, our map induces a bijection between $R(d,n)$ and $I(d,n)$.