tikiwiki / ilp-client
The PHP client library for Interledger. Integrates with ILP SPSP Invoice Server allowing to create and get invoices.
1.0.1
2024-02-22 23:56 UTC
Requires
- ext-json: *
- symfony/http-client: ^3.0 || ^4.0 || ^5.0 || ^6.0
- symfony/property-access: ^3.0 || ^4.0 || ^5.0 || ^6.0
Requires (Dev)
- phpunit/phpunit: ^9.5
- symfony/process: ^5.3
This package is not auto-updated.
Last update: 2024-11-15 03:29:56 UTC
README
The ILP module includes:
- Support integration with ILP SPSP Invoice Server that allows to create and get invoices.
Setup development environment
Start ILP invoice server and Moneyd
cd test
docker-compose up -d
Run Tests
composer install --dev
vendor/bin/phpunit --configuration phpunit.xml
How to use
To learn more about ILP SPSP Invoice Server click here.
Create Invoice
$client = new ILPInvoiceServerClient('http://localhost:6000', 'test', false);
$amount = "900";
$assetCode = "XRP";
$assetScale = "9";
$webhook = "https://my.webhook.test"; # URL to be called after a successful payment
$response = $client->createInvoice($amount, $assetCode, $assetScale, $webhook, ["reason" => "more stuff"]);
Get Invoice
# The parameter corresponds to a URL of an invoice.
$invoice = $client->getInvoice("http://localhost:6000/06bb8852-b6cb-45f4-ba99-7e8809903db1");