PHPackages                             lnpay/lnpay-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. lnpay/lnpay-php

ActiveLibrary[API Development](/categories/api)

lnpay/lnpay-php
===============

LNPay PHP Client Library

v0.1(4y ago)4672MITPHPPHP &gt;=7.3

Since Jul 21Pushed 4y ago1 watchersCompare

[ Source](https://github.com/lnpay/lnpay-php)[ Packagist](https://packagist.org/packages/lnpay/lnpay-php)[ Docs](https://www.lnpay.co)[ RSS](/packages/lnpay-lnpay-php/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

lnpay-php
=========

[](#lnpay-php)

The LNPay PHP library provides convenient access to the LNPay API from PHP applications.

The Api follows the following practices:

- Namespaced under LNPayClient
- Call $api-&gt;class-&gt;function() to access the API
- API throws exceptions instead of returning errors
- Options are passed as an array instead of multiple arguments wherever possible.
- All requests and responses will be communicated over JSON

Requirements
------------

[](#requirements)

- PHP 7.3.0 or higher.
- Extensions - curl, json and mbstring

Installation via composer
-------------------------

[](#installation-via-composer)

Run in console below command to download package to your project:

```
composer require lnpay/lnpay-php

```

Installation Manually
---------------------

[](#installation-manually)

To manually install the library, you can download the latest release. Then, include the init.php file.

```
require_once('/path/to/lnpay-php/init.php');

```

Documentation
-------------

[](#documentation)

The first alpha version of this SDK is mainly a wrapper for the [LNPay API](https://docs.lnpay.co/)

Setup
-----

[](#setup)

```
// For Composer

// Load the autoload file from composer's vendor directory
require '../vendor/autoload.php';

use LNPayClient\LNPayClient;

// Creating Client object
$lnPayClient = new LNPayClient(
        'sak_KEY'
    );

```

```
// For Manual

require 'init.php';

use LNPayClient\LNPayClient;

// Creating Client object
$lnPayClient = new LNPayClient(
        'sak_KEY'
    );

```

```
// Wallet Access Key setup if not added while LNPayClient object creationation.

$lnPayClient->wallet->setWalletAccessKey('wal_KEY');

```

Usage
-----

[](#usage)

Follow the instruction given SetUp section and initialize the LNPayClient.

### Check Balance

[](#check-balance)

```
$response = $lnPayClient->wallet->getInfo();
print_r($response);

```

### Create a wallet

[](#create-a-wallet)

```
$response = $lnPayClient->wallet->create(array(
        'user_label' => 'My New Wallet'
    ));
print_r($response);

```

### Generate Invoice

[](#generate-invoice)

```
$response = $lnPayClient->wallet->createInvoice(array(
        "num_satoshis" => "2",
        "memo" => "Tester",
    ));
print_r($response);

```

### Pay Invoice

[](#pay-invoice)

```
$response = $lnPayClient->wallet->payInvoice(array(
        "payment_request" => "lnXXXX"
    ));
print_r($response);

```

### Transfers between wallets

[](#transfers-between-wallets)

```
$response = $lnPayClient->wallet->transfer(array(
        "num_satoshis" => 1,
        "memo" => "SateBack",
    ));
print_r($response);

```

### Get Wallet Transactions

[](#get-wallet-transactions)

```
$response = $lnPayClient->walletTransaction->getWalletTransactions();
print_r($response);

```

### Get Transaction Info

[](#get-transaction-info)

```
$response = $lnPayClient->lightingNetworkTx->getInfo('lntx_id');
print_r($response);

```

### Generate a disposable LNURL-withdraw link.

[](#generate-a-disposable-lnurl-withdraw-link)

```
$response = $lnPayClient->wallet->disposableLnUrlWithdraw(['num_satoshis'=> 1, 'memo'=> '1 sat over LNURL once']);
print_r($response);

```

### Generate a permanent LNURL-withdraw link.

[](#generate-a-permanent-lnurl-withdraw-link)

```
$response = $lnPayClient->wallet->permanentLnUrlWithdraw(['num_satoshis'=> 1, 'memo'=> '1 sat over LNURL again and again']);
print_r($response);

```

See the [example files](examples).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1761d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f7f1e80fceb7f978e6648ed1dd83983418347d53478a7b811a6abbf2d781ddc6?d=identicon)[tkthundr](/maintainers/tkthundr)

---

Top Contributors

[![sticktrk](https://avatars.githubusercontent.com/u/3043754?v=4)](https://github.com/sticktrk "sticktrk (6 commits)")[![bassim](https://avatars.githubusercontent.com/u/748403?v=4)](https://github.com/bassim "bassim (2 commits)")

---

Tags

apiclientpayment processingLNPay

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lnpay-lnpay-php/health.svg)

```
[![Health](https://phpackages.com/badges/lnpay-lnpay-php/health.svg)](https://phpackages.com/packages/lnpay-lnpay-php)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[crowdin/crowdin-api-client

PHP client library for Crowdin API v2

611.5M5](/packages/crowdin-crowdin-api-client)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[markrogoyski/numverify-api-client-php

Numverify API Client for PHP

1220.9k](/packages/markrogoyski-numverify-api-client-php)[azuracast/php-api-client

An API client library for the AzuraCast API

311.3k](/packages/azuracast-php-api-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
