migration to address book service
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'package:pshared/models/payment/methods/type.dart';
|
||||
import 'package:pshared/models/payment/type.dart';
|
||||
|
||||
import 'package:pweb/utils/payment/masking.dart';
|
||||
|
||||
import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
|
||||
|
||||
@@ -15,3 +18,15 @@ String getPaymentTypeLabel(BuildContext context, PaymentType type) {
|
||||
PaymentType.cryptoAddress => l10n.paymentTypeCryptoAddress,
|
||||
};
|
||||
}
|
||||
|
||||
String? _displayString(PaymentMethod m) => switch (m.type) {
|
||||
PaymentType.card => maskCardNumber(m.cardData?.pan),
|
||||
PaymentType.bankAccount => m.bankAccountData?.accountNumber,
|
||||
PaymentType.iban => m.ibanData?.iban,
|
||||
PaymentType.wallet => m.walletData?.walletId,
|
||||
PaymentType.cryptoAddress => m.cryptoAddressData?.address,
|
||||
};
|
||||
|
||||
String getPaymentTypeDescription(BuildContext context, PaymentMethod m) {
|
||||
return _displayString(m) ?? AppLocalizations.of(context)!.notSet;
|
||||
}
|
||||
Reference in New Issue
Block a user