PHPackages                             korobovn/cloud-payments - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. korobovn/cloud-payments

ActiveLibrary[Payment Processing](/categories/payments)

korobovn/cloud-payments
=======================

Cloud Payments PHP-client

1.0.2(6y ago)09MITPHPPHP ^7.1.3CI failing

Since Nov 18Pushed 6y ago1 watchersCompare

[ Source](https://github.com/korobovn/CloudPayments)[ Packagist](https://packagist.org/packages/korobovn/cloud-payments)[ RSS](/packages/korobovn-cloud-payments/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (8)Versions (4)Used By (0)

Cloud Payments PHP-client

[![Version](https://camo.githubusercontent.com/ab905b5170dab76de62f28f756dc2c09681f39f5976f701b2bc8d790c83ab67c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6f726f626f766e2f636c6f75642d7061796d656e74732e7376673f6d61784167653d313830)](https://packagist.org/packages/korobovn/cloud-payments)[![Version](https://camo.githubusercontent.com/636dfae8534b43d116db0132841d4f07015db0229aa5a152100f72207684becf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6b6f726f626f766e2f636c6f75642d7061796d656e74732e7376673f6c6f6e6743616368653d74727565)](https://packagist.org/packages/korobovn/cloud-payments)[![Build Status](https://camo.githubusercontent.com/915be08ff3da8e839021e51681c2da6e9ecb5496508a9abc67b8e7432af75de9/68747470733a2f2f7472617669732d63692e6f72672f6b6f726f626f766e2f436c6f75645061796d656e74732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/korobovn/CloudPayments)[![Coverage](https://camo.githubusercontent.com/cf6bbb985a925c04656e1d4133cca2e2b3105128c825e4fee40e7e2af5cb7fcb/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6b6f726f626f766e2f436c6f75645061796d656e74732f6d61737465722e7376673f6d61784167653d3630)](https://codecov.io/gh/korobovn/CloudPayments/)[![Code quality](https://camo.githubusercontent.com/294b611263bffe25ad8669efaa93a00704686e583e5db868bca68971c6bfe2ce/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6b6f726f626f766e2f436c6f75645061796d656e74732e7376673f6d61784167653d313830)](https://scrutinizer-ci.com/g/korobovn/CloudPayments/)[![Downloads count](https://camo.githubusercontent.com/052196f9f52c606ea3ff5b50dc533bed71926926c73c2a9a6a3bd2f02843958c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b6f726f626f766e2f636c6f75642d7061796d656e74732e7376673f6d61784167653d313830)](https://packagist.org/packages/korobovn/cloud-payments)[![License](https://camo.githubusercontent.com/9466d355f34af2c6001014ed9bea210f518e7a1e8b288dbcee70d4b88a82bf80/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6b6f726f626f766e2f636c6f75642d7061796d656e74732e7376673f6c6f6e6743616368653d74727565)](https://github.com/korobovn/CloudPayments/blob/master/LICENSE)

The package for easy use [Cloud Payments API](https://developers.cloudpayments.ru/#api).

Install
-------

[](#install)

Require this package with composer using the following command:

```
$ composer require korobovn/cloud-payments
```

> Installed `composer` is required ([how to install composer](https://getcomposer.org/download/)).

Frameworks integration
----------------------

[](#frameworks-integration)

### Laravel 5

[](#laravel-5)

Laravel 5.5 and above uses Package Auto-Discovery, so doesn't require you to manually register the service-provider. Otherwise you must add the service provider to the `providers` array in `./config/app.php`:

```
'providers' => [
    // ...
    Korobovn\CloudPayments\CloudPaymentsServiceProvider::class,
]
```

Usage
-----

[](#usage)

### How to get a client instance

[](#how-to-get-a-client-instance)

If using Laravel framework, then you can get an instance of `ClientInterface` using `make` method to resolve.

```
$client = $this->app->make(Korobovn\CloudPayments\Client\ClientInterface::class);
```

You can send a request using the `send` method:

```
$client->send($request);
```

Where `$request` is an instance of `RequestInterface`.

You can also call the `send` method on the `RequestInterface` instance. Before that, you must call the `setClient` method on the `RequestInterface` with `ClientInterface`

```
$request->setClient($client)->send();
```

You can choose the way you like.

### How to create a request

[](#how-to-create-a-request)

List of available requests:

#### Cryptogram payment

[](#cryptogram-payment)

[Cryptogram payment docs here](https://developers.cloudpayments.ru/#oplata-po-kriptogramme).

`CryptogramPaymentOneStepRequest` - for one-step payment;

`CryptogramPaymentTwoStepRequest` - for two-step payment.

Creating and sending a request:

```
