Anytime that you have sex- protected or not, on the pill or not, there is a chance that pregnancy could happen- all those methods are not 100%. If she did have her period on the 22nd, it's more likely that she isn't pregnant- but you can always ask her to take a pregnancy test so that you are sure.
If she is having stomach pains, make sure she is seen by a doctor soon- so many things could be the cause of something like that so it's best to get a doctor to look. Good luck!