If a payor bank has paid an item over the stop payment order of the drawer or maker or otherwise under circumstances giving a basis for objection by the drawer or maker, to prevent unjust enrichment and only to the extent necessary to prevent loss to the bank by reason of its payment of the item, the payor bank shall be subrogated to the rights
(a) of any holder in due course on the item against the drawer or
maker; and
(b) of the payee or any other holder of the item against the
drawer or maker either on the item or under the transaction
out of which the item arose; and
(c) of the drawer or maker against the payee or any other holder
of the item with respect to the transaction out of which the
item arose.