Hello Jmh07748
If you were at the Lugano parking with barrier (Lugano Sud), you can pay by scanning your SwissPass Card or directly at the parking meter before going out.
Lugano station has also another parking lot (Lugano Nord), where you can buy your ticket online or via P+Rail App (also in advance).
Here you will find all information.
Regards,
Chiara_S