承接 analogic/lightning-charge-client-php7 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

analogic/lightning-charge-client-php7

Composer 安装命令:

composer require analogic/lightning-charge-client-php7

包简介

PHP7 client for the Lightning Charge REST API

README 文档

README

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 \LightningCharge\Client('http://localhost:8009', '[TOKEN]');

// Create invoice
$request = new \LightningCharge\InvoiceRequest();
$request->setMilliSatoshi(50);
$request->setMetadata(['customer' => [ 'customer' => 'Satoshi', 'products' => [ 'potato', 'chips']]]);
$invoice = $charge->invoice($request);

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


// Create invoice denominated in USD
$request = new \LightningCharge\InvoiceRequest();
$request->setCurrency('USD');
$request->setAmount(0.15);
$invoice = $charge->invoice($request);

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

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

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

TODO: document wait

Test

$ composer install
$ mkdir /tmp/data
$ docker run -u `id -u` -v /tmp/data:/data -p 9112:9112 \
             -e API_TOKEN=mySecretToken \
             shesek/lightning-charge
$ CHARGE_URL=http://api-token:mySecretToken@localhost:9112 vendor/bin/phpunit test

License

MIT

统计信息

  • 总下载量: 11
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固