Search in sources :

Example 1 with SpecificBanksAccountPayload

use of bisq.core.payment.payload.SpecificBanksAccountPayload in project bisq-desktop by bisq-network.

the class OfferBookViewModelTest method getSpecificBanksAccount.

private PaymentAccount getSpecificBanksAccount(String currencyCode, String countryCode, String bankId, ArrayList<String> bankIds) {
    SpecificBanksAccount paymentAccount = new SpecificBanksAccount();
    paymentAccount.setSingleTradeCurrency(new FiatCurrency(currencyCode));
    paymentAccount.setCountry(new Country(countryCode, null, null));
    ((SpecificBanksAccountPayload) paymentAccount.getPaymentAccountPayload()).setBankId(bankId);
    bankIds.forEach(((SpecificBanksAccountPayload) paymentAccount.getPaymentAccountPayload())::addAcceptedBank);
    return paymentAccount;
}
Also used : Country(bisq.core.locale.Country) SpecificBanksAccountPayload(bisq.core.payment.payload.SpecificBanksAccountPayload) FiatCurrency(bisq.core.locale.FiatCurrency) SpecificBanksAccount(bisq.core.payment.SpecificBanksAccount)

Example 2 with SpecificBanksAccountPayload

use of bisq.core.payment.payload.SpecificBanksAccountPayload in project bisq-api by mrosseel.

the class SpecificBanksAccountPaymentAccountConverter method toBusinessModel.

@Override
public SpecificBanksAccount toBusinessModel(SpecificBanksAccountPaymentAccount rest) {
    final SpecificBanksAccount business = new SpecificBanksAccount();
    business.init();
    final SpecificBanksAccountPayload paymentAccountPayload = (SpecificBanksAccountPayload) business.getPaymentAccountPayload();
    paymentAccountPayload.setAccountNr(rest.accountNr);
    paymentAccountPayload.setAccountType(rest.accountType);
    paymentAccountPayload.setBankId(rest.bankId);
    paymentAccountPayload.setBankName(rest.bankName);
    paymentAccountPayload.setBranchId(rest.branchId);
    paymentAccountPayload.setCountryCode(rest.countryCode);
    paymentAccountPayload.setHolderName(rest.holderName);
    paymentAccountPayload.setHolderTaxId(rest.holderTaxId);
    rest.acceptedBanks.stream().forEach(paymentAccountPayload::addAcceptedBank);
    toBusinessModel(business, rest);
    return business;
}
Also used : SpecificBanksAccountPayload(bisq.core.payment.payload.SpecificBanksAccountPayload) SpecificBanksAccount(bisq.core.payment.SpecificBanksAccount)

Aggregations

SpecificBanksAccount (bisq.core.payment.SpecificBanksAccount)2 SpecificBanksAccountPayload (bisq.core.payment.payload.SpecificBanksAccountPayload)2 Country (bisq.core.locale.Country)1 FiatCurrency (bisq.core.locale.FiatCurrency)1