mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-23 15:10:41 -04:00
support deleting payment accounts #1136
This commit is contained in:
parent
0a469db8f6
commit
9c359b5e29
4 changed files with 38 additions and 0 deletions
|
@ -496,6 +496,10 @@ public class CoreApi {
|
|||
tradeInstant);
|
||||
}
|
||||
|
||||
public void deletePaymentAccount(String paymentAccountId) {
|
||||
paymentAccountsService.deletePaymentAccount(paymentAccountId);
|
||||
}
|
||||
|
||||
public List<PaymentMethod> getCryptoCurrencyPaymentMethods() {
|
||||
return paymentAccountsService.getCryptoCurrencyPaymentMethods();
|
||||
}
|
||||
|
|
|
@ -145,6 +145,16 @@ class CorePaymentAccountsService {
|
|||
return cryptoCurrencyAccount;
|
||||
}
|
||||
|
||||
synchronized void deletePaymentAccount(String paymentAccountId) {
|
||||
accountService.checkAccountOpen();
|
||||
PaymentAccount paymentAccount = getPaymentAccount(paymentAccountId);
|
||||
if (paymentAccount == null) throw new IllegalArgumentException(format("Payment account with id %s not found", paymentAccountId));
|
||||
user.removePaymentAccount(paymentAccount);
|
||||
log.info("Deleted payment account with id {} and payment method {}.",
|
||||
paymentAccount.getId(),
|
||||
paymentAccount.getPaymentAccountPayload().getPaymentMethodId());
|
||||
}
|
||||
|
||||
// TODO Support all alt coin payment methods supported by UI.
|
||||
// The getCryptoCurrencyPaymentMethods method below will be
|
||||
// callable from the CLI when more are supported.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue