Download the PHP package capusta/php-sdk without Composer

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

Capusta.Space PHP SDK

Latest version is v1.14.0

Documentation: https://dev.capusta.space/

Requirements

PHP 7.2 and later.

Dependencies

The bindings require the following extensions in order to work properly:

Optionally

Composer

First, you need to install Composer to your system. (https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos)

After Composer is installed to your system you need to run the following command:

To use the bindings, use Composer's autoload:

If you use Composer, these dependencies should be handled automatically.

Getting Started

We recommend using the GuzzleHttp Client

Init client

All requests are processed in similar steps:

  1. Create request instance of Capusta\SDK\Model\Request\AbstractRequest
  2. Request serialization
  3. Sending a request to the server
  4. You have a response object instance of Capusta\SDK\Model\Response\AbstractResponse or throws exception if request fail

All requests are creating by suitable objects or can be created on the basis of arrays, integers and strings

Create payment

Creating request with object

or you can create request with array

if you have got $createPaymentResponse->getStatus() == 'CREATED', then you need to redirect user to URL: $createPaymentResponse->getPayUrl()

Create bill

Creating request with object

or you can create request with array

If you have got $createBillResponse->getStatus() == 'CREATED', then you need to redirect user to URL: $createBillResponse->getPayUrl()

Create payout

Creating request with object

or you can create request with array

Getting payment status

Creating request with object

or you can create request with array

Getting BILL status (status v2)

(with array of successfull payments inside of 'transactions' property)

Creating request with object

or you can create request with array

If you want to get array of successfull transactions of bill or payment you need to call method $getStatusResponse->getTransactions().

Getting payments registry

Array of successfull payments.

or you can get payments registry with array request

Create project

(this method is disabled by default, you need to ask support to switch this on)

Creating request with object

or you can create request with array

returned object $createProjectResponse contains properties within the 'status' property. If 'status' is "NEW" - the project is successfully created.

Exceptions

Processing notification from server

This code is responsible for processing the payment result. You need to create handler, make it available on URL in your application and specify the URL in the project settings in my.capusta.space. This handler will be called after the user makes a payment using the form on capusta.space

$responseNotification contains object with notification parameters. For example, you can get main parameters like this:

For example, you can get main parameters like this:

You can use manual response to server:

If you use a proxy server, you can skip the IP check

Custom Api Transport

You can create your own api transport by extending Capusta\SDK\Transport\AbstractApiTransport


All versions of php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
ext-curl Version *
ext-json Version *
ext-mbstring Version *
psr/log Version >=1.1
guzzlehttp/psr7 Version ^1.6
guzzlehttp/guzzle Version ~7.0
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 capusta/php-sdk contains the following files

Loading the files please wait ....