Purchase the ticket through a local public transportation system's app that allows purchases via credit card or PayPal, such as Rheinbahn. Since the ticket is valid all over Germany, it doesn't matter which local transportation system you purchase it from.