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;
|
|
|
|
|
|
|
|
|
|
YooMoneyHandler({
|
|
|
|
|
required String shopId,
|
|
|
|
|
required String secretKey,
|
|
|
|
|
}) : _shopId = shopId,
|
|
|
|
|
_secretKey = secretKey;
|
|
|
|
|
|
|
|
|
|
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 {
|
|
|
|
|
return YookassaPayment(
|
|
|
|
|
id: paymentId,
|
|
|
|
|
status: 'pending',
|
2025-11-16 11:25:27 +00:00
|
|
|
);
|
|
|
|
|
}
|
2025-12-13 13:27:05 +00:00
|
|
|
}
|