refactoring for recipient addition page
This commit is contained in:
26
frontend/pweb/lib/utils/payment/availability.dart
Normal file
26
frontend/pweb/lib/utils/payment/availability.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
import 'package:pshared/models/payment/methods/data.dart';
|
||||
import 'package:pshared/models/payment/type.dart';
|
||||
|
||||
const List<PaymentType> enabledPaymentTypes = [
|
||||
PaymentType.card,
|
||||
PaymentType.ledger,
|
||||
PaymentType.externalChain,
|
||||
];
|
||||
|
||||
const List<PaymentType> previewPaymentTypes = [
|
||||
PaymentType.bankAccount,
|
||||
];
|
||||
|
||||
const List<PaymentType> visiblePaymentTypes = [
|
||||
...enabledPaymentTypes,
|
||||
...previewPaymentTypes,
|
||||
];
|
||||
|
||||
const Set<PaymentType> disabledPaymentTypes = {
|
||||
PaymentType.bankAccount,
|
||||
};
|
||||
|
||||
MethodMap filterVisiblePaymentTypes(MethodMap source) => {
|
||||
for (final type in visiblePaymentTypes)
|
||||
if (source.containsKey(type)) type: source[type],
|
||||
};
|
||||
Reference in New Issue
Block a user