The sin of Onan is no better as says Wesley, Luther, Calvin, etc...
Any Catholic who cites the example of Onan as an authoritative statement re contraception should do a study on the "kinsman redeemer" laws in the Old Testament (cf. Deut. 25:5-6). Onan wasn't guilty for ejaculating outside of a woman, he was guilty of willfully trying to utterly disinherit his brother's family from Israel (IIRC the entire Tribe of Judah, as Onan had no children of his own). Any other reading of the text is, IMO, a false exegesis.
"Then Judah said to Onan, "Go in to your brother's wife, and perform your duty as a brother-in-law to her, and raise up offspring for your brother. Onan knew that the offspring would not be his; so when he went in to his brother's wife, he wasted his seed on the ground in order not to give offspring to his brother." (Genesis 38:8-9)If brethren dwell together, and one of them die, and have no child, the wife of the dead shall not marry without unto a stranger: her husband's brother shall go in unto her, and take her to him to wife, and perform the duty of an husband's brother unto her. And it shall be, that the firstborn which she beareth shall succeed in the name of his brother which is dead, that his name be not put out of Israel (Deut. 25:5-6).