Download the PHP package tmoldri/gateway-php-sdk without Composer

On this page you can find all versions of the php package tmoldri/gateway-php-sdk. 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 gateway-php-sdk

Dokobit Gateway PHP Client

Build Status Scrutinizer Code Quality Code Coverage Build Status

This library makes it easier to integrate Dokobit Gateway API in PHP applications by wrapping all of the Gateway API calls and responses in PHP objects.

How to start?

  1. Instantiate a client object:

    If you want to log requests, just pass a PSR-3 LoggerInterface compatible logger (such as a Monolog instance) as the second parameter to the create() method, like this:

  2. Use the client instantiated above to make the desired API calls. To do that, instantiate a respective request object and pass it to the get() method of the client. For example, to upload a file to Gateway:

    The client performs an HTTP request and returns a result object, which has getters for all response fields. Should the request fail for any reason, an exception will be thrown, which should help you debug the issue.

The request (query) and response (result) classes closely mirror the API calls, which are documented at https://gateway-sandbox.dokobit.com/api/doc.

To make downloading of signed files more convenient, the Client class also provides the downloadFile() method. To download a signed file, just call this method like this:

Note: this method will append your access token to the URL automatically, so you can pass it the URLs you receive from the Gateway's postbacks in their verbatim form, without any changes. The same method can also be used to download arbitrary files from other locations, if necessary. Should you want to do that, just pass false as the third argument to avoid appending the access token, like this:

For further code usage examples, please check integration tests under tests/Integration.

Debugging

To dig more into occured error use following methods:

echo (string) $exception->getMessage()
echo (string) $exception->getPrevious()->getResponse()
var_dump( $exception->getResponseData() )

These methods are available on all exception classes except UnexpectedError and QueryValidator.

Develop

Whole testsuite including integrational tests

phpunit

Don't forget to define SANDBOX_API_KEY in your phpunit.xml.

Running unit tests only:

phpunit --testsuite=Unit

Running integrational tests only:

phpunit --testsuite=Integration

Running single testcase:

phpunit tests/Integration/CheckTest.php

All versions of gateway-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
guzzlehttp/guzzle Version ^7.0.1
symfony/validator Version ~3.4|~4.4|~5.2
symfony/intl Version ^5.2
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 tmoldri/gateway-php-sdk contains the following files

Loading the files please wait ....