mnemo_cards/mnemo_cards_backend/lib/api/purchase/yoo_money.dart

40 lines
965 B
Dart
Raw Normal View History

2025-11-16 11:25:27 +00:00
import 'package:injectable/injectable.dart';
2025-12-13 13:27:05 +00:00
/// Wrapper for YooKassa payment (simplified)
class YookassaPayment {
final String id;
final String status;
final String? confirmationUrl;
YookassaPayment({
required this.id,
required this.status,
this.confirmationUrl,
});
}
2025-11-16 11:25:27 +00:00
class YooMoneyHandler {
2025-12-13 13:27:05 +00:00
final String _shopId;
final String _secretKey;
2025-12-20 18:26:15 +00:00
YooMoneyHandler({required String shopId, required String secretKey})
: _shopId = shopId,
_secretKey = secretKey;
2025-12-13 13:27:05 +00:00
Future<YookassaPayment> createPayment({
required String amount,
required String description,
required String userId,
2025-11-16 11:25:27 +00:00
}) async {
2025-12-13 13:27:05 +00:00
return YookassaPayment(
id: 'test_payment_${DateTime.now().millisecondsSinceEpoch}',
status: 'pending',
confirmationUrl: 'https://yookassa.ru/payment/test',
2025-11-16 11:25:27 +00:00
);
}
2025-12-13 13:27:05 +00:00
Future<YookassaPayment> checkPayment(String paymentId) async {
2025-12-20 18:26:15 +00:00
return YookassaPayment(id: paymentId, status: 'pending');
2025-11-16 11:25:27 +00:00
}
2025-12-20 18:26:15 +00:00
}