Hello victoria12, am just an enthusiast as well, but typically even for some cacti, they do not like being in too much direct sun, they still get burnt as what may have occurred to your plant. I would strongly suggest you just grow them indoors by your brightest window, not north facing window since light levels will be too weak on that side.
I would also think it will be a hazard for you to have that hanging cacti on your rear view mirror just in case, if an accident occurs it will be one prickly projectile that may hit you or a fellow passenger.
Also, I hope that container has drain holes, so you can water the cacti and allow the water to drain out properly.. During summer time, they are actively growing, so it will apppreciate watering too, as long as you have used well draining media, not putting any gravel or rocks at the drain holes, then it should grow okay. It will manifest better flowering though if it is grown outdoors.
If your outdoor conditions is too rainy, then indoor growing is your option but with good access to bright light. Water thoroughly but allow to dry out before next watering. Later on as the seasons change, when daylight time shortens and temperatures go much cooler, you will have to reduce or stop watering eventually till Spring returns. During winter time, most cacti will go dormant. It will like some cool dry time and later on may induce better flowering when Spring returns.