You can also buy an e-ticket or mobile ticket on
http://www.ns.nl/ or the app, and use a credit card to pay for it ahead of time. That way there's no delay when you get to the station.
Additionally, if you're arriving into Schiphol and are likely to use the trams etc while in the city, you can buy a public transport pass that cover the return journey to the city, plus unlimited use of public transport within the city for the duration of your stay.