def credit(self, amount, trans_id):
        txn = Transaction.find(trans_id)
        if txn.errors:
            raise GatewayError('Problem fetching transaction: %s' % txn.errors[txn.error_messages[0]['context']][0])
        else:
            # start the timer
            start = time.time()
            response = txn.reverse(amount)
            # measure time
            end = time.time() # done timing it
            response_time = '%0.2f' % (end-start)
            # return parsed response
            return self.parse(response, response_time)
dataset/ETHPy150Open abunsen/Paython/paython/gateways/samurai_ff.py/Samurai.credit/original