app/controllers/spree/api/retailops/settlement_controller.rb
# avoid infinite loops and only process a given payment once
avoid infinite loops and only process a given payment once
avoid infinite loops and only process a given payment once
def pick_payment(&blk)
            @payments_available ||= @order.payments.to_a
            chosen = @payments_available.detect(&blk)
            @payments_available.delete(chosen) if chosen
            chosen
          end
def pick_payment ( & blk ) @payments_available ||= @order . payments . to_a chosen = @payments_available . detect ( & blk ) @payments_available . delete ( chosen ) if chosen chosen end
avoid infinite loops and only process a given payment once
avoid infinite loops and only process a given payment once
blk
<not_specific>