10 KiB
YooKassa API SDK
Class: \YooKassa\Request\Deals\CreateDealRequestBuilder
Namespace: \YooKassa\Request\Deals
Summary:
Класс, представляющий модель CreateDealRequestBuilder.
Description:
Класс билдера объектов запросов к API на создание платежа.
Examples
Пример использования билдера
try {
$dealBuilder = \YooKassa\Request\Deals\CreateDealRequest::builder();
$dealBuilder
->setType(\YooKassa\Model\Deal\DealType::SAFE_DEAL)
->setFeeMoment(\YooKassa\Model\Deal\FeeMoment::PAYMENT_SUCCEEDED)
->setDescription('SAFE_DEAL 123554642-2432FF344R')
->setMetadata(['order_id' => '37'])
;
// Создаем объект запроса
$request = $dealBuilder->build();
$idempotenceKey = uniqid('', true);
$response = $client->createDeal($request, $idempotenceKey);
} catch (Exception $e) {
$response = $e;
}
var_dump($response);
Constants
- No constants found
Properties
| Visibility | Name | Flag | Summary |
|---|---|---|---|
| protected | $currentObject | Собираемый объект запроса. |
Methods
| Visibility | Name | Flag | Summary |
|---|---|---|---|
| public | __construct() | Конструктор, инициализирует пустой запрос, который в будущем начнём собирать. | |
| public | build() | Осуществляет сборку объекта запроса к API. | |
| public | setDescription() | Устанавливает описание транзакции. | |
| public | setFeeMoment() | Устанавливает момент перечисления вам вознаграждения платформы. | |
| public | setMetadata() | Устанавливает метаданные, привязанные к платежу. | |
| public | setOptions() | Устанавливает свойства запроса из массива. | |
| public | setType() | Устанавливает тип сделки. | |
| protected | initCurrentObject() | Инициализирует объект запроса, который в дальнейшем будет собираться билдером |
Details
-
Package: YooKassa\Request
-
Class Hierarchy:
- \YooKassa\Common\AbstractRequestBuilder
- \YooKassa\Request\Deals\CreateDealRequestBuilder
-
See Also:
Tags
| Tag | Version | Description |
|---|---|---|
| category | Class | |
| author | cms@yoomoney.ru |
Properties
protected $currentObject : ?\YooKassa\Common\AbstractRequestInterface
Summary
Собираемый объект запроса.
Type: AbstractRequestInterface
Details:
Methods
public __construct() : mixed
public __construct() : mixed
Summary
Конструктор, инициализирует пустой запрос, который в будущем начнём собирать.
Details:
- Inherited From: \YooKassa\Common\AbstractRequestBuilder
Returns: mixed -
public build() : \YooKassa\Request\Deals\CreateDealRequestInterface|\YooKassa\Common\AbstractRequestInterface
public build(array|null $options = null) : \YooKassa\Request\Deals\CreateDealRequestInterface|\YooKassa\Common\AbstractRequestInterface
Summary
Осуществляет сборку объекта запроса к API.
Details:
- Inherited From: \YooKassa\Request\Deals\CreateDealRequestBuilder
Parameters:
| Type | Name | Description |
|---|---|---|
array OR null |
options |
Returns: \YooKassa\Request\Deals\CreateDealRequestInterface|\YooKassa\Common\AbstractRequestInterface -
public setDescription() : \YooKassa\Request\Deals\CreateDealRequestBuilder
public setDescription(string|null $value) : \YooKassa\Request\Deals\CreateDealRequestBuilder
Summary
Устанавливает описание транзакции.
Details:
- Inherited From: \YooKassa\Request\Deals\CreateDealRequestBuilder
Parameters:
| Type | Name | Description |
|---|---|---|
string OR null |
value | Описание транзакции |
Returns: \YooKassa\Request\Deals\CreateDealRequestBuilder - Инстанс текущего билдера
public setFeeMoment() : \YooKassa\Request\Deals\CreateDealRequestBuilder
public setFeeMoment(string $value) : \YooKassa\Request\Deals\CreateDealRequestBuilder
Summary
Устанавливает момент перечисления вам вознаграждения платформы.
Details:
- Inherited From: \YooKassa\Request\Deals\CreateDealRequestBuilder
Parameters:
| Type | Name | Description |
|---|---|---|
string |
value | Момент перечисления вам вознаграждения платформы |
Returns: \YooKassa\Request\Deals\CreateDealRequestBuilder - Инстанс текущего билдера
public setMetadata() : \YooKassa\Request\Deals\CreateDealRequestBuilder
public setMetadata(null|array|\YooKassa\Model\Metadata $value) : \YooKassa\Request\Deals\CreateDealRequestBuilder
Summary
Устанавливает метаданные, привязанные к платежу.
Details:
- Inherited From: \YooKassa\Request\Deals\CreateDealRequestBuilder
Parameters:
| Type | Name | Description |
|---|---|---|
null OR array OR \YooKassa\Model\Metadata |
value | Метаданные платежа, устанавливаемые мерчантом |
Returns: \YooKassa\Request\Deals\CreateDealRequestBuilder - Инстанс текущего билдера
public setOptions() : \YooKassa\Common\AbstractRequestBuilder
public setOptions(iterable|null $options) : \YooKassa\Common\AbstractRequestBuilder
Summary
Устанавливает свойства запроса из массива.
Details:
- Inherited From: \YooKassa\Common\AbstractRequestBuilder
Parameters:
| Type | Name | Description |
|---|---|---|
iterable OR null |
options | Массив свойств запроса |
Throws:
| Type | Description |
|---|---|
| \InvalidArgumentException | Выбрасывается если аргумент не массив и не итерируемый объект |
| \YooKassa\Common\Exceptions\InvalidPropertyException | Выбрасывается если не удалось установить один из параметров, переданных в массиве настроек |
Returns: \YooKassa\Common\AbstractRequestBuilder - Инстанс текущего билдера запросов
public setType() : \YooKassa\Request\Deals\CreateDealRequestBuilder
public setType(string $value) : \YooKassa\Request\Deals\CreateDealRequestBuilder
Summary
Устанавливает тип сделки.
Details:
- Inherited From: \YooKassa\Request\Deals\CreateDealRequestBuilder
Parameters:
| Type | Name | Description |
|---|---|---|
string |
value | Тип сделки |
Returns: \YooKassa\Request\Deals\CreateDealRequestBuilder - Инстанс текущего билдера
protected initCurrentObject() : \YooKassa\Request\Deals\CreateDealRequest
protected initCurrentObject() : \YooKassa\Request\Deals\CreateDealRequest
Summary
Инициализирует объект запроса, который в дальнейшем будет собираться билдером
Details:
- Inherited From: \YooKassa\Request\Deals\CreateDealRequestBuilder
Returns: \YooKassa\Request\Deals\CreateDealRequest - Инстанс собираемого объекта запроса к API
Top Namespaces
Reports
This document was automatically generated from source code comments on 2023-06-16 using phpDocumentor
© 2023 YooMoney