chameleon/yigimphp
最新稳定版本:0.4
Composer 安装命令:
composer require chameleon/yigimphp
包简介
Yigim PHP & Laravel package
README 文档
README
Install
Laravel 5.5+
composer require chameleon/yigimphp
Usage
Laravel
$client = Yigim::createClient([ 'msisdn' => '+994112223344', 'name' => 'Client' ]); $invoice = Yigim::createInvoice([ 'client' => $client->payload('reference'), 'name' => 'Payment Name', 'amount' => 100, //1azn 'currency' => 944, 'reference' => 'yourUniquePaymentReference', 'deadline' => Carbon::now()->toDateString(), 'status' => 4, 'option' => [1, 2, 4] ]); $invoice->payload('number'); //Hook /** * @var \Illuminate\Http\Request $request */ $yigimHook = Yigim::handleHook(config('yigim.hook_key'), $request->query()); if ($yigimHook->type() === YigimHook::TYPE['INVOICE']) { $invoice = Yigim::getInvoice($yigimHook->reference()); $invoiceNumber = $invoice->payload('number')); if ($invoiceNumber !== null) { switch ($yigimHook->action()) { case YigimHook::INVOICE_ACTION['PAID_FULL']: // pay full case YigimHook::INVOICE_ACTION['PAID_PART']: // pay part case YigimHook::INVOICE_ACTION['CANCEL']: case YigimHook::INVOICE_ACTION['DELETE']: // Cancel } } }
统计信息
- 总下载量: 3.56k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-11-04