def METHOD_NAME(self, invoice):
    m = self._re_paypal.match(invoice.paymentdetails)
    if m:
        try:
            return (TransactionInfo.objects.get(paypaltransid=m.groups(1)[0]), None)
        except TransactionInfo.DoesNotExist:
            return (None, "not found")
    else:
        return (None, "unknown format")