Here is what I would do.
1. Give her a way to save face. No one likes to feel like a jerk, and it costs you nothing to be kind.
2. Talk to her. Say something like, "I know you don't mean to, but when you hit me it really hurts. I would prefer you not do that."
3. If you feel comfortable doing it, lie. This can be part of step 1. For example, "I grew up with an abusive brother/sister/parent/aunt, and when you hit me, even though I know it is just in fun, it brings up all those old feelings of abuse for me."
4. If she says you are too sensitive, agree. My favorite that I use all the time is, "I know, I'm delicate, like a flower." Said with a grin because I am far from delicate.
5. Reaffirm to her that you two are cool with each other and that you really like her you just freak out a bit when you are hit.
Lastly, this is the same advice I would give with a kid, a pet, or an adult... Start as you mean to go on. If something bugs you, address it immediately or nip it in the bud. You wouldn't let a pet bite you without correcting their behavior, don't let anyone else do something similar.