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
(transplanted from f6a75fb9052b5a3650a4230233d4dd6d478099b5)

--HG--
extra : transplant_source : %F6%A7_%B9%05%2BZ6P%A4%23%023%D4%DDmG%80%99%B5