chameleon/yigimphp

Yigim PHP & Laravel package
3,718 1
Install
composer require chameleon/yigimphp
Latest Version:0.4
PHP:>=7.1
License:MIT
Last Updated:Apr 18, 2023
Links: GitHub  ·  Packagist
Maintainer: thehasanov

Yigim Laravel


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
        }
    }
}

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

413,412,504 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

394,964,158 4,660

Version History

Version Released PHP Laravel License
0.4 >=7.1 >=5.6 <11.0 MIT
0.3.2.1 >=7.1 ~5.6 || ~5.7 || ~5.8 || ~6.0 || ~7.0 || ~8.0 || ~9.0 MIT
0.3.2 >=7.1 ~5.6 || ~5.7 || ~5.8 || ~6.0 || ~7.0 || ~8.0 MIT
0.3.1 >=7.1 ~5.6 || ~5.7 || ~5.8 || ~6.0 || ~7.0 || ~8.0 MIT
0.3.0 >=7.1 5.5.x|5.6.x|5.7.x MIT