tikiwiki / ilp-client
Interledger的PHP客户端库。与ILP SPSP发票服务器集成,允许创建和获取发票。
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-09-20 02:36:32 UTC
README
ILP模块包括
- 支持与ILP SPSP发票服务器集成,允许创建和获取发票。
设置开发环境
启动ILP发票服务器和Moneyd
cd test
docker-compose up -d
运行测试
composer install --dev
vendor/bin/phpunit --configuration phpunit.xml
如何使用
要了解更多关于ILP SPSP发票服务器的信息,请点击这里。
创建发票
$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"]);
获取发票
# The parameter corresponds to a URL of an invoice.
$invoice = $client->getInvoice("http://localhost:6000/06bb8852-b6cb-45f4-ba99-7e8809903db1");