PHPackages                             asrorbek/cloudpayments-php-client - 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. asrorbek/cloudpayments-php-client

ActiveLibrary

asrorbek/cloudpayments-php-client
=================================

PHP client library for interacting with CloudPayments API

v1.1.5(2y ago)3198MITPHPPHP ^8.1

Since Jan 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/asrorbekh/cloudpayments-php-client)[ Packagist](https://packagist.org/packages/asrorbek/cloudpayments-php-client)[ RSS](/packages/asrorbek-cloudpayments-php-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (14)Used By (0)

CloudPayments PHP Client
========================

[](#cloudpayments-php-client)

This PHP library provides a convenient interface for interacting with the CloudPayments API. The CloudPayments API operates at `api.cloudpayments.ru` and supports various functions for payment processing, including making a payment, canceling a payment, returning money, completing payments made using a two-stage scheme, creating and canceling subscriptions for recurring payments, as well as sending invoices by mail.

Principle of Operation
----------------------

[](#principle-of-operation)

Parameters are passed using the POST method in the body of the request in either the "key=value" format or in JSON. The API can accept a maximum of 150,000 fields in a single request, and the timeout for receiving a response from the API is set to 5 minutes. It's important to note that if a number with a fractional part is passed into an integer field, mathematical rounding will occur without triggering an error.

The API enforces limits on the maximum number of simultaneous requests for test terminals (5) and combat terminals (30). If the number of requests to the site currently being processed exceeds the limit, the API will return a response with HTTP code 429 (Too Many Requests) until processing is completed. For a review of these restrictions, contact your personal manager.

The choice of parameter transfer format is determined on the client side and is controlled through the `Content-Type` request header:

- For `key=value` parameters: `Content-Type: application/x-www-form-urlencoded`
- For JSON parameters: `Content-Type: application/json`

The system issues a response in JSON format, including at least two parameters: `Success` and `Message`:

```
{
  "Success": false,
  "Message": "Invalid Amount value"
}
```

### Request Authentication

[](#request-authentication)

To authenticate the request, HTTP Basic Auth is used. The login and password are sent in the HTTP request header. The Public ID serves as the login, and the API Secret serves as the password. Both values can be obtained in your personal account. If a header with authentication data is not sent in the request or incorrect data is provided, the system will return HTTP status 401 – Unauthorized. It's crucial to securely store the API secret.

### Requires

[](#requires)

- php ^8.1

```
composer require asrorbek/cloudpayments-php-client
```

Example usage
-------------

[](#example-usage)

```
