From 197a0ba61013aa01cea80793c62e333c5eac3184 Mon Sep 17 00:00:00 2001 From: Stephan D Date: Mon, 26 Jan 2026 01:22:12 +0100 Subject: [PATCH] fixed idempotency key --- frontend/pshared/lib/api/requests/payment/quote.dart | 2 +- .../lib/provider/payment/quotation/quotation.dart | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/frontend/pshared/lib/api/requests/payment/quote.dart b/frontend/pshared/lib/api/requests/payment/quote.dart index ee253367..b441e393 100644 --- a/frontend/pshared/lib/api/requests/payment/quote.dart +++ b/frontend/pshared/lib/api/requests/payment/quote.dart @@ -1,6 +1,6 @@ import 'package:json_annotation/json_annotation.dart'; -import 'package:pshared/api/requests/payment/base.dart'; +import 'package:pshared/api/requests/payment/base.dart'; import 'package:pshared/data/dto/payment/intent/payment.dart'; part 'quote.g.dart'; diff --git a/frontend/pshared/lib/provider/payment/quotation/quotation.dart b/frontend/pshared/lib/provider/payment/quotation/quotation.dart index b1af4dda..f5f45c7d 100644 --- a/frontend/pshared/lib/provider/payment/quotation/quotation.dart +++ b/frontend/pshared/lib/provider/payment/quotation/quotation.dart @@ -51,7 +51,7 @@ class QuotationProvider extends ChangeNotifier { final intentKey = _buildIntentKey(intent); final lastIntent = _lastIntent; if (lastIntent != null && intentKey == _buildIntentKey(lastIntent)) return; - getQuotation(intent, idempotencyKey: intentKey); + getQuotation(intent); } PaymentQuote? get quotation => _quotation.data; @@ -84,19 +84,18 @@ class QuotationProvider extends ChangeNotifier { Future refreshQuotation() async { final intent = _lastIntent; if (intent == null) return null; - return getQuotation(intent, idempotencyKey: _buildIntentKey(intent)); + return getQuotation(intent); } - Future getQuotation(PaymentIntent intent, {String? idempotencyKey}) async { + Future getQuotation(PaymentIntent intent) async { if (!_organizations.isOrganizationSet) throw StateError('Organization is not set'); _lastIntent = intent; - final intentKey = idempotencyKey ?? _buildIntentKey(intent); try { _setResource(_quotation.copyWith(isLoading: true, error: null)); final response = await QuotationService.getQuotation( _organizations.current.id, QuotePaymentRequest( - idempotencyKey: intentKey, + idempotencyKey: Uuid().v4(), intent: intent.toDTO(), ), );