Return total paid from buyer on single auction.

def getTotalPaid(self, auction_id, buyer_id):
        """Return total paid from buyer on single auction."""
        # TODO: it has to be better way to check payments.
        date_end = long(time.time())
        date_start = date_end - 60 * 60 * 24 * 90
        rc = self.__ask__('doGetMyIncomingPayments',
                          buyerId=buyer_id,
                          itemId=auction_id,
                          transRecvDateFrom=date_start,
                          transRecvDateTo=date_end,
                          transPageLimit=25,  # notneeded | TODO: can be more than 25 payments
                          transOffset=0)
        paid = 0
        for t in (rc or []):
            # t = t['item']
            if t['payTransStatus'] == u'Zakończona' and t['payTransIncomplete'] == 0:
                if t['payTransItId'] == 0:  # wplata laczna
                    for td in t['payTransDetails']['item']:
                        if td['payTransDetailsItId'] == auction_id:
                            paid += Decimal(str(td['payTransDetailsPrice']))
                else:  # wplata pojedyncza
                    paid += Decimal(str(t['payTransAmount']))
        return paid