mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Add support for not recognized payment methods
This commit is contained in:
parent
bf0489d5e7
commit
2f1ea286e0
@ -28,6 +28,7 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
// Don't use Enum as it breaks serialisation when changing entries and we want to stay flexible here
|
||||
public final class PaymentMethod implements Persistable, Comparable {
|
||||
@ -109,7 +110,11 @@ public final class PaymentMethod implements Persistable, Comparable {
|
||||
}
|
||||
|
||||
public static PaymentMethod getPaymentMethodById(String name) {
|
||||
return ALL_VALUES.stream().filter(e -> e.getId().equals(name)).findFirst().get();
|
||||
Optional<PaymentMethod> paymentMethodOptional = ALL_VALUES.stream().filter(e -> e.getId().equals(name)).findFirst();
|
||||
if (paymentMethodOptional.isPresent())
|
||||
return paymentMethodOptional.get();
|
||||
else
|
||||
return new PaymentMethod("N/A", 1, DAY, Coin.parseCoin("0"));
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
|
@ -160,6 +160,7 @@ TRANSFER_WISE=TransferWise
|
||||
US_POSTAL_MONEY_ORDER=US Postal money order
|
||||
BLOCK_CHAINS=Altcoins
|
||||
|
||||
N/A_SHORT=Not available
|
||||
OK_PAY_SHORT=OKPay
|
||||
PERFECT_MONEY_SHORT=Perfect Money
|
||||
ALI_PAY_SHORT=AliPay
|
||||
|
Loading…
Reference in New Issue
Block a user