Skip to content

A demo integrating the OpenNode API to enable generation/storage of a bitcoin invoice and listening for webhooks to confirm when payment has been made.

Notifications You must be signed in to change notification settings

infomanc3r/OpenNode-Bitcoin-Payment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenNode Bitcoin Payment Demo

A demo integrating the OpenNode API to enable generation/storage of an OpenNode bitcoin invoice.

The order is managed in a persistent local database using Spring Hibernate. The backend API listens for webhooks fired by OpenNode whenever the invoice is fulfilled. If the invoice is successfully paid, the frontend will notify you by redirecting to a "download" page and blasting confetti! 🎊🥳🎉

Setup

  1. Currently runs on OpenNode's developer network, using testnet bitcoin - you will need to add your OpenNode API key for the real network on line 19 of the "Charge.jsx" file.

  2. In this demo I used ngrok to forward webhooks to the backend API locally without actually requiring webhosting. You will need to update the callback_url parameter on line 13 of "Charge.jsx" to take advantage of webhooks and update your frontend when the invoice is successfully paid. Set this parameter to the URL that points to the /webhooks/update API endpoint in your setup.

About

A demo integrating the OpenNode API to enable generation/storage of a bitcoin invoice and listening for webhooks to confirm when payment has been made.

Topics

Resources

Stars

Watchers

Forks