All Projects → ElementsProject → lightning-charge-client-php

ElementsProject / lightning-charge-client-php

Licence: other
PHP client for lightning-charge

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to lightning-charge-client-php

filebazaar
Sell digital files with Bitcoin & Lightning ⚡
Stars: ✭ 112 (+386.96%)
Mutual labels:  lightning, lightning-charge
nanopos
A simple Lightning ⚡ point-of-sale system, powered by Lightning Charge
Stars: ✭ 95 (+313.04%)
Mutual labels:  lightning, lightning-charge
lightning-jukebox
A Lightning powered Jukebox ⚡ Pay with Bitcoin to choose your music.
Stars: ✭ 29 (+26.09%)
Mutual labels:  lightning, lightning-charge
lightningtip
Get tips via the Lightning Network
Stars: ✭ 91 (+295.65%)
Mutual labels:  lightning
dmxnet
ArtNet-DMX-sender and receiver for nodejs
Stars: ✭ 43 (+86.96%)
Mutual labels:  lightning
lwc-modules
Build any LWC you want without ever having to touch Apex
Stars: ✭ 20 (-13.04%)
Mutual labels:  lightning
squeaknode
Peer-to-peer status feed 📜 with posts unlocked by Lightning ⚡
Stars: ✭ 29 (+26.09%)
Mutual labels:  lightning
sfdx-lwc-fullcalendarjs
Full Calendar JS - Lightning Web Components
Stars: ✭ 44 (+91.3%)
Mutual labels:  lightning
lwc-redux
Integrate Redux with Lightning Web Component
Stars: ✭ 35 (+52.17%)
Mutual labels:  lightning
pi-factory
Bootstrap a bitcoin lightning box for Raspberry Pi 3 based on Alpine Linux
Stars: ✭ 17 (-26.09%)
Mutual labels:  lightning
lightning-qt
bitcoin-qt for lightningd
Stars: ✭ 36 (+56.52%)
Mutual labels:  lightning
lightninggem
⚡💎 A game of speculation using bitcoin and the lightning network
Stars: ✭ 13 (-43.48%)
Mutual labels:  lightning
lnd-routing
Lightning network liquidity service
Stars: ✭ 16 (-30.43%)
Mutual labels:  lightning
EnhancedLightningGrid
Component that allows you to sort and filter data within the Lightning Experience. Use as a replacement for a Related List, or create a new grid that shows results from a custom query.
Stars: ✭ 110 (+378.26%)
Mutual labels:  lightning
lightning-browser-extension
The Bitcoin Lightning Browser extension that connects to different wallet interfaces and brings deep lightning integration to the web
Stars: ✭ 194 (+743.48%)
Mutual labels:  lightning
Last-Launcher
Lightweight: Faster than light, Low on memory
Stars: ✭ 148 (+543.48%)
Mutual labels:  lightning
LightningBuddy
Twitter Client for Lightning JSON-RPC interface
Stars: ✭ 38 (+65.22%)
Mutual labels:  lightning
shango-lightning-wallet
Shango Lightning Wallet
Stars: ✭ 65 (+182.61%)
Mutual labels:  lightning
zapread.com
Website for zapread.com
Stars: ✭ 19 (-17.39%)
Mutual labels:  lightning
lnregtest
Regtest Lightning Networks for (python) integration testing
Stars: ✭ 17 (-26.09%)
Mutual labels:  lightning

lightning-charge-client-php

PHP client for the Lightning Charge REST API.

Install

$ composer require elementsproject/lightning-charge-client-php

Use

<?php
require_once 'vendor/autoload.php';

// Initialize client
$charge = new LightningChargeClient('http://localhost:8009', '[TOKEN]');

// Create invoice
$invoice = $charge->invoice([ 'msatoshi' => 50, 'metadata' => [ 'customer' => 'Satoshi', 'products' => [ 'potato', 'chips' ] ] ]);

tell_user("to pay, send $invoice->msatoshi milli-satoshis with rhash $invoice->rhash, or copy the BOLT11 payment request: $invoice->payreq");

// Create invoice denominated in USD
$invoice = $charge->invoice([ 'currency' => 'USD', 'amount' => 0.15 ]);

// Fetch invoice by id
$invoice = $charge->fetch('m51vlVWuIKGumTLbJ1RPb');

// Fetch all invoices
$invoice = $charge->fetchAll();

// Register web hook
$charge->registerHook('m51vlVWuIKGumTLbJ1RPb', 'http://my-server.com/my-callback-url');

TODO: document wait

Test

$ CHARGE_URL=http://api-token:[TOKEN]@localhost:8009 phpunit test

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].