added ledger as souec of funds for payouts
This commit is contained in:
@@ -7,7 +7,7 @@ import 'package:logging/logging.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
import 'package:pshared/api/requests/payment/quote.dart';
|
||||
import 'package:pshared/controllers/balance_mask/wallets.dart';
|
||||
import 'package:pshared/controllers/payment/source.dart';
|
||||
import 'package:pshared/data/mapper/payment/intent/payment.dart';
|
||||
import 'package:pshared/models/asset.dart';
|
||||
import 'package:pshared/models/payment/intent.dart';
|
||||
@@ -36,6 +36,7 @@ class QuotationProvider extends ChangeNotifier {
|
||||
late OrganizationsProvider _organizations;
|
||||
bool _isLoaded = false;
|
||||
PaymentIntent? _lastIntent;
|
||||
String? _sourceCurrencyCode;
|
||||
final QuotationIntentBuilder _intentBuilder = QuotationIntentBuilder();
|
||||
final AutoRefreshScheduler _autoRefresh = AutoRefreshScheduler();
|
||||
AutoRefreshMode _autoRefreshMode = AutoRefreshMode.on;
|
||||
@@ -43,15 +44,16 @@ class QuotationProvider extends ChangeNotifier {
|
||||
void update(
|
||||
OrganizationsProvider venue,
|
||||
PaymentAmountProvider payment,
|
||||
WalletsController wallets,
|
||||
PaymentSourceController source,
|
||||
PaymentFlowProvider flow,
|
||||
RecipientsProvider recipients,
|
||||
PaymentMethodsProvider _,
|
||||
) {
|
||||
_organizations = venue;
|
||||
_sourceCurrencyCode = source.selectedCurrencyCode;
|
||||
final intent = _intentBuilder.build(
|
||||
payment: payment,
|
||||
wallets: wallets,
|
||||
source: source,
|
||||
flow: flow,
|
||||
recipients: recipients,
|
||||
);
|
||||
@@ -77,7 +79,12 @@ class QuotationProvider extends ChangeNotifier {
|
||||
}
|
||||
|
||||
Asset? get fee => _assetFromMoney(quoteFeeTotal(quotation));
|
||||
Asset? get total => _assetFromMoney(quotation?.amounts?.sourceDebitTotal);
|
||||
Asset? get total => _assetFromMoney(
|
||||
quoteSourceDebitTotal(
|
||||
quotation,
|
||||
preferredSourceCurrency: _sourceCurrencyCode,
|
||||
),
|
||||
);
|
||||
Asset? get recipientGets =>
|
||||
_assetFromMoney(quotation?.amounts?.destinationSettlement);
|
||||
|
||||
@@ -139,6 +146,7 @@ class QuotationProvider extends ChangeNotifier {
|
||||
void reset() {
|
||||
_isLoaded = false;
|
||||
_lastIntent = null;
|
||||
_sourceCurrencyCode = null;
|
||||
_setResource(Resource(data: null, isLoading: false, error: null));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user