Download the PHP package zkelo/unitpay-sdk without Composer

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

Unitpay PHP SDK

Packagist PHP Version Support CodeFactor Grade Packagist Downloads Packagist License

This SDK allows you to work with Unitpay payment system on PHP.

Manual

Requirements

Installation

Initial configuration

SDK constructor requires at least two arguments to be passed in - it's your secret and public key. Optional third argument is domain name that will be used to interact with.

Quick start

Creating payment form link

Following example creates payment form link and redirects user to it immediately.

Hanling incoming request

Next example handles incoming Unitpay request using SDK and returns correspond response (even if request is bad).

Be aware! SDK method returns array you must encode to JSON so you need to use json_encode() function.

If you need to do something on success or fail request you can use third argument passed to method which reference to variable that will be used to store boolean value about request status.

As you can see in example above we passed $success variable as third argument to method so we can easy check request status.

Creating payment by API request

Sometimes you need to init payment through request to API instead of using Unitpay form.

In example above payment method written as is, e.g. "raw". But instead of writing payment method by hand you can use constants from models. Please refer to models section for more information.

Retrieving information about payment

To retrieve payment information you should use getPayment() method that returns information in comfortable way using model.

Localization

Reference

This section will be written soon.

Exceptions

Interfaces

Available methods

Locales

Models

Extending

Localization

If you need to translate currency names, payment methods or response messages to your language you can do it simply by making new locale class which extending base abstract Locale class.

Example below shows how looks locale class.

Now, when you have class for your locale, you need to make it available for usage by adding it to Locale model by Locale::use() method.

After adding locale you can use it in SDK. You can set it as default or just specify it in places where needed.


All versions of unitpay-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
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 zkelo/unitpay-sdk contains the following files

Loading the files please wait ....