Merge pull request 'fixed idempotency key' (#323) from front-320 into main
All checks were successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/discovery Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/gateway_chain Pipeline was successful
ci/woodpecker/push/gateway_mntx Pipeline was successful
ci/woodpecker/push/gateway_tgsettle Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful

Reviewed-on: #323
This commit was merged in pull request #323.
This commit is contained in:
2026-01-26 01:08:31 +00:00
2 changed files with 5 additions and 6 deletions

View File

@@ -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';

View File

@@ -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<PaymentQuote?> refreshQuotation() async {
final intent = _lastIntent;
if (intent == null) return null;
return getQuotation(intent, idempotencyKey: _buildIntentKey(intent));
return getQuotation(intent);
}
Future<PaymentQuote?> getQuotation(PaymentIntent intent, {String? idempotencyKey}) async {
Future<PaymentQuote?> 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(),
),
);