fix: ๐Ÿ› lnpay callback url

This commit is contained in:
apotdevin 2021-02-09 14:35:47 +01:00
parent e7b07a5e4c
commit dad078984b
No known key found for this signature in database
GPG key ID: 4403F1DFBE779457

View file

@ -127,7 +127,10 @@ export const lnUrlResolvers = {
const random8byteNonce = randomBytes(8).toString('hex');
const finalUrl = `${callback}?amount=${
// If the callback url already has an initial query '?' identifier we don't need to add it again.
const initialIdentifier = callback.indexOf('?') != -1 ? '&' : '?';
const finalUrl = `${callback}${initialIdentifier}amount=${
amount * 1000
}&nonce=${random8byteNonce}&comment=${comment}`;