mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 23:18:17 +01:00
Merge pull request #1557 from ManfredKarrer/remove-venmo-cashapp
Remove venmo cashapp
This commit is contained in:
commit
c013130bb1
6 changed files with 32 additions and 8 deletions
|
@ -40,6 +40,8 @@ import static bisq.desktop.util.FormBuilder.addLabelInputTextField;
|
||||||
import static bisq.desktop.util.FormBuilder.addLabelTextField;
|
import static bisq.desktop.util.FormBuilder.addLabelTextField;
|
||||||
import static bisq.desktop.util.FormBuilder.addLabelTextFieldWithCopyIcon;
|
import static bisq.desktop.util.FormBuilder.addLabelTextFieldWithCopyIcon;
|
||||||
|
|
||||||
|
// Removed due too high chargeback risk
|
||||||
|
@Deprecated
|
||||||
public class CashAppForm extends PaymentMethodForm {
|
public class CashAppForm extends PaymentMethodForm {
|
||||||
private final CashAppAccount account;
|
private final CashAppAccount account;
|
||||||
private final CashAppValidator validator;
|
private final CashAppValidator validator;
|
||||||
|
|
|
@ -40,6 +40,8 @@ import static bisq.desktop.util.FormBuilder.addLabelInputTextField;
|
||||||
import static bisq.desktop.util.FormBuilder.addLabelTextField;
|
import static bisq.desktop.util.FormBuilder.addLabelTextField;
|
||||||
import static bisq.desktop.util.FormBuilder.addLabelTextFieldWithCopyIcon;
|
import static bisq.desktop.util.FormBuilder.addLabelTextFieldWithCopyIcon;
|
||||||
|
|
||||||
|
// Removed due too high chargeback risk
|
||||||
|
@Deprecated
|
||||||
public class VenmoForm extends PaymentMethodForm {
|
public class VenmoForm extends PaymentMethodForm {
|
||||||
private final VenmoAccount account;
|
private final VenmoAccount account;
|
||||||
private final VenmoValidator validator;
|
private final VenmoValidator validator;
|
||||||
|
|
|
@ -44,7 +44,9 @@ import javafx.collections.ObservableList;
|
||||||
import javafx.collections.SetChangeListener;
|
import javafx.collections.SetChangeListener;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
class FiatAccountsDataModel extends ActivatableDataModel {
|
class FiatAccountsDataModel extends ActivatableDataModel {
|
||||||
|
@ -79,6 +81,22 @@ class FiatAccountsDataModel extends ActivatableDataModel {
|
||||||
protected void activate() {
|
protected void activate() {
|
||||||
user.getPaymentAccountsAsObservable().addListener(setChangeListener);
|
user.getPaymentAccountsAsObservable().addListener(setChangeListener);
|
||||||
fillAndSortPaymentAccounts();
|
fillAndSortPaymentAccounts();
|
||||||
|
|
||||||
|
final Set<PaymentAccount> paymentAccounts = user.getPaymentAccounts();
|
||||||
|
if (paymentAccounts != null) {
|
||||||
|
|
||||||
|
paymentAccounts.stream()
|
||||||
|
.filter(paymentAccount -> paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.VENMO_ID) ||
|
||||||
|
paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.CASH_APP_ID))
|
||||||
|
.forEach(paymentAccount -> {
|
||||||
|
// We try to clean up Venmo and CashApp accounts to be able to remove the code for those in
|
||||||
|
// later releases without breaking the persisted protobuffer data base files.
|
||||||
|
if (onDeleteAccount(paymentAccount)) {
|
||||||
|
log.info("We deleted a blocked Venmo or CashApp account. paymentAccount name={}",
|
||||||
|
paymentAccount.getAccountName());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fillAndSortPaymentAccounts() {
|
private void fillAndSortPaymentAccounts() {
|
||||||
|
@ -87,7 +105,7 @@ class FiatAccountsDataModel extends ActivatableDataModel {
|
||||||
.filter(paymentAccount -> !paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.BLOCK_CHAINS_ID))
|
.filter(paymentAccount -> !paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.BLOCK_CHAINS_ID))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
paymentAccounts.setAll(list);
|
paymentAccounts.setAll(list);
|
||||||
paymentAccounts.sort((o1, o2) -> o1.getCreationDate().compareTo(o2.getCreationDate()));
|
paymentAccounts.sort(Comparator.comparing(PaymentAccount::getCreationDate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,14 +147,10 @@ class FiatAccountsDataModel extends ActivatableDataModel {
|
||||||
|
|
||||||
public boolean onDeleteAccount(PaymentAccount paymentAccount) {
|
public boolean onDeleteAccount(PaymentAccount paymentAccount) {
|
||||||
boolean isPaymentAccountUsed = openOfferManager.getObservableList().stream()
|
boolean isPaymentAccountUsed = openOfferManager.getObservableList().stream()
|
||||||
.filter(o -> o.getOffer().getMakerPaymentAccountId().equals(paymentAccount.getId()))
|
.anyMatch(o -> o.getOffer().getMakerPaymentAccountId().equals(paymentAccount.getId()));
|
||||||
.findAny()
|
|
||||||
.isPresent();
|
|
||||||
isPaymentAccountUsed = isPaymentAccountUsed || tradeManager.getTradableList().stream()
|
isPaymentAccountUsed = isPaymentAccountUsed || tradeManager.getTradableList().stream()
|
||||||
.filter(t -> t.getOffer().getMakerPaymentAccountId().equals(paymentAccount.getId()) ||
|
.anyMatch(t -> t.getOffer().getMakerPaymentAccountId().equals(paymentAccount.getId()) ||
|
||||||
paymentAccount.getId().equals(t.getTakerPaymentAccountId()))
|
paymentAccount.getId().equals(t.getTakerPaymentAccountId()));
|
||||||
.findAny()
|
|
||||||
.isPresent();
|
|
||||||
if (!isPaymentAccountUsed)
|
if (!isPaymentAccountUsed)
|
||||||
user.removePaymentAccount(paymentAccount);
|
user.removePaymentAccount(paymentAccount);
|
||||||
return isPaymentAccountUsed;
|
return isPaymentAccountUsed;
|
||||||
|
|
|
@ -353,6 +353,8 @@ public class FiatAccountsView extends ActivatableViewAndModel<GridPane, FiatAcco
|
||||||
paymentMethodComboBox.setPrefWidth(250);
|
paymentMethodComboBox.setPrefWidth(250);
|
||||||
List<PaymentMethod> list = PaymentMethod.getAllValues().stream()
|
List<PaymentMethod> list = PaymentMethod.getAllValues().stream()
|
||||||
.filter(paymentMethod -> !paymentMethod.getId().equals(PaymentMethod.BLOCK_CHAINS_ID))
|
.filter(paymentMethod -> !paymentMethod.getId().equals(PaymentMethod.BLOCK_CHAINS_ID))
|
||||||
|
.filter(paymentMethod -> !paymentMethod.getId().equals(PaymentMethod.VENMO_ID))
|
||||||
|
.filter(paymentMethod -> !paymentMethod.getId().equals(PaymentMethod.CASH_APP_ID))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
paymentMethodComboBox.setItems(FXCollections.observableArrayList(list));
|
paymentMethodComboBox.setItems(FXCollections.observableArrayList(list));
|
||||||
paymentMethodComboBox.setConverter(new StringConverter<PaymentMethod>() {
|
paymentMethodComboBox.setConverter(new StringConverter<PaymentMethod>() {
|
||||||
|
|
|
@ -20,6 +20,8 @@ package bisq.desktop.util.validation;
|
||||||
|
|
||||||
import bisq.core.util.validation.InputValidator;
|
import bisq.core.util.validation.InputValidator;
|
||||||
|
|
||||||
|
// Removed due too high chargeback risk
|
||||||
|
@Deprecated
|
||||||
public final class CashAppValidator extends InputValidator {
|
public final class CashAppValidator extends InputValidator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -19,6 +19,8 @@ package bisq.desktop.util.validation;
|
||||||
|
|
||||||
import bisq.core.util.validation.InputValidator;
|
import bisq.core.util.validation.InputValidator;
|
||||||
|
|
||||||
|
// Removed due too high chargeback risk
|
||||||
|
@Deprecated
|
||||||
public final class VenmoValidator extends InputValidator {
|
public final class VenmoValidator extends InputValidator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue