38 KiB
YooKassa API SDK
Class: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Namespace: \YooKassa\Request\Receipts
Summary:
Класс объекта запроса к API на создание чека
Examples
02-builder.php 91 56 Пример использования билдера
Constants
- No constants found
Methods
| Visibility | Name | Flag | Summary |
|---|---|---|---|
| public | __construct() | AbstractObject constructor. | |
| public | __get() | Возвращает значение свойства | |
| public | __isset() | Проверяет наличие свойства | |
| public | __set() | Устанавливает значение свойства | |
| public | __unset() | Удаляет свойство | |
| public | addItem() | Добавляет товар в чек | |
| public | addSettlement() | Добавляет оплату в перечень совершенных расчетов. | |
| public | builder() | Возвращает билдер объектов запросов создания платежа | |
| public | clearValidationError() | Очищает статус валидации текущего запроса | |
| public | fromArray() | Устанавливает значения свойств текущего объекта из массива | |
| public | getAdditionalUserProps() | Возвращает дополнительный реквизит пользователя | |
| public | getCustomer() | Возвращает информацию о плательщике | |
| public | getItems() | Возвращает список позиций в текущем чеке | |
| public | getLastValidationError() | Возвращает последнюю ошибку валидации | |
| public | getObjectId() | Возвращает Id объекта чека | |
| public | getObjectType() | Возвращает тип объекта чека | |
| public | getOnBehalfOf() | Возвращает идентификатор магазина, от имени которого нужно отправить чек. | |
| public | getReceiptIndustryDetails() | Возвращает отраслевой реквизит чека | |
| public | getReceiptOperationalDetails() | Возвращает операционный реквизит чека | |
| public | getSend() | Возвращает признак отложенной отправки чека. | |
| public | getSettlements() | Возвращает массив оплат, обеспечивающих выдачу товара. | |
| public | getTaxSystemCode() | Возвращает код системы налогообложения | |
| public | getType() | Возвращает тип чека в онлайн-кассе | |
| public | hasCustomer() | Проверяет наличие данных о плательщике | |
| public | jsonSerialize() | ||
| public | notEmpty() | Проверяет есть ли в чеке хотя бы одна позиция товаров и оплат | |
| public | offsetExists() | ||
| public | offsetGet() | ||
| public | offsetSet() | ||
| public | offsetUnset() | ||
| public | setAdditionalUserProps() | Устанавливает дополнительный реквизит пользователя | |
| public | setCustomer() | Устанавливает информацию о плательщике | |
| public | setItems() | Устанавливает список позиций в чеке | |
| public | setObjectId() | Устанавливает Id объекта чека | |
| public | setObjectType() | Устанавливает тип объекта чека | |
| public | setOnBehalfOf() | Устанавливает идентификатор магазина, от имени которого нужно отправить чек. | |
| public | setReceiptIndustryDetails() | Устанавливает отраслевой реквизит чека | |
| public | setReceiptOperationalDetails() | Устанавливает операционный реквизит чека | |
| public | setSend() | Устанавливает признак отложенной отправки чека. | |
| public | setSettlements() | Устанавливает массив оплат, обеспечивающих выдачу товара. | |
| public | setTaxSystemCode() | Устанавливает код системы налогообложения | |
| public | setType() | Устанавливает тип чека в онлайн-кассе | |
| public | toArray() | Возвращает ассоциативный массив со свойствами текущего объекта для его дальнейшей JSON сериализации Является алиасом метода AbstractObject::jsonSerialize() | |
| public | validate() | Валидирует текущий запрос, проверяет все ли нужные свойства установлены | |
| protected | getUnknownProperties() | Возвращает массив свойств которые не существуют, но были заданы у объекта | |
| protected | setValidationError() | Устанавливает ошибку валидации |
Details
- File: lib/Request/Receipts/CreatePostReceiptRequest.php
- Package: YooKassa
- Class Hierarchy:
- \YooKassa\Common\AbstractObject
- \YooKassa\Common\AbstractRequest
- \YooKassa\Request\Receipts\CreatePostReceiptRequest
- Implements:
Methods
public __construct() : mixed
public __construct(array $data = array()) : mixed
Summary
AbstractObject constructor.
Details:
- Inherited From: \YooKassa\Common\AbstractObject
Parameters:
| Type | Name | Description |
|---|---|---|
array |
data |
Returns: mixed -
public __get() : mixed
public __get(string $propertyName) : mixed
Summary
Возвращает значение свойства
Details:
- Inherited From: \YooKassa\Common\AbstractObject
Parameters:
| Type | Name | Description |
|---|---|---|
string |
propertyName | Имя свойства |
Returns: mixed - Значение свойства
public __isset() : bool
public __isset(string $propertyName) : bool
Summary
Проверяет наличие свойства
Details:
- Inherited From: \YooKassa\Common\AbstractObject
Parameters:
| Type | Name | Description |
|---|---|---|
string |
propertyName | Имя проверяемого свойства |
Returns: bool - True если свойство имеется, false если нет
public __set() : mixed
public __set(string $propertyName, mixed $value) : mixed
Summary
Устанавливает значение свойства
Details:
- Inherited From: \YooKassa\Common\AbstractObject
Parameters:
| Type | Name | Description |
|---|---|---|
string |
propertyName | Имя свойства |
mixed |
value | Значение свойства |
Returns: mixed -
public __unset() : mixed
public __unset(string $propertyName) : mixed
Summary
Удаляет свойство
Details:
- Inherited From: \YooKassa\Common\AbstractObject
Parameters:
| Type | Name | Description |
|---|---|---|
string |
propertyName | Имя удаляемого свойства |
Returns: mixed -
public addItem() : \YooKassa\Request\Receipts\CreatePostReceiptRequest
public addItem(\YooKassa\Model\ReceiptItemInterface|array $value) : \YooKassa\Request\Receipts\CreatePostReceiptRequest
Summary
Добавляет товар в чек
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Parameters:
| Type | Name | Description |
|---|---|---|
\YooKassa\Model\ReceiptItemInterface OR array |
value | Объект добавляемой в чек позиции |
Returns: \YooKassa\Request\Receipts\CreatePostReceiptRequest -
public addSettlement() : mixed
public addSettlement(\YooKassa\Model\SettlementInterface $value) : mixed
Summary
Добавляет оплату в перечень совершенных расчетов.
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Parameters:
| Type | Name | Description |
|---|---|---|
\YooKassa\Model\SettlementInterface |
value | Информация о совершенных расчетах. |
Returns: mixed -
public builder() : \YooKassa\Request\Receipts\CreatePostReceiptRequestBuilder
Static public builder() : \YooKassa\Request\Receipts\CreatePostReceiptRequestBuilder
Summary
Возвращает билдер объектов запросов создания платежа
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Returns: \YooKassa\Request\Receipts\CreatePostReceiptRequestBuilder - Инстанс билдера объектов запросов
public clearValidationError() : mixed
public clearValidationError() : mixed
Summary
Очищает статус валидации текущего запроса
Details:
- Inherited From: \YooKassa\Common\AbstractRequest
Returns: mixed -
public fromArray() : mixed
public fromArray(array|\Traversable $sourceArray) : mixed
Summary
Устанавливает значения свойств текущего объекта из массива
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Parameters:
| Type | Name | Description |
|---|---|---|
array OR \Traversable |
sourceArray | Ассоциативный массив с настройками |
Returns: mixed -
public getAdditionalUserProps() : \YooKassa\Model\Receipt\AdditionalUserProps
public getAdditionalUserProps() : \YooKassa\Model\Receipt\AdditionalUserProps
Summary
Возвращает дополнительный реквизит пользователя
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Returns: \YooKassa\Model\Receipt\AdditionalUserProps - Дополнительный реквизит пользователя
public getCustomer() : \YooKassa\Model\ReceiptCustomerInterface
public getCustomer() : \YooKassa\Model\ReceiptCustomerInterface
Summary
Возвращает информацию о плательщике
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Returns: \YooKassa\Model\ReceiptCustomerInterface - Информация о плательщике
public getItems() : \YooKassa\Model\ReceiptItemInterface[]
public getItems() : \YooKassa\Model\ReceiptItemInterface[]
Summary
Возвращает список позиций в текущем чеке
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Returns: \YooKassa\Model\ReceiptItemInterface[] - Список товаров в заказе
public getLastValidationError() : string
public getLastValidationError() : string
Summary
Возвращает последнюю ошибку валидации
Details:
- Inherited From: \YooKassa\Common\AbstractRequest
Returns: string - Последняя произошедшая ошибка валидации
public getObjectId() : string
public getObjectId() : string
Summary
Возвращает Id объекта чека
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Returns: string - Id объекта чека
public getObjectType() : string
public getObjectType() : string
Summary
Возвращает тип объекта чека
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Returns: string - Тип объекта чека
public getOnBehalfOf() : string
public getOnBehalfOf() : string
Summary
Возвращает идентификатор магазина, от имени которого нужно отправить чек.
Description
Выдается ЮKassa, отображается в разделе Продавцы личного кабинета (столбец shopId). Необходимо передавать, если вы используете решение ЮKassa для платформ.
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Returns: string -
public getReceiptIndustryDetails() : \YooKassa\Model\Receipt\IndustryDetails[]
public getReceiptIndustryDetails() : \YooKassa\Model\Receipt\IndustryDetails[]
Summary
Возвращает отраслевой реквизит чека
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Returns: \YooKassa\Model\Receipt\IndustryDetails[] - Отраслевой реквизит чека
public getReceiptOperationalDetails() : \YooKassa\Model\Receipt\OperationalDetails
public getReceiptOperationalDetails() : \YooKassa\Model\Receipt\OperationalDetails
Summary
Возвращает операционный реквизит чека
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Returns: \YooKassa\Model\Receipt\OperationalDetails - Операционный реквизит чека
public getSend() : bool
public getSend() : bool
Summary
Возвращает признак отложенной отправки чека.
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Returns: bool - Признак отложенной отправки чека.
public getSettlements() : \YooKassa\Model\SettlementInterface[]
public getSettlements() : \YooKassa\Model\SettlementInterface[]
Summary
Возвращает массив оплат, обеспечивающих выдачу товара.
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Returns: \YooKassa\Model\SettlementInterface[] - Массив оплат, обеспечивающих выдачу товара.
public getTaxSystemCode() : int
public getTaxSystemCode() : int
Summary
Возвращает код системы налогообложения
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Returns: int - Код системы налогообложения. Число 1-6.
public getType() : string
public getType() : string
Summary
Возвращает тип чека в онлайн-кассе
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Returns: string - Тип чека в онлайн-кассе: приход "payment" или возврат "refund".
public hasCustomer() : bool
public hasCustomer() : bool
Summary
Проверяет наличие данных о плательщике
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Returns: bool -
public jsonSerialize() : mixed
public jsonSerialize() : mixed
Details:
- Inherited From: \YooKassa\Common\AbstractObject
Returns: mixed -
public notEmpty() : bool
public notEmpty() : bool
Summary
Проверяет есть ли в чеке хотя бы одна позиция товаров и оплат
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Returns: bool - True если чек не пуст, false если в чеке нет ни одной позиции
public offsetExists() : mixed
public offsetExists(mixed $offset) : mixed
Details:
- Inherited From: \YooKassa\Common\AbstractObject
Parameters:
| Type | Name | Description |
|---|---|---|
mixed |
offset |
Returns: mixed -
public offsetGet() : mixed
public offsetGet(mixed $offset) : mixed
Details:
- Inherited From: \YooKassa\Common\AbstractObject
Parameters:
| Type | Name | Description |
|---|---|---|
mixed |
offset |
Returns: mixed -
public offsetSet() : mixed
public offsetSet(mixed $offset, mixed $value) : mixed
Details:
- Inherited From: \YooKassa\Common\AbstractObject
Parameters:
| Type | Name | Description |
|---|---|---|
mixed |
offset | |
mixed |
value |
Returns: mixed -
public offsetUnset() : mixed
public offsetUnset(mixed $offset) : mixed
Details:
- Inherited From: \YooKassa\Common\AbstractObject
Parameters:
| Type | Name | Description |
|---|---|---|
mixed |
offset |
Returns: mixed -
public setAdditionalUserProps() : void|\YooKassa\Request\Receipts\CreatePostReceiptRequest
public setAdditionalUserProps(\YooKassa\Model\Receipt\AdditionalUserProps|array $value) : void|\YooKassa\Request\Receipts\CreatePostReceiptRequest
Summary
Устанавливает дополнительный реквизит пользователя
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Parameters:
| Type | Name | Description |
|---|---|---|
\YooKassa\Model\Receipt\AdditionalUserProps OR array |
value | Дополнительный реквизит пользователя |
Returns: void|\YooKassa\Request\Receipts\CreatePostReceiptRequest -
public setCustomer() : \YooKassa\Request\Receipts\CreatePostReceiptRequest
public setCustomer(\YooKassa\Model\ReceiptCustomerInterface|array $value) : \YooKassa\Request\Receipts\CreatePostReceiptRequest
Summary
Устанавливает информацию о плательщике
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Parameters:
| Type | Name | Description |
|---|---|---|
\YooKassa\Model\ReceiptCustomerInterface OR array |
value | Информация о плательщике |
Returns: \YooKassa\Request\Receipts\CreatePostReceiptRequest -
public setItems() : \YooKassa\Request\Receipts\CreatePostReceiptRequest
public setItems(\YooKassa\Model\ReceiptItemInterface[]|array $value) : \YooKassa\Request\Receipts\CreatePostReceiptRequest
Summary
Устанавливает список позиций в чеке
Description
Если до этого в чеке уже были установлены значения, они удаляются и полностью заменяются переданным списком позиций. Все передаваемые значения в массиве позиций должны быть объектами класса, реализующего интерфейс ReceiptItemInterface, в противном случае будет выброшено исключение InvalidPropertyValueTypeException.
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Parameters:
| Type | Name | Description |
|---|---|---|
\YooKassa\Model\ReceiptItemInterface[] OR array |
value | Список товаров в заказе |
Throws:
| Type | Description |
|---|---|
| \YooKassa\Common\Exceptions\EmptyPropertyValueException | Выбрасывается если передали пустой массив значений |
| \YooKassa\Common\Exceptions\InvalidPropertyValueTypeException | Выбрасывается если в качестве значения был передан не массив и не итератор, либо если одно из переданных значений не реализует интерфейс ReceiptItemInterface |
Returns: \YooKassa\Request\Receipts\CreatePostReceiptRequest -
public setObjectId() : \YooKassa\Request\Receipts\CreatePostReceiptRequest
public setObjectId(string $value) : \YooKassa\Request\Receipts\CreatePostReceiptRequest
Summary
Устанавливает Id объекта чека
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Parameters:
| Type | Name | Description |
|---|---|---|
string |
value | Id объекта чека |
Returns: \YooKassa\Request\Receipts\CreatePostReceiptRequest -
public setObjectType() : \YooKassa\Request\Receipts\CreatePostReceiptRequest
public setObjectType(string $value) : \YooKassa\Request\Receipts\CreatePostReceiptRequest
Summary
Устанавливает тип объекта чека
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Parameters:
| Type | Name | Description |
|---|---|---|
string |
value | Тип объекта чека |
Returns: \YooKassa\Request\Receipts\CreatePostReceiptRequest -
public setOnBehalfOf() : \YooKassa\Request\Receipts\CreatePostReceiptRequest
public setOnBehalfOf(string $value) : \YooKassa\Request\Receipts\CreatePostReceiptRequest
Summary
Устанавливает идентификатор магазина, от имени которого нужно отправить чек.
Description
Выдается ЮKassa, отображается в разделе Продавцы личного кабинета (столбец shopId). Необходимо передавать, если вы используете решение ЮKassa для платформ.
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Parameters:
| Type | Name | Description |
|---|---|---|
string |
value |
Returns: \YooKassa\Request\Receipts\CreatePostReceiptRequest -
public setReceiptIndustryDetails() : \YooKassa\Request\Receipts\CreatePostReceiptRequest
public setReceiptIndustryDetails(array|\YooKassa\Model\Receipt\IndustryDetails $value) : \YooKassa\Request\Receipts\CreatePostReceiptRequest
Summary
Устанавливает отраслевой реквизит чека
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Parameters:
| Type | Name | Description |
|---|---|---|
array OR \YooKassa\Model\Receipt\IndustryDetails |
value | Отраслевой реквизит чека |
Returns: \YooKassa\Request\Receipts\CreatePostReceiptRequest -
public setReceiptOperationalDetails() : \YooKassa\Request\Receipts\CreatePostReceiptRequest
public setReceiptOperationalDetails(array|\YooKassa\Model\Receipt\OperationalDetails $value) : \YooKassa\Request\Receipts\CreatePostReceiptRequest
Summary
Устанавливает операционный реквизит чека
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Parameters:
| Type | Name | Description |
|---|---|---|
array OR \YooKassa\Model\Receipt\OperationalDetails |
value | Операционный реквизит чека |
Returns: \YooKassa\Request\Receipts\CreatePostReceiptRequest -
public setSend() : \YooKassa\Request\Receipts\CreatePostReceiptRequest
public setSend(bool $value) : \YooKassa\Request\Receipts\CreatePostReceiptRequest
Summary
Устанавливает признак отложенной отправки чека.
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Parameters:
| Type | Name | Description |
|---|---|---|
bool |
value | Признак отложенной отправки чека. |
Returns: \YooKassa\Request\Receipts\CreatePostReceiptRequest -
public setSettlements() : \YooKassa\Request\Receipts\CreatePostReceiptRequest
public setSettlements(\YooKassa\Model\SettlementInterface|array $value) : \YooKassa\Request\Receipts\CreatePostReceiptRequest
Summary
Устанавливает массив оплат, обеспечивающих выдачу товара.
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Parameters:
| Type | Name | Description |
|---|---|---|
\YooKassa\Model\SettlementInterface OR array |
value | Массив оплат, обеспечивающих выдачу товара. |
Returns: \YooKassa\Request\Receipts\CreatePostReceiptRequest -
public setTaxSystemCode() : \YooKassa\Request\Receipts\CreatePostReceiptRequestInterface
public setTaxSystemCode(int $value) : \YooKassa\Request\Receipts\CreatePostReceiptRequestInterface
Summary
Устанавливает код системы налогообложения
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Parameters:
| Type | Name | Description |
|---|---|---|
int |
value | Код системы налогообложения. Число 1-6 |
Throws:
| Type | Description |
|---|---|
| \YooKassa\Common\Exceptions\InvalidPropertyValueTypeException | Выбрасывается если переданный аргумент - не число |
| \YooKassa\Common\Exceptions\InvalidPropertyValueException | Выбрасывается если переданный аргумент меньше одного или больше шести |
Returns: \YooKassa\Request\Receipts\CreatePostReceiptRequestInterface -
public setType() : \YooKassa\Request\Receipts\CreatePostReceiptRequest
public setType(string $value) : \YooKassa\Request\Receipts\CreatePostReceiptRequest
Summary
Устанавливает тип чека в онлайн-кассе
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Parameters:
| Type | Name | Description |
|---|---|---|
string |
value | Тип чека в онлайн-кассе: приход "payment" или возврат "refund". |
Returns: \YooKassa\Request\Receipts\CreatePostReceiptRequest -
public toArray() : array
public toArray() : array
Summary
Возвращает ассоциативный массив со свойствами текущего объекта для его дальнейшей JSON сериализации Является алиасом метода AbstractObject::jsonSerialize()
Details:
- Inherited From: \YooKassa\Common\AbstractObject
Returns: array - Ассоциативный массив со свойствами текущего объекта
public validate() : bool
public validate() : bool
Summary
Валидирует текущий запрос, проверяет все ли нужные свойства установлены
Details:
- Inherited From: \YooKassa\Request\Receipts\CreatePostReceiptRequest
Returns: bool - True если запрос валиден, false если нет
protected getUnknownProperties() : array
protected getUnknownProperties() : array
Summary
Возвращает массив свойств которые не существуют, но были заданы у объекта
Details:
- Inherited From: \YooKassa\Common\AbstractObject
Returns: array - Ассоциативный массив с не существующими у текущего объекта свойствами
protected setValidationError() : mixed
protected setValidationError(string $value) : mixed
Summary
Устанавливает ошибку валидации
Details:
- Inherited From: \YooKassa\Common\AbstractRequest
Parameters:
| Type | Name | Description |
|---|---|---|
string |
value | Ошибка, произошедшая при валидации объекта |
Returns: mixed -
Top Namespaces
Reports
This document was automatically generated from source code comments on 2023-04-06 using phpDocumentor
© 2023 YooMoney