This commit is contained in:
Tiago vasconcelos 2021-12-01 10:23:54 +00:00
parent d89d80c245
commit 16b6ae461a
2 changed files with 4 additions and 5 deletions

View File

@ -32,7 +32,7 @@ async def lnurl_response(username: str, domain: str, request: Request):
callback=request.url_for("lnaddress.lnurl_callback", address_id=address.id),
min_sendable=1000,
max_sendable=1000000000,
metadata=await address.lnurlpay_metadata(),
metadata=await address.lnurlpay_metadata(domain=domain),
)
print("RESP", resp.dict())
return resp.dict()

View File

@ -51,10 +51,9 @@ class Addresses(BaseModel):
paid: bool
time: int
async def lnurlpay_metadata(self) -> LnurlPayMetadata:
domain = await get_domain(self.domain)
text = f"Payment to {self.username}@{domain.domain}"
identifier = f"{self.username}@{domain.domain}"
async def lnurlpay_metadata(self, domain) -> LnurlPayMetadata:
text = f"Payment to {self.username}@{domain}"
identifier = f"{self.username}@{domain}"
metadata = [["text/plain", text], ["text/identifier", identifier]]
return LnurlPayMetadata(json.dumps(metadata))