How does a photon mediate both electric attraction and repulsion? The answer to this question probably lies in QFT, which I know just enough about to appreciate my current lack of understanding of the subject, if you follow me.
About a year ago I asked our Professor and was told:
a. "It's a property of photons."    
b. To think in terms of inverse momentum, which sort of makes sense, provided you have the background.
So, in other words, is there an intuitive picture available to help understand the observed fact that two like electrical/magnetic charges repel and two opposite charges attract and a photon seems to "know" this and alter momentum values accordingly?
I do own a few QFT books, so if it's in page X of of say, QFT in a Nutshell, or Srednicki,  that would be a great help.
 A: For the forces between elementary particles we have Feynman diagrams, where there exists a mediating particle  for the interaction. In the simplest diagrams: for the strong it is the gluon, for the weak it is Zs and Ws and for the electromagnetic it is the photon. 
Look at these diagrams some of the tree level Feynman diagrams of   compton  scattering , photon on a proton .
The mediator of the interaction is not a gauge boson, thus electromagnetic  interactions happen even though the mediator ( the exchanged particle) is not the photon.

Here is Bhabha scattering, where the electron and the positron ( attractive force) are of low energy:

      annihilation                                  scattering

So the question should be how can there be attractive and repulsive forces. To really answer one would have to do the mathematics that the Feynman diagrams dictate and the result will tell us the the force is attractive. 
I have found useful for intuitive understanding the analogue with boats throwing balls to each other, and transferring momentum for repulsion, and boomerangs for attraction.

repulsive analogue

Momentum conservation directly for the repulsive, angular momentum conservation in the attractive. As all analogues it should not be stressed too much. Here we have a ball and a boomerang, but in the Feynman diagrams the e+e- has an extra diagram to add to the calculation, which the e-e-  or e+e+ does not have.
A: Virtual photons are not actual particles, they are just a mathematical abstraction used for perturbation expansion. 
As such, they are off-shell : their physical properties are not the same as those of real particles, and they do not have to obey classical equations. Most famously, they are off the mass shell, that is, their energy and momentum do not follow the law 
$E^2 - p^2 = m^2$
