baraja-core/fio-payment-authorizator

There is no license information available for the latest version (v1.0.3) of this package.

FIO payment authorizator.

v1.0.3 2019-12-04 09:03 UTC

This package is auto-updated.

Last update: 2019-12-04 09:04:22 UTC


README

Simple package for search payments in your bank account by API and authorize new orders.

Install

By Composer:

composer require baraja-core/fio-payment-authorizator

And create service by Neon:

services:
    - FioPaymentAuthorizator(%fio.privateKey%)

parameters:
    fio:
        privateKey: xxx

Use

In presenter use very simply:

/** @var FioPaymentAuthorizator $fio **/
$fio = $this->context->getByType(FioPaymentAuthorizator::class);

// Or simply:

$fio = new FioPaymentAuthorizator('private-key');

dump($fio->process()); // Get last month bank data as TransactionResult.

// Check account and authorize new orders

$unauthorizedVariables = [];

$fio->authOrders(
    $unauthorizedVariables,
    function (Transaction $transaction): void {
        // Do something...
    }
);