mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-14 06:36:46 +00:00
feat: dynamic zap endpoint from callback URL in nostrZap.js
This commit fetches the callback URL dynamically instead of using a hardcoded value. This improves the flexibility of the system as the callback URL can now be changed without needing to modify the code.
This commit is contained in:
@@ -36,7 +36,10 @@ export default (livewireComponent) => ({
|
||||
const amount = amountToPay * 1000;
|
||||
console.log('event', event);
|
||||
|
||||
const zapEndpoint = 'https://pay.einundzwanzig.space/BTC/UILNURL/pay/i/98eo2PNNWByxqMCFZR5nzW';
|
||||
// Fetch the callback URL
|
||||
const callbackResponse = await fetch('https://pay.einundzwanzig.space/BTC/UILNURL/pay/lnaddress/verein');
|
||||
const callbackData = await callbackResponse.json();
|
||||
const zapEndpoint = callbackData.callback;
|
||||
|
||||
const zapEvent = nip57.makeZapRequest({
|
||||
profile: sender,
|
||||
|
||||
Reference in New Issue
Block a user