Make a copy of the payment iterators

We copy the iterators created by groupby in order to prevent consumption of the
underlying iterator.

issue3660
review3321002