npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-btcpay

v0.2.3

Published

Node-RED nodes to talk to BTCPay Server

Downloads

87

Readme

BTCPay Nodes

Node-RED nodes to interact with BTCPay Server.

Install

Run the following command in the root directory of your Node-RED instance:

npm install --save node-red-contrib-btcpay

Usage

This set provides 2 nodes:

  • btcpay-api - a BTCPay API client node. It makes API requests by sending msg.payload data to the specified API endpoint and outputs the response data as msg.payload.
  • btcpay-ipn - a BTCPay IPN listener node. It listens to BTCPay Instant Payment Notifications and outputs the invoice object as the msg.payload.

Configuration

You first need to create a new BTCPay store:

  1. Log in to your BTCPay Server instance
  2. Go to Stores menu
  3. Click on Create a new store
  4. Enter a name
  5. Push Create

Now you need to pair the client with your BTCPay store:

  1. Navigate to Stores > Settings > Access Tokens on your BTCPay Server
  2. Create a new token
  3. Leave PublicKey blank
  4. Request pairing
  5. Copy pairing code
  6. Open your Node-RED instance
  7. Drag & drop the btcpay api node from the palette to the workspace and double-click on it, to open the node editor
  8. In the Client dropdown menu pick the Add New btcpay-api-config option and press the pencil button at the right to add a new API configuration
  9. Enter the https URL to your BTCPay Server instance
  10. Paste the pairing code you copied on step 5
  11. Click the Pair client button - the private key and token fields will be automatically filled with your api credentials
  12. Push Update

Making API requests

To make requests using the btcpay-api node, set the http method and the url path to the API endpoint the node will call. These can be either specified in the node settings, or provided in msg.method (if the method is "via msg.method") and in msg.path (if the path is empty). The request body is the data in msg.payload.

After executing a request the node returns a message with the response data set to msg.payload.

Handling Instant Payment Notifications (IPN)

To receive Instant Payment Notifications with the btcpay-ipn node, set the url path the IPN listener will listen to notifications on.

When BTCPay Server sends a notification to the IPN listener url, it will trigger the node output with the invoice object set to msg.payload. Note: as the incoming data cannot be trusted, the node fetches the invoice data via API before the output.

Examples

Creating Invoices

This example enables to create an invoice with params specified in the "Invoice params" node by clicking the inject button. The "Invoice URL" node outputs the url of the new invoice to Debug window.

BTCPay Invoice Creator

Flow json for Node-RED: btcpay-invoice-creator.json

Handling Instant Payment Notifications (IPN)

This example implements a simple IPN handler which outputs the data of confirmed and complete invoices to Debug window.

BTCPay IPN Handler

Flow json for Node-RED: btcpay-ipn-handler.json

More Examples

More ready-made flows are available here.

API Reference

BTCPay implements the same API as Bitpay for creating and managing invoices. The API Reference: https://bitpay.com/api/#rest-api-resources

Backers 💝

Red BTC Backer Red BTC Backer Red BTC Backer Red BTC Backer Red BTC Backer Red BTC Backer Red BTC Backer Red BTC Backer Red BTC Backer Red BTC Backer

[Donate] Thank you for your support! 🙌

Developing Node

Build & Test in Watch mode:

yarn dev

Testing Node Set in Node-RED

Read Node-RED docs on how to install the dev-version of the node into your local Node-RED runtime.

License

MIT © Alex Kaul