We show how to derive relativistic, unitary, gauge-invariant, and charge-conserving three-dimensional scattering equations for a system of hadrons interacting with an electromagnetic field. In the method proposed, the spectator equations describing the strong interactions of the hadrons are gauged using our recently introduced gauging of equations method. A key ingredient in our model is the on-mass-shell particle propagator. We discuss how to gauge this on-mass-shell propagator so that both the Ward-Takahashi and Ward identities are satisfied. We then demonstrate our gauging procedure by deriving the gauge-invariant three-dimensional expression for the deuteron photodisintegration amplitude within the spectator approach.