Skip to content

Instantly share code, notes, and snippets.

@pavanjoshi914
Created August 31, 2022 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavanjoshi914/ab94cdca9ca68206d734b67681a3dc04 to your computer and use it in GitHub Desktop.
Save pavanjoshi914/ab94cdca9ca68206d734b67681a3dc04 to your computer and use it in GitHub Desktop.
// 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