mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-23 22:47:05 +01:00
fix: invoice parsing JS bug from the lnurl implementation.
This commit is contained in:
parent
69063190ab
commit
8d135489ab
2 changed files with 4 additions and 5 deletions
|
@ -370,7 +370,7 @@ new Vue({
|
||||||
|
|
||||||
let invoice
|
let invoice
|
||||||
try {
|
try {
|
||||||
invoice = decode(this.parse.data.bolt11)
|
invoice = decode(this.parse.data.request)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$q.notify({
|
this.$q.notify({
|
||||||
timeout: 3000,
|
timeout: 3000,
|
||||||
|
@ -416,7 +416,7 @@ new Vue({
|
||||||
})
|
})
|
||||||
|
|
||||||
LNbits.api
|
LNbits.api
|
||||||
.payInvoice(this.g.wallet, this.parse.data.bolt11)
|
.payInvoice(this.g.wallet, this.parse.data.request)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.parse.paymentChecker = setInterval(() => {
|
this.parse.paymentChecker = setInterval(() => {
|
||||||
LNbits.api
|
LNbits.api
|
||||||
|
|
|
@ -51,7 +51,7 @@ async def api_payments():
|
||||||
"amount": {"type": "integer", "min": 1, "required": True},
|
"amount": {"type": "integer", "min": 1, "required": True},
|
||||||
"memo": {"type": "string", "empty": False, "required": True, "excludes": "description_hash"},
|
"memo": {"type": "string", "empty": False, "required": True, "excludes": "description_hash"},
|
||||||
"description_hash": {"type": "string", "empty": False, "required": True, "excludes": "memo"},
|
"description_hash": {"type": "string", "empty": False, "required": True, "excludes": "memo"},
|
||||||
"lnurl_callback": {"type": "string", "empty": False, "required": False},
|
"lnurl_callback": {"type": "string", "nullable": True, "required": False},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
async def api_payments_create_invoice():
|
async def api_payments_create_invoice():
|
||||||
|
@ -73,8 +73,7 @@ async def api_payments_create_invoice():
|
||||||
invoice = bolt11.decode(payment_request)
|
invoice = bolt11.decode(payment_request)
|
||||||
|
|
||||||
lnurl_response: Union[None, bool, str] = None
|
lnurl_response: Union[None, bool, str] = None
|
||||||
if "lnurl_callback" in g.data:
|
if g.data.get("lnurl_callback"):
|
||||||
print(g.data["lnurl_callback"])
|
|
||||||
try:
|
try:
|
||||||
r = httpx.get(g.data["lnurl_callback"], params={"pr": payment_request}, timeout=10)
|
r = httpx.get(g.data["lnurl_callback"], params={"pr": payment_request}, timeout=10)
|
||||||
if r.is_error:
|
if r.is_error:
|
||||||
|
|
Loading…
Add table
Reference in a new issue