Download the PHP package grinchenkoedu/diia-php without Composer

On this page you can find all versions of the php package grinchenkoedu/diia-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package diia-php

Diia (Дія) API client for PHP

[!NOTE] This is a community library. It is not developed, endorsed or supported by Diia or the Ministry of Digital Transformation of Ukraine.

Tests PHP Packagist

A client for the Diia acquirer API: branches, offers, and offer requests for Дія.Підпис (signing) and Дія.Шеринг (document sharing). PHP 7.4 or newer.

Installation

Recommended libraries

Examples

The examples run in order: each one uses variables from the ones before it. tests/ReadmeExamplesTest.php runs every PHP block of this file, so they stay in step with the code.

Client initialization

Build the factory once, in a service provider or your container, and take the clients from it. Clients from one factory share one bearer token, kept in the PSR-16 cache you pass; it is refreshed before it expires, and once more if Diia rejects it with a 401.

Branches

A branch is the part of your organization users see in Diia.

Changing a branch's scopes: in our experience (observed in 2024, with 1.x) Diia did not apply new scopes to an existing branch, and the branch had to be deleted and created again. This is not confirmed by Diia's current documentation; check it on the partner portal before relying on either behaviour.

Errors

Failed calls throw DiiaApiException: an HTTP error, a response the client cannot read, or no response at all.

Дія.Підпис

Create the offer once and keep its ID. Then, for every document, hash it, send the hash, and give the user the deep link.

Дія.Шеринг

Callbacks

This library covers the calls you make to Diia. Diia's calls back to you — the signed hashes and the shared documents — are yours to receive. What they carry:

What the receiver must do:

The check for a signing callback, in that background job:

Cleaning up

Upgrading from 1.x

2.0 replaces AcquirersClient with one client per API resource, built by ClientFactory. Replace the manual wiring (DependencyResolver, RequestJsonMapper, the five ResponseJsonMappers, HttpHeadersProvider) with the client initialization above, then rename the calls:

1.x AcquirersClient 2.0
createBranch(Branch) BranchClient::create(Branch)
updateBranch($branchId, Branch) BranchClient::update($branchId, Branch)
deleteBranch($branchId) BranchClient::delete($branchId)
getBranch($branchId) BranchClient::get($branchId)
getBranches(ItemsListRequest) BranchClient::list(ItemsListRequest)
createOffer($branchId, Offer) OfferClient::create($branchId, Offer)
deleteOffer($branchId, $offerId) OfferClient::delete($branchId, $offerId)
getOffers($branchId, ItemsListRequest) OfferClient::list($branchId, ItemsListRequest)
makeOfferRequest($branchId, OfferRequest) OfferRequestClient::makeDynamic($branchId, OfferRequest)
offerRequestStatus($otp, $requestId) OfferRequestClient::status($otp, $requestId)
documentRequest(DocumentRequest) DocumentRequestClient::request(DocumentRequest)
documentRequestStatus($barcode, $requestId) DocumentRequestClient::status($barcode, $requestId)

HTTP errors, transport errors and unreadable responses are now DiiaApiException instead of Guzzle exceptions or UnexpectedValueException. The DTOs, enums, endpoints and request bodies are unchanged. See CHANGELOG.md.

Tests and development


All versions of diia-php with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
guzzlehttp/guzzle Version ^7.8
psr/simple-cache Version ^1.0 || ^2.0 || ^3.0
psr/log Version ^1.1 || ^2.0 || ^3.0
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package grinchenkoedu/diia-php contains the following files

Loading the files please wait ...