That's right out post-Pinner.
I think a veteran cop would write the ticket, hand back the license, tell Mikey McMotorist, you are free to leave, hey, by the way, do you have a license for the pistol? Thus converting detention into consensual encounter.
Have a nice day officer, OH, am I being detained?