All Projects → ElementsProject → Ifpaytt

ElementsProject / Ifpaytt

Licence: mit
If Pay Then That ⚡️ Trigger IFTTT actions with Bitcoin Lightning payments

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Ifpaytt

Polar
One-click Bitcoin Lightning networks for local app development & testing
Stars: ✭ 265 (+546.34%)
Mutual labels:  bitcoin, lightning
Electrum
Electrum Bitcoin Wallet
Stars: ✭ 5,353 (+12956.1%)
Mutual labels:  bitcoin, lightning
Joule Extension
Lightning payments extension for Chrome
Stars: ✭ 303 (+639.02%)
Mutual labels:  bitcoin, lightning
Lndhub
Wrapper for Lightning Network Daemon. It provides separate accounts and trust minimization for end users
Stars: ✭ 203 (+395.12%)
Mutual labels:  bitcoin, lightning
Raspibolt
Bitcoin & Lightning full node on a Raspberry Pi
Stars: ✭ 842 (+1953.66%)
Mutual labels:  bitcoin, lightning
Spark Wallet
⚡️ A minimalistic wallet GUI for c-lightning, accessible over the web or through mobile and desktop apps.
Stars: ✭ 215 (+424.39%)
Mutual labels:  bitcoin, lightning
Lightning Charge
A simple drop-in solution for accepting lightning payments
Stars: ✭ 457 (+1014.63%)
Mutual labels:  bitcoin, lightning
Interledger Rs
An easy-to-use, high-performance Interledger implementation written in Rust
Stars: ✭ 155 (+278.05%)
Mutual labels:  bitcoin, lightning
Eclair
A scala implementation of the Lightning Network.
Stars: ✭ 892 (+2075.61%)
Mutual labels:  bitcoin, lightning
Lnd
Lightning Network Daemon ⚡️
Stars: ✭ 5,623 (+13614.63%)
Mutual labels:  bitcoin, lightning
Ln Service
Node.js interface to LND
Stars: ✭ 191 (+365.85%)
Mutual labels:  bitcoin, lightning
Lightning App
An easy-to-use cross-platform Lightning wallet
Stars: ✭ 872 (+2026.83%)
Mutual labels:  bitcoin, lightning
Lncli Web
Light-weight web client for the lnd daemon written in NodeJS / Angular.
Stars: ✭ 181 (+341.46%)
Mutual labels:  bitcoin, lightning
Eclair Mobile
An Android wallet for the Lightning Network
Stars: ✭ 231 (+463.41%)
Mutual labels:  bitcoin, lightning
Zeus
A mobile Bitcoin/Lightning app for lnd, c-lightning, and Eclair node operators ⚡️
Stars: ✭ 175 (+326.83%)
Mutual labels:  bitcoin, lightning
Thunder
Off-Chain Bitcoin payments using smart contracts
Stars: ✭ 444 (+982.93%)
Mutual labels:  bitcoin, lightning
Paypercall
Charge for HTTP APIs on a pay-per-call basis with Bitcoin and Lightning ⚡️
Stars: ✭ 131 (+219.51%)
Mutual labels:  bitcoin, lightning
Umbrel Os
Run Umbrel Bitcoin and Lightning node on a Raspberry Pi in one click
Stars: ✭ 132 (+221.95%)
Mutual labels:  bitcoin, lightning
Umbrel
A personal Bitcoin and Lightning node designed for everyone
Stars: ✭ 508 (+1139.02%)
Mutual labels:  bitcoin, lightning
Lightninglib
lightninglib is a fork of lnd which aims to be usable as a go library inside any application, including mobile apps.
Stars: ✭ 11 (-73.17%)
Mutual labels:  bitcoin, lightning

If Pay Then That

npm release MIT license Pull Requests Welcome IRC

Use Bitcoin Lightning payments as the trigger for IFTTT (If This Then That) actions.

Powered by ⚡️ Lightning Charge and paypercall.

Install

$ npm install -g ifpaytt

Setup

Setup Lightning Charge, then:

  1. Get your IFTTT maker key from IFTTT's Webhook settings page (shown as https://maker.ifttt.com/use/[MAKER-KEY-HERE]).

  2. Open the new applet page, click "this", enter "Webhooks", click "Receive a web request", enter a descriptive event name prefixed by ifpaytt_ containing only numbers, lowercase letters and _ (e.g. ifpaytt_lightup_room404 or ifpaytt_vend_machine137_item56), and click "Create Trigger".

  3. Configure your "then" action and finish creating the IFTTT applet.

  4. Start the ifpaytt server:

    $ ifpaytt --charge-token [mySecretToken] --ifttt-key [myMakerKey] --currency BTC \
              --price-lightup_room404 0.00001 --price-vend_machine137_item56 0.000063
    
    Running on http://localhost:6000
    

That's it! The server is now ready to accept payments and trigger IFTTT actions.

Paying to trigger actions

Users can access the IFTTT action through a three-part process:

  1. Send an empty POST request to /{event-name} to get the BOLT11 payment request and the X-Token header:

    $ curl -i -X POST http://localhost:6000/lightup_room404
    
    HTTP/1.1 402 Payment Required
    X-Token: lmbdmJeoSQ0ZCB5egtnph.af1eupleFBVuhN2vrbRuDLTlsnnUPYRzDWdL5HtWykY
    Content-Type: application/vnd.lightning.bolt11
    
    lnbcrt8925560p1pdfh7n2pp54g5avyupe70l988h30u0hy8agpj2z7qsveu7ejhys97j98rgez0...
    
  2. Make the payment:

    $ lightning-cli pay lnbcrt8925560p1pdfh7n2pp54g5avyupe70l988h30u0hy8agpj2z7qsveu7ejhys97j98rgez0...
    
  3. Send the request again, this time with the X-Token header echoed back and optionally with value1, value2 and value3 in the request body (passed along to IFTTT):

    $ curl -i -X POST http://localhost:6000/lightup_room404 \
      -H 'X-Token: lmbdmJeoSQ0ZCB5egtnph.af1eupleFBVuhN2vrbRuDLTlsnnUPYRzDWdL5HtWykY' \
      -d value1='brightness=80,color=red'
    
    HTTP/1.1 200 OK
    Content-Type: text/plain
    
    Congratulations! You've fired the ifpaytt_lightup_room404 event
    

    (if value[1-3] are not set, they'll automatically be populated with some useful information about the payment.)

CLI options

$ ifpaytt --help

  Trigger IFTTT actions with Bitcoin Lightning payments

  Usage
    $ ifpaytt [options]

  Options
    -c, --charge-url <url>      lightning charge server url [default: http://localhost:9112]
    -t, --charge-token <token>  lightning charge access token [required]
    -k, --ifttt-key <key>       IFTTT maker key (available in https://ifttt.com/services/maker_webhooks/settings) [required]
    -r, --ifttt-prefix <prefix> prefix for IFTTT event names [default: ifpaytt_]

    -x, --currency <name>       the currency prices are quoted in [default: BTC]
    --price-{event} <price>     price to send events of type {event}

    -d, --db-path <path>        path to store payperclick sqlite database [default: ifpaytt.db]
    --invoice-expiry <sec>      how long should invoices be payable for [default: 1 hour]
    --access-expiry <sec>       how long should paid active tokens remain valid for [default: 1 hour]
    --token-secret <secret>     secret used for HMAC tokens [default: generated based on {charge-token}]

    -p, --port <port>           http server port [default: 6000]
    -i, --host <host>           http server listen address [default: 127.0.0.1]
    -e, --node-env <env>        nodejs environment mode [default: production]
    -h, --help                  output usage information
    -v, --version               output version number

  Example
    $ ifpaytt -t chargeAccessToken -k iftttMakerKey -x BTC \
              --price-lightup_room404 0.00001 --price-vend_machine137_item56 0.00023

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].