Mr Beattie stepped down on Tuesday after he was arrested and released without charge pending further investigation into the party’s finances.
Mr McDonald, MP for Cumbernauld, Kilsyth and Kirkintilloch East, is a former lawyer. Before boundary changes, his constituency was part of Dunbartonshire.
He was selected by the party’s national executive committee on Saturday morning in line with the party’s constitution and will remain in the post until the SNP annual conference.

Mr McDonald acknowledged it was a “difficult and challenging time” amid the police investigation into how more than £600,000 of party donations earmarked for independence campaigning was spent.
He said: “Whilst it is a difficult and challenging time, I look forward to getting on with the job of national treasurer to help take forward the important work being led by our new party leader, Humza Yousaf, to improve the SNP’s governance and transparency.
“I’ve no hesitation in stepping forward when asked to do my part in keeping our party firmly on a campaign footing as the case for Scottish independence becomes more compelling than ever.”
SNP Business Convener Kirsten Oswald MP said: “I’m very glad members of the NEC were able to meet so quickly to agree the appointment of a new registered Treasurer and give reassurance to SNP members that the activities of the Party continue unabated.
“Stuart is an excellent person for us to have stepping into the role until our next SNP annual conference – he is a widely respected, well thought of individual whose background undoubtedly gives a solid understanding of the responsibilities required.”
However, Scottish Labour Deputy Leader Jackie Baillie said: “Stuart McDonald faces an uphill battle dealing with an SNP high command that clearly don’t think the rules apply to them.