
Product
Introducing GitHub Actions Scanning Support
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.
@exact-team/freekassa-sdk-nestjs
Advanced tools
FreeKassa SDK Module для NestJS - это модуль для интеграции платежной системы FreeKassa в ваши NestJS приложения. Модуль предоставляет удобный интерфейс для работы с API FreeKassa и автоматически управляет жизненным циклом SDK.
npm install @exact-team/freekassa-sdk-nestjs @exact-team/freekassa-sdk
src/
├── common/ # Общие утилиты и константы
├── decorators/ # Декораторы для внедрения зависимостей
├── interfaces/ # Интерфейсы и типы
├── freekassa-sdk-nestjs.module.ts # Основной модуль
└── freekassa-sdk-nestjs.builder.ts # Билдер для конфигурации
key - API ключ для подписи запросовsecretWord1 - Первое секретное слово для подписи платежных формsecretWord2 - Второе секретное слово для проверки уведомленийshopId - ID вашего магазинаlang - Язык интерфейса (ru или en)currency - Валюта платежей (RUB, USD, EUR, UAH, KZT)payUrl - URL платежной формы (по умолчанию: https://pay.fk.money/)apiUrl - URL API (по умолчанию: https://api.fk.life/v1/)import { FreeKassaSdkNestjsModule } from '@exact-team/freekassa-sdk-nestjs';
@Module({
imports: [
FreeKassaSdkNestjsModule.forRoot({
key: 'your-api-key',
secretWord1: 'your-secret-word-1',
secretWord2: 'your-secret-word-2',
shopId: 12345,
lang: 'ru',
currency: 'RUB',
payUrl: 'https://pay.fk.money/',
apiUrl: 'https://api.fk.life/v1/',
}),
],
})
export class AppModule {}
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { ConfigService } from '@nestjs/config';
import { FreeKassaSdkNestjsModule } from '@exact-team/freekassa-sdk-nestjs';
import { IFreekassaModuleOptions } from '@exact-team/freekassa-sdk-nestjs';
@Module({
imports: [
FreeKassaSdkNestjsModule.forRootAsync({
imports: [ConfigModule],
useFactory: async (configService: ConfigService): Promise<IFreekassaModuleOptions> => ({
key: configService.getOrThrow('FREEKASSA_API_KEY'),
secretWord1: configService.getOrThrow('FREEKASSA_SECRET_WORD_1'),
secretWord2: configService.getOrThrow('FREEKASSA_SECRET_WORD_2'),
shopId: Number(configService.getOrThrow('FREEKASSA_SHOP_ID')),
lang: 'ru',
currency: 'RUB',
payUrl: 'https://pay.fk.money/',
apiUrl: 'https://api.fk.life/v1/',
}),
inject: [ConfigService],
}),
],
})
export class AppModule {}
import { Injectable } from '@nestjs/common';
import { InjectFreeKassa } from '@exact-team/freekassa-sdk-nestjs';
import { FreeKassa } from '@exact-team/freekassa-sdk';
@Injectable()
export class PaymentService {
constructor(@InjectFreeKassa() private readonly freekassa: FreeKassa) {}
async createPayment(amount: number, currency: string) {
return this.freekassa.createPayment({
methodId: 1,
email: 'customer@example.com',
ip: '127.0.0.1',
amount,
paymentId: new Date().getTime().toString(),
});
}
async verifyNotification(notification: any) {
return this.freekassa.verifyNotification(notification);
}
}
forRoot(options: IFreekassaModuleOptions): Статический метод для синхронной конфигурации модуляforRootAsync(options: AsyncModuleOptions): Статический метод для асинхронной конфигурации модуля@InjectFreeKassa(): Декоратор для внедрения экземпляра FreeKassa SDKМодуль предоставляет типизированные ошибки для всех возможных ситуаций:
try {
await this.freekassa.createPayment({
methodId: 1,
email: 'example@mail.ru',
ip: '127.0.0.1',
amount: 10,
paymentId: new Date().getTime().toString(),
});
} catch (error) {
// Обработка ошибок FreeKassa
console.error(error);
}
# Сборка проекта
npm run build
# Запуск линтера
npm run lint
Проект использует ESLint и Prettier для поддержания качества кода.
Для тестирования модуля рекомендуется:
ISC
exact01
Для получения поддержки или сообщения об ошибках, пожалуйста, создайте issue в репозитории проекта.
FAQs
freekassa sdk for nestjs
We found that @exact-team/freekassa-sdk-nestjs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.

Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.

Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.