finish webhooks for normal invoices with two extra columns.

This commit is contained in:
fiatjaf
2020-12-24 09:39:46 -03:00
committed by fiatjaf
parent 4623220316
commit 1c922a5ddc
9 changed files with 92 additions and 42 deletions
+5 -5
View File
@@ -40,11 +40,7 @@ class Wallet(NamedTuple):
hashing_key = hashlib.sha256(self.id.encode("utf-8")).digest()
linking_key = hmac.digest(hashing_key, domain.encode("utf-8"), "sha256")
return SigningKey.from_string(
linking_key,
curve=SECP256k1,
hashfunc=hashlib.sha256,
)
return SigningKey.from_string(linking_key, curve=SECP256k1, hashfunc=hashlib.sha256,)
async def get_payment(self, payment_hash: str) -> Optional["Payment"]:
from .crud import get_wallet_payment
@@ -84,6 +80,8 @@ class Payment(NamedTuple):
payment_hash: str
extra: Dict
wallet_id: str
webhook: str
webhook_status: int
@classmethod
def from_row(cls, row: Row):
@@ -99,6 +97,8 @@ class Payment(NamedTuple):
memo=row["memo"],
time=row["time"],
wallet_id=row["wallet"],
webhook=row["webhook"],
webhook_status=row["webhook_status"],
)
@property