mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
prevent calling unsupported payment method (#1836)
This commit is contained in:
parent
63f26c034f
commit
d8d4190608
2 changed files with 3 additions and 4 deletions
|
@ -145,7 +145,7 @@ class RobinhoodBuyProvider extends BuyProvider {
|
||||||
|
|
||||||
if (paymentType != null && paymentType != PaymentType.all) {
|
if (paymentType != null && paymentType != PaymentType.all) {
|
||||||
paymentMethod = normalizePaymentMethod(paymentType);
|
paymentMethod = normalizePaymentMethod(paymentType);
|
||||||
if (paymentMethod == null) paymentMethod = paymentType.name;
|
if (paymentMethod == null) return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
final action = isBuyAction ? 'buy' : 'sell';
|
final action = isBuyAction ? 'buy' : 'sell';
|
||||||
|
@ -185,6 +185,7 @@ class RobinhoodBuyProvider extends BuyProvider {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Supported payment methods:
|
||||||
// ● buying_power
|
// ● buying_power
|
||||||
// ● crypto_balance
|
// ● crypto_balance
|
||||||
// ● debit_card
|
// ● debit_card
|
||||||
|
|
|
@ -155,13 +155,11 @@ abstract class BuySellViewModelBase extends WalletChangeListenerViewModel with S
|
||||||
final hasSelectedPaymentMethod = selectedPaymentMethod != null;
|
final hasSelectedPaymentMethod = selectedPaymentMethod != null;
|
||||||
final isPaymentMethodLoaded = paymentMethodState is PaymentMethodLoaded;
|
final isPaymentMethodLoaded = paymentMethodState is PaymentMethodLoaded;
|
||||||
final isBuySellQuotLoaded = buySellQuotState is BuySellQuotLoaded;
|
final isBuySellQuotLoaded = buySellQuotState is BuySellQuotLoaded;
|
||||||
final isBuySellQuotFailed = buySellQuotState is BuySellQuotFailed;
|
|
||||||
|
|
||||||
return hasSelectedQuote &&
|
return hasSelectedQuote &&
|
||||||
hasSelectedPaymentMethod &&
|
hasSelectedPaymentMethod &&
|
||||||
isPaymentMethodLoaded &&
|
isPaymentMethodLoaded &&
|
||||||
isBuySellQuotLoaded &&
|
isBuySellQuotLoaded;
|
||||||
!isBuySellQuotFailed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@computed
|
@computed
|
||||||
|
|
Loading…
Reference in a new issue