Let $X \hookrightarrow \mathbb{P}^n$ be a hypersurface of degree $d$. I am trying to prove that $\mathcal{O}_{\mathbb{P}^n}(X)=\mathcal{O}(d)$. My idea is the following: if one considers the $d$-uple embedding $$i: \mathbb{P}^n \hookrightarrow \mathbb{P}^{{n+d \choose n}-1}$$ X becomes a hyperplane section, so $\mathcal{O}(X)=\mathcal{O}(1)$ in the big projective space. Then it suffices to show that
$i^\ast \mathcal{O}(1)=\mathcal{O}_{\mathbb{P}^n}(d)$
Is that correct? Is there a more standard way to do it? Anyway, how one verifies this last point?