diff --git a/frontend/pshared/lib/api/requests/payment/quote.dart b/frontend/pshared/lib/api/requests/payment/quote.dart index b441e393..d398d954 100644 --- a/frontend/pshared/lib/api/requests/payment/quote.dart +++ b/frontend/pshared/lib/api/requests/payment/quote.dart @@ -9,6 +9,7 @@ part 'quote.g.dart'; @JsonSerializable() class QuotePaymentRequest extends PaymentBaseRequest { final PaymentIntentDTO intent; + final String? intentKey; @JsonKey(defaultValue: false) final bool previewOnly; @@ -17,6 +18,7 @@ class QuotePaymentRequest extends PaymentBaseRequest { required super.idempotencyKey, super.metadata, required this.intent, + this.intentKey, this.previewOnly = false, }); diff --git a/frontend/pshared/lib/provider/payment/quotation/quotation.dart b/frontend/pshared/lib/provider/payment/quotation/quotation.dart index f5f45c7d..ce2a39d3 100644 --- a/frontend/pshared/lib/provider/payment/quotation/quotation.dart +++ b/frontend/pshared/lib/provider/payment/quotation/quotation.dart @@ -91,12 +91,14 @@ class QuotationProvider extends ChangeNotifier { if (!_organizations.isOrganizationSet) throw StateError('Organization is not set'); _lastIntent = intent; try { + final intentKey = _buildIntentKey(intent); _setResource(_quotation.copyWith(isLoading: true, error: null)); final response = await QuotationService.getQuotation( _organizations.current.id, QuotePaymentRequest( idempotencyKey: Uuid().v4(), intent: intent.toDTO(), + intentKey: intentKey, ), ); _isLoaded = true;