Created
August 31, 2022 10:01
-
-
Save pavanjoshi914/ab94cdca9ca68206d734b67681a3dc04 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// after actions on client side | |
webln.sendPayment(invoice, metadata) | |
.then(function (r) { | |
// Required constraint to protect metadata as a rule while paying empty invoices | |
if (r != undefined) { | |
// Provide metadata after successful payment | |
// Eg. Allow users to download a song after payment is successful | |
} | |
}) | |
.catch(function (e) { | |
alert("Failed: " + e.message); | |
console.log('err pay:', e); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment