feat(sbp_payments): added cubit layer for sbp payments with tests

This commit is contained in:
misha
2026-07-09 18:35:09 +03:00
parent a0edfe942b
commit be924265a1
7 changed files with 422 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import 'package:eatvio_app/features/chat/models/payment_model.dart';
import 'package:eatvio_app/features/chat/services/chat_service.dart';
/// Репозиторий оплаты консультаций (chosen_plan) через Alfa Bank / СБП.
class PaymentRepository {
final ChatService chatService;
PaymentRepository({required this.chatService});
/// Запускает процесс оплаты: POST `/api/chosen_plans/{id}/start_payment_process`
/// с `payment_provider: alfa-bank`.
Future<PaymentModel> startPaymentProcess({required int planId}) async {
return chatService.getPaymentLink(
id: planId,
body: const {'payment_provider': 'alfa-bank'},
);
}
}