fix: handle callback URLs with ?
This commit is contained in:
parent
19eaf1a4e3
commit
f77c228a02
1 changed files with 2 additions and 1 deletions
|
|
@ -73,8 +73,9 @@ class LightningService {
|
||||||
comment
|
comment
|
||||||
})
|
})
|
||||||
const zapRequest = await client.signer.signEvent(zapRequestDraft)
|
const zapRequest = await client.signer.signEvent(zapRequestDraft)
|
||||||
|
const separator = callback.includes('?') ? '&' : '?'
|
||||||
const zapRequestRes = await fetch(
|
const zapRequestRes = await fetch(
|
||||||
`${callback}?amount=${amount}&nostr=${encodeURI(JSON.stringify(zapRequest))}&lnurl=${lnurl}`
|
`${callback}${separator}amount=${amount}&nostr=${encodeURI(JSON.stringify(zapRequest))}&lnurl=${lnurl}`
|
||||||
)
|
)
|
||||||
const zapRequestResBody = await zapRequestRes.json()
|
const zapRequestResBody = await zapRequestRes.json()
|
||||||
if (zapRequestResBody.error) {
|
if (zapRequestResBody.error) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue