Skip to content

Commit

Permalink
Fix issue adding custom settlement methods
Browse files Browse the repository at this point in the history
  • Loading branch information
axpoems committed Aug 28, 2024
1 parent 802922d commit a326bb0
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void onActivate() {
boolean isCustomPaymentMethod = fiatPaymentMethod.isCustomPaymentMethod();
if (!isCustomPaymentMethod && isPredefinedPaymentMethodsContainName(name)) {
maybeAddFiatPaymentMethod(fiatPaymentMethod);
} else {
} else if (isCustomPaymentMethod) {
maybeAddCustomFiatPaymentMethod(fiatPaymentMethod);
}
}));
Expand All @@ -168,7 +168,10 @@ public void onActivate() {
return;
}
BitcoinPaymentMethod bitcoinPaymentMethod = BitcoinPaymentMethodUtil.getPaymentMethod(name);
maybeAddBitcoinPaymentMethod(bitcoinPaymentMethod);
boolean isCustomPaymentMethod = bitcoinPaymentMethod.isCustomPaymentMethod();
if (!isCustomPaymentMethod) {
maybeAddBitcoinPaymentMethod(bitcoinPaymentMethod);
}
}));
maybeAddOnChainPaymentMethodAsSelected();
}
Expand Down Expand Up @@ -311,7 +314,7 @@ private void maybeRemoveCustomFiatPaymentMethods() {
// To ensure backwards compatibility we need to drop custom fiat payment methods if the user has more than 3,
// which is the max allowed number of custom fiat payment methods per market
while (model.getAddedCustomFiatPaymentMethods().size() > MAX_ALLOWED_CUSTOM_FIAT_PAYMENTS) {
model.getAddedCustomFiatPaymentMethods().remove(model.getAddedCustomBitcoinPaymentMethods().size() - 1);
model.getAddedCustomFiatPaymentMethods().remove(model.getAddedCustomFiatPaymentMethods().size() - 1);
}
}

Expand Down

0 comments on commit a326bb0

Please sign in to comment.