Files
vitanovaPackages/packages/payment/src/payment.models.ts
sdarbinyan 5ffc1b1450
Some checks failed
Release / release-branches (auth) (push) Has been cancelled
Release / release-branches (payment) (push) Has been cancelled
Release / version-pr (push) Has been cancelled
feat(packages): add standalone auth and payment
2026-08-21 08:08:42 +04:00

19 lines
851 B
TypeScript

export type PaymentMethod = 'qr' | 'card' | 'sbp' | 'yandex-pay';
export type PaymentStatus = 'created' | 'pending' | 'authorized' | 'paid' | 'failed' | 'cancelled' | 'expired';
/** Central payment API resolves amount/currency/routing from this server checkout id. */
export interface PaymentRequest { checkoutSessionId: string; returnUrl?: string; metadata?: Readonly<Record<string, string>>; }
export interface PaymentAttempt {
paymentId: string;
method: PaymentMethod;
status: PaymentStatus;
action?: { type: 'redirect' | 'qr'; url: string };
failureMessage?: string;
}
export interface PaymentResult extends PaymentAttempt { status: 'paid' | 'authorized'; }
export interface PaymentFailure {
method: PaymentMethod;
code: 'configuration' | 'backend' | 'declined' | 'expired' | 'popup_blocked';
message: string;
cause?: unknown;
}