+ quotation provider
This commit is contained in:
20
frontend/pshared/lib/service/payment/quotation.dart
Normal file
20
frontend/pshared/lib/service/payment/quotation.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
import 'package:pshared/api/requests/payment/quote.dart';
|
||||
import 'package:pshared/api/responses/payment/quotation.dart';
|
||||
import 'package:pshared/data/mapper/payment/payment_quote.dart';
|
||||
import 'package:pshared/models/payment/quote.dart';
|
||||
import 'package:pshared/service/services.dart';
|
||||
import 'package:pshared/utils/http/requests.dart';
|
||||
|
||||
|
||||
class QuotationService {
|
||||
static final _logger = Logger('service.payment.quotation');
|
||||
static const String _objectType = Services.payments;
|
||||
|
||||
static Future<PaymentQuote> getQuotation(String organizationRef, QuotePaymentRequest request) async {
|
||||
_logger.fine('Quoting payment for organization $organizationRef');
|
||||
final response = await getPOSTResponse(_objectType, '/quote/$organizationRef', request.toJson());
|
||||
return PaymentQuoteResponse.fromJson(response).quote.toDomain();
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,8 @@ class Services {
|
||||
|
||||
static const String recipients = 'recipients';
|
||||
static const String paymentMethods = 'payment_methods';
|
||||
static const String payments = 'payments';
|
||||
|
||||
static const String amplitude = 'amplitude';
|
||||
static const String clients = 'clients';
|
||||
static const String logo = 'logo';
|
||||
static const String notifications = 'notifications';
|
||||
|
||||
Reference in New Issue
Block a user