Russian | English
This product is used for managing payments under The YooKassa API For usage by those who implemented YooKassa using the API method.
PHP 8.1 (or later version) with the libcurl library
- Install Composer, a package manager.
- In the console, run the following command:
composer require zoonru/yookassa-sdk-php
- Add a string
"zoonru/yookassa-sdk-php": "^2.6.3"
to the list of dependencies of your project in the composer.json file
...
"require": {
"php": "^8.1",
"zoonru/yookassa-sdk-php": "^2.6.3"
...
- Refresh the project's dependencies. In the console, navigate to the catalog with composer.json and run the following command:
composer update
- Adjust your project's code to activate automated uploading of files for our product:
require __DIR__ . '/vendor/autoload.php';
- Download the YooKassa API PHP Client Library archive, extract it and copy the lib catalog to the required place of your project.
- Adjust your project's code to activate automated uploading of files for our product:
require __DIR__ . '/lib/autoload.php';
- Import required classes
use YooKassa\Client;
- Create a sample of a client object, then set the store's identifier and secret key (you can get them under your YooKassa's Merchant Profile). Issuing a secret key
$client = new Client();
$client->setAuth('shopId', 'secretKey');
-
Call the required API method.
- Authentication
- Statistics about the environment used
- Getting information about the store
- Working with Webhook
- Notifications
- Request to create a payment
- Request to create a payment via the builder
- Request for partial payment confirmation
- Request to cancel an incomplete payment
- Get payment information
- Get a list of payments with filtering
- Request to create a refund
- Request to create a refund via the builder
- Get refund information
- Get a list of returns with filtering