diff --git a/apps/pay/src/routes.ts b/apps/pay/src/routes.ts index 5c8db62..4790b03 100644 --- a/apps/pay/src/routes.ts +++ b/apps/pay/src/routes.ts @@ -118,7 +118,7 @@ export const routes = new Elysia() // Build payment URI for QR code const coinInfo = COINS[coin]; - const uri = `${coinInfo.uri}:${address}?amount=${amountCrypto}`; + const uri = `${coinInfo.uri}:${address.replace(/^.*:/, '')}?amount=${amountCrypto}`; return { id: payment.id, @@ -160,7 +160,8 @@ export const routes = new Elysia() const qrAmount = amountRemaining > 0 && amountRemaining < amountCrypto ? amountRemaining.toFixed(8) : payment.amount_crypto; - const uri = `${coinInfo.uri}:${payment.address}?amount=${qrAmount}`; + const addrPart = payment.address.includes(':') ? payment.address.split(':')[1] : payment.address; + const uri = `${coinInfo.uri}:${addrPart}?amount=${qrAmount}`; const txs = await sql` SELECT txid, amount, confirmed, detected_at