The concept of "mediation" depending on a photon comes from the use of Feynman diagrams. Feynman diagrams are the calculational tool of quantum electrodynamics because they give a prescription of how to calculate the integrals in each order of the pertubation series expansion for proton proton or proton electron scattering.
Lets make it simple, because the proton is a composite particle, and take the elementary electron and positron.
Electron positron scattering in first order feynman diagrams :
is given by two diagrams . These represent two integrals. The intermediate photon is virtual, i.e. it is under an integral and the value of its mass is off shell, i.e. not zero. It is a mnemonic symbol that carries the quantum numbers of the exchanged name , but not its mass.
For electron electron scattering only the gamma exchange is allowed by the quantum numbers, thus even qualitatively, it is seen that the results between like charges and unlike will be different, even in first order diagrams.
Higher order diagrams have to be summed up in order to get the functional dependence classically seen as attraction and repulsion. To see an example of the complexity of higher order diagrams please visit this link..