Skip to content

Extended ConfirmationEmbedded interface #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions packages/nestjs-yookassa/src/interfaces/confirmation.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export interface ConfirmationRedirect {
* Тип для подтверждения через встроенную форму.
* Используется при встроенном подтверждении внутри текущего приложения.
*/
export interface ConfirmationEmbedded {
export interface ConfirmationEmbeddedRequest {
/**
* Тип подтверждения — встроенная форма.
*/
Expand Down Expand Up @@ -128,13 +128,41 @@ export interface ConfirmationMobileApp {
any: unknown
}

/**
* Тип для подтверждения через встроенную форму.
* Используется при встроенном подтверждении внутри текущего приложения.
*/
export interface ConfirmationEmbeddedResponse {
/**
* Тип подтверждения — встроенная форма.
*/
type: ConfirmationTypesEnum.embedded

/**
* Токен для инициализации виджета на клиенте.
*/
confirmation_token: string
}

/**
* Тип подтверждения используемый в запросе, который может быть одним из нескольких типов.
* @type {ConfirmationRedirect | ConfirmationEmbeddedRequest | ConfirmationQR | ConfirmationExternal | ConfirmationMobileApp}
*/
export type ConfirmationRequest =
| ConfirmationRedirect
| ConfirmationEmbeddedRequest
| ConfirmationQR
| ConfirmationExternal
| ConfirmationMobileApp


/**
* Тип подтверждения, который может быть одним из нескольких типов.
* @type {ConfirmationRedirect | ConfirmationEmbedded | ConfirmationQR | ConfirmationExternal | ConfirmationMobileApp}
* @type {ConfirmationRedirect | ConfirmationEmbeddedResponse | ConfirmationQR | ConfirmationExternal | ConfirmationMobileApp}
*/
export type Confirmation =
export type ConfirmationResponse =
| ConfirmationRedirect
| ConfirmationEmbedded
| ConfirmationEmbeddedResponse
| ConfirmationQR
| ConfirmationExternal
| ConfirmationMobileApp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Amount } from './common.interface'
import type { Confirmation } from './confirmation.interface'
import type { ConfirmationResponse } from './confirmation.interface'
import type { PaymentMethod } from './payment-method.interface'
import type { ReceiptRegistrationEnum } from './receipt-details.interface'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Amount } from './common.interface'
import type { Confirmation } from './confirmation.interface'
import type { ConfirmationRequest } from './confirmation.interface'
import type { PaymentMethod } from './payment-method.interface'

/**
Expand Down Expand Up @@ -52,7 +52,7 @@ export interface PaymentCreateRequest {
/**
* Тип подтверждения для платежа.
*/
confirmation: Confirmation
confirmation: ConfirmationRequest

/**
* Нужно ли сохранять метод платежа для будущих платежей.
Expand Down