UNPKG

nestjs-yookassa

Version:

A NestJS library for integrating with YooKassa API

48 lines (47 loc) 1.95 kB
import type { Payment } from '../../../payment/interfaces'; import type { InvoiceCancellationPartyEnum, InvoiceCancellationReasonEnum, InvoiceStatusEnum } from '../../enums'; import type { CartItem } from '../requests'; import type { YookassaMetadata } from '../../../../common/types/metadata.type'; /** * Способ доставки счета */ export interface DeliveryMethod { /** Тип способа доставки */ type: 'self'; /** URL страницы счета для оплаты */ url?: string; } /** * Детали отмены счета */ export interface InvoiceCancellationDetails { /** Участник процесса, который отменил счет */ party: InvoiceCancellationPartyEnum; /** Причина отмены счета */ reason: InvoiceCancellationReasonEnum; } /** * Детали счета */ export interface Invoice<T extends YookassaMetadata = YookassaMetadata> { /** Идентификатор счета в ЮKassa */ id: string; /** Статус счета */ status: InvoiceStatusEnum; /** Корзина заказа */ cart: CartItem[]; /** Данные о выбранном способе доставки счета */ delivery_method?: DeliveryMethod; /** Данные о платеже по счету (если успешно оплачен) */ payment_details?: Payment<T>; /** Дата и время создания счета (ISO 8601) */ created_at: string; /** Срок действия счета (ISO 8601), для счетов pending */ expires_at?: string; /** Описание счета, видимое пользователю */ description?: string; /** Детали отмены счета */ cancellation_details?: InvoiceCancellationDetails; /** Дополнительные метаданные (ключ-значение) */ metadata?: T; }