changed color theme to be black and added the ability to enter the amount in the recipient’s currency
This commit is contained in:
@@ -22,6 +22,8 @@ import 'package:pshared/utils/currency.dart';
|
||||
import 'package:pshared/utils/payment/fx_helpers.dart';
|
||||
|
||||
class QuotationIntentBuilder {
|
||||
static const String _settlementCurrency = 'RUB';
|
||||
|
||||
PaymentIntent? build({
|
||||
required PaymentAmountProvider payment,
|
||||
required WalletsController wallets,
|
||||
@@ -39,10 +41,12 @@ class QuotationIntentBuilder {
|
||||
data: paymentData,
|
||||
);
|
||||
final sourceCurrency = currencyCodeToString(selectedWallet.currency);
|
||||
final amountCurrency = payment.settlementMode == SettlementMode.fixReceived
|
||||
? _settlementCurrency
|
||||
: sourceCurrency;
|
||||
final amount = Money(
|
||||
amount: payment.amount.toString(),
|
||||
// TODO: adapt to possible other sources
|
||||
currency: sourceCurrency,
|
||||
currency: amountCurrency,
|
||||
);
|
||||
final isCryptoToCrypto =
|
||||
paymentData is CryptoAddressPaymentMethod &&
|
||||
@@ -50,7 +54,7 @@ class QuotationIntentBuilder {
|
||||
amount.currency;
|
||||
final fxIntent = FxIntentHelper.buildSellBaseBuyQuote(
|
||||
baseCurrency: sourceCurrency,
|
||||
quoteCurrency: 'RUB', // TODO: exentd target currencies
|
||||
quoteCurrency: _settlementCurrency, // TODO: exentd target currencies
|
||||
enabled: !isCryptoToCrypto,
|
||||
);
|
||||
return PaymentIntent(
|
||||
@@ -68,7 +72,7 @@ class QuotationIntentBuilder {
|
||||
feeTreatment: payment.payerCoversFee
|
||||
? FeeTreatment.addToSource
|
||||
: FeeTreatment.deductFromDestination,
|
||||
settlementMode: SettlementMode.fixSource,
|
||||
settlementMode: payment.settlementMode,
|
||||
customer: customer,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user