file_name
stringlengths
6
86
file_path
stringlengths
45
249
content
stringlengths
47
6.26M
file_size
int64
47
6.26M
language
stringclasses
1 value
extension
stringclasses
1 value
repo_name
stringclasses
767 values
repo_stars
int64
8
14.4k
repo_forks
int64
0
1.17k
repo_open_issues
int64
0
788
repo_created_at
stringclasses
767 values
repo_pushed_at
stringclasses
767 values
DateTimeMapper.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/comdirect-adapter/src/main/java/de/adorsys/xs2a/adapter/comdirect/mapper/DateTimeMapper.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.comdirect.mapper; import java.time.LocalDateTime; import java.time.OffsetDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; public interface DateTimeMapper { default OffsetDateTime toOffsetDateTime(LocalDateTime dateTime) { if (dateTime == null) { return null; } return ZonedDateTime.of(dateTime, ZoneId.of("Europe/Berlin")).toOffsetDateTime(); } }
1,273
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
ComdirectBalanceReport.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/comdirect-adapter/src/main/java/de/adorsys/xs2a/adapter/comdirect/model/ComdirectBalanceReport.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.comdirect.model; import de.adorsys.xs2a.adapter.api.model.AccountReference; import java.util.List; public class ComdirectBalanceReport { private List<ComdirectBalance> balances; private AccountReference account; public List<ComdirectBalance> getBalances() { return balances; } public void setBalances(List<ComdirectBalance> balances) { this.balances = balances; } public AccountReference getAccount() { return account; } public void setAccount(AccountReference account) { this.account = account; } }
1,441
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
ComdirectTransactionDetails.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/comdirect-adapter/src/main/java/de/adorsys/xs2a/adapter/comdirect/model/ComdirectTransactionDetails.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.comdirect.model; import com.fasterxml.jackson.annotation.JsonProperty; import de.adorsys.xs2a.adapter.api.model.*; import java.time.LocalDate; import java.util.List; import java.util.Map; import java.util.Objects; public class ComdirectTransactionDetails { private String transactionId; private String entryReference; private String endToEndId; private String mandateId; private String checkId; private String creditorId; private LocalDate bookingDate; private LocalDate valueDate; private Amount transactionAmount; private List<ReportExchangeRate> currencyExchange; private String creditorName; private AccountReference creditorAccount; private String creditorAgent; private String ultimateCreditor; private String debtorName; private AccountReference debtorAccount; private String debtorAgent; private String ultimateDebtor; private String remittanceInformationUnstructured; private List<String> remittanceInformationUnstructuredArray; private RemittanceInformationStructured remittanceInformationStructured; private List<RemittanceInformationStructured> remittanceInformationStructuredArray; private String additionalInformation; private AdditionalInformationStructured additionalInformationStructured; private PurposeCode purposeCode; private String bankTransactionCode; private String proprietaryBankTransactionCode; private Balance balanceAfterTransaction; @JsonProperty("_links") private Map<String, HrefType> links; public String getTransactionId() { return transactionId; } public void setTransactionId(String transactionId) { this.transactionId = transactionId; } public String getEntryReference() { return entryReference; } public void setEntryReference(String entryReference) { this.entryReference = entryReference; } public String getEndToEndId() { return endToEndId; } public void setEndToEndId(String endToEndId) { this.endToEndId = endToEndId; } public String getMandateId() { return mandateId; } public void setMandateId(String mandateId) { this.mandateId = mandateId; } public String getCheckId() { return checkId; } public void setCheckId(String checkId) { this.checkId = checkId; } public String getCreditorId() { return creditorId; } public void setCreditorId(String creditorId) { this.creditorId = creditorId; } public LocalDate getBookingDate() { return bookingDate; } public void setBookingDate(LocalDate bookingDate) { this.bookingDate = bookingDate; } public LocalDate getValueDate() { return valueDate; } public void setValueDate(LocalDate valueDate) { this.valueDate = valueDate; } public Amount getTransactionAmount() { return transactionAmount; } public void setTransactionAmount(Amount transactionAmount) { this.transactionAmount = transactionAmount; } public List<ReportExchangeRate> getCurrencyExchange() { return currencyExchange; } public void setCurrencyExchange(List<ReportExchangeRate> currencyExchange) { this.currencyExchange = currencyExchange; } public String getCreditorName() { return creditorName; } public void setCreditorName(String creditorName) { this.creditorName = creditorName; } public AccountReference getCreditorAccount() { return creditorAccount; } public void setCreditorAccount(AccountReference creditorAccount) { this.creditorAccount = creditorAccount; } public String getCreditorAgent() { return creditorAgent; } public void setCreditorAgent(String creditorAgent) { this.creditorAgent = creditorAgent; } public String getUltimateCreditor() { return ultimateCreditor; } public void setUltimateCreditor(String ultimateCreditor) { this.ultimateCreditor = ultimateCreditor; } public String getDebtorName() { return debtorName; } public void setDebtorName(String debtorName) { this.debtorName = debtorName; } public AccountReference getDebtorAccount() { return debtorAccount; } public void setDebtorAccount(AccountReference debtorAccount) { this.debtorAccount = debtorAccount; } public String getDebtorAgent() { return debtorAgent; } public void setDebtorAgent(String debtorAgent) { this.debtorAgent = debtorAgent; } public String getUltimateDebtor() { return ultimateDebtor; } public void setUltimateDebtor(String ultimateDebtor) { this.ultimateDebtor = ultimateDebtor; } public String getRemittanceInformationUnstructured() { return remittanceInformationUnstructured; } public void setRemittanceInformationUnstructured(String remittanceInformationUnstructured) { this.remittanceInformationUnstructured = remittanceInformationUnstructured; } public List<String> getRemittanceInformationUnstructuredArray() { return remittanceInformationUnstructuredArray; } public void setRemittanceInformationUnstructuredArray( List<String> remittanceInformationUnstructuredArray) { this.remittanceInformationUnstructuredArray = remittanceInformationUnstructuredArray; } public RemittanceInformationStructured getRemittanceInformationStructured() { return remittanceInformationStructured; } public void setRemittanceInformationStructured(RemittanceInformationStructured remittanceInformationStructured) { this.remittanceInformationStructured = remittanceInformationStructured; } public List<RemittanceInformationStructured> getRemittanceInformationStructuredArray() { return remittanceInformationStructuredArray; } public void setRemittanceInformationStructuredArray( List<RemittanceInformationStructured> remittanceInformationStructuredArray) { this.remittanceInformationStructuredArray = remittanceInformationStructuredArray; } public String getAdditionalInformation() { return additionalInformation; } public void setAdditionalInformation(String additionalInformation) { this.additionalInformation = additionalInformation; } public AdditionalInformationStructured getAdditionalInformationStructured() { return additionalInformationStructured; } public void setAdditionalInformationStructured( AdditionalInformationStructured additionalInformationStructured) { this.additionalInformationStructured = additionalInformationStructured; } public PurposeCode getPurposeCode() { return purposeCode; } public void setPurposeCode(PurposeCode purposeCode) { this.purposeCode = purposeCode; } public String getBankTransactionCode() { return bankTransactionCode; } public void setBankTransactionCode(String bankTransactionCode) { this.bankTransactionCode = bankTransactionCode; } public String getProprietaryBankTransactionCode() { return proprietaryBankTransactionCode; } public void setProprietaryBankTransactionCode(String proprietaryBankTransactionCode) { this.proprietaryBankTransactionCode = proprietaryBankTransactionCode; } public Balance getBalanceAfterTransaction() { return balanceAfterTransaction; } public void setBalanceAfterTransaction(Balance balanceAfterTransaction) { this.balanceAfterTransaction = balanceAfterTransaction; } public Map<String, HrefType> getLinks() { return links; } public void setLinks(Map<String, HrefType> links) { this.links = links; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ComdirectTransactionDetails that = (ComdirectTransactionDetails) o; return Objects.equals(transactionId, that.transactionId) && Objects.equals(entryReference, that.entryReference) && Objects.equals(endToEndId, that.endToEndId) && Objects.equals(mandateId, that.mandateId) && Objects.equals(checkId, that.checkId) && Objects.equals(creditorId, that.creditorId) && Objects.equals(bookingDate, that.bookingDate) && Objects.equals(valueDate, that.valueDate) && Objects.equals(transactionAmount, that.transactionAmount) && Objects.equals(currencyExchange, that.currencyExchange) && Objects.equals(creditorName, that.creditorName) && Objects.equals(creditorAccount, that.creditorAccount) && Objects.equals(creditorAgent, that.creditorAgent) && Objects.equals(ultimateCreditor, that.ultimateCreditor) && Objects.equals(debtorName, that.debtorName) && Objects.equals(debtorAccount, that.debtorAccount) && Objects.equals(debtorAgent, that.debtorAgent) && Objects.equals(ultimateDebtor, that.ultimateDebtor) && Objects.equals(remittanceInformationUnstructured, that.remittanceInformationUnstructured) && Objects.equals(remittanceInformationUnstructuredArray, that.remittanceInformationUnstructuredArray) && Objects.equals(remittanceInformationStructured, that.remittanceInformationStructured) && Objects.equals(remittanceInformationStructuredArray, that.remittanceInformationStructuredArray) && Objects.equals(additionalInformation, that.additionalInformation) && Objects.equals(additionalInformationStructured, that.additionalInformationStructured) && Objects.equals(purposeCode, that.purposeCode) && Objects.equals(bankTransactionCode, that.bankTransactionCode) && Objects.equals(proprietaryBankTransactionCode, that.proprietaryBankTransactionCode) && Objects.equals(balanceAfterTransaction, that.balanceAfterTransaction) && Objects.equals(links, that.links); } @Override public int hashCode() { return Objects.hash(transactionId, entryReference, endToEndId, mandateId, checkId, creditorId, bookingDate, valueDate, transactionAmount, currencyExchange, creditorName, creditorAccount, creditorAgent, ultimateCreditor, debtorName, debtorAccount, debtorAgent, ultimateDebtor, remittanceInformationUnstructured, remittanceInformationUnstructuredArray, remittanceInformationStructured, remittanceInformationStructuredArray, additionalInformation, additionalInformationStructured, purposeCode, bankTransactionCode, proprietaryBankTransactionCode, balanceAfterTransaction, links); } }
12,140
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
ComdirectBalance.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/comdirect-adapter/src/main/java/de/adorsys/xs2a/adapter/comdirect/model/ComdirectBalance.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.comdirect.model; import de.adorsys.xs2a.adapter.api.model.Amount; import de.adorsys.xs2a.adapter.api.model.BalanceType; import java.time.LocalDate; import java.time.LocalDateTime; public class ComdirectBalance { private Amount balanceAmount; private BalanceType balanceType; private LocalDateTime lastChangeDateTime; private LocalDate referenceDate; private String lastCommittedTransaction; public Amount getBalanceAmount() { return balanceAmount; } public void setBalanceAmount(Amount balanceAmount) { this.balanceAmount = balanceAmount; } public BalanceType getBalanceType() { return balanceType; } public void setBalanceType(BalanceType balanceType) { this.balanceType = balanceType; } public LocalDateTime getLastChangeDateTime() { return lastChangeDateTime; } public void setLastChangeDateTime(LocalDateTime lastChangeDateTime) { this.lastChangeDateTime = lastChangeDateTime; } public LocalDate getReferenceDate() { return referenceDate; } public void setReferenceDate(LocalDate referenceDate) { this.referenceDate = referenceDate; } public String getLastCommittedTransaction() { return lastCommittedTransaction; } public void setLastCommittedTransaction(String lastCommittedTransaction) { this.lastCommittedTransaction = lastCommittedTransaction; } }
2,312
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
ComdirectTransactionResponse200Json.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/comdirect-adapter/src/main/java/de/adorsys/xs2a/adapter/comdirect/model/ComdirectTransactionResponse200Json.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.comdirect.model; import com.fasterxml.jackson.annotation.JsonProperty; import de.adorsys.xs2a.adapter.api.model.*; import java.util.List; import java.util.Map; import java.util.Objects; public class ComdirectTransactionResponse200Json { private AccountReference account; private ComdirectAccountReport transactions; private List<ComdirectBalance> balances; @JsonProperty("_links") private Map<String, HrefType> links; public AccountReference getAccount() { return account; } public void setAccount(AccountReference account) { this.account = account; } public ComdirectAccountReport getTransactions() { return transactions; } public void setTransactions(ComdirectAccountReport transactions) { this.transactions = transactions; } public List<ComdirectBalance> getBalances() { return balances; } public void setBalances(List<ComdirectBalance> balances) { this.balances = balances; } public Map<String, HrefType> getLinks() { return links; } public void setLinks(Map<String, HrefType> links) { this.links = links; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ComdirectTransactionResponse200Json that = (ComdirectTransactionResponse200Json) o; return Objects.equals(account, that.account) && Objects.equals(transactions, that.transactions) && Objects.equals(balances, that.balances) && Objects.equals(links, that.links); } @Override public int hashCode() { return Objects.hash(account, transactions, balances, links); } }
2,665
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
ComdirectOK200TransactionDetails.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/comdirect-adapter/src/main/java/de/adorsys/xs2a/adapter/comdirect/model/ComdirectOK200TransactionDetails.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.comdirect.model; import java.util.Objects; public class ComdirectOK200TransactionDetails { private ComdirectTransactionDetails transactionsDetails; public ComdirectTransactionDetails getTransactionsDetails() { return transactionsDetails; } public void setTransactionsDetails(ComdirectTransactionDetails transactionsDetails) { this.transactionsDetails = transactionsDetails; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ComdirectOK200TransactionDetails that = (ComdirectOK200TransactionDetails) o; return Objects.equals(transactionsDetails, that.transactionsDetails); } @Override public int hashCode() { return Objects.hash(transactionsDetails); } }
1,705
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
ComdirectAccountReport.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/comdirect-adapter/src/main/java/de/adorsys/xs2a/adapter/comdirect/model/ComdirectAccountReport.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.comdirect.model; import com.fasterxml.jackson.annotation.JsonProperty; import de.adorsys.xs2a.adapter.api.model.HrefType; import java.util.List; import java.util.Map; import java.util.Objects; public class ComdirectAccountReport { private List<ComdirectTransactionDetails> booked; private List<ComdirectTransactionDetails> pending; @JsonProperty("_links") private Map<String, HrefType> links; public List<ComdirectTransactionDetails> getBooked() { return booked; } public void setBooked(List<ComdirectTransactionDetails> booked) { this.booked = booked; } public List<ComdirectTransactionDetails> getPending() { return pending; } public void setPending(List<ComdirectTransactionDetails> pending) { this.pending = pending; } public Map<String, HrefType> getLinks() { return links; } public void setLinks(Map<String, HrefType> links) { this.links = links; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ComdirectAccountReport that = (ComdirectAccountReport) o; return Objects.equals(booked, that.booked) && Objects.equals(pending, that.pending) && Objects.equals(links, that.links); } @Override public int hashCode() { return Objects.hash(booked, pending, links); } }
2,348
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdorsysPaymentInitiationServiceWireMockTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/test/java/de/adorsys/xs2a/adapter/adorsys/AdorsysPaymentInitiationServiceWireMockTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.github.tomakehurst.wiremock.WireMockServer; import de.adorsys.xs2a.adapter.api.PaymentInitiationService; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.RequestParams; import de.adorsys.xs2a.adapter.api.Response; import de.adorsys.xs2a.adapter.api.http.HttpClient; import de.adorsys.xs2a.adapter.api.http.HttpClientConfig; import de.adorsys.xs2a.adapter.api.http.HttpClientFactory; import de.adorsys.xs2a.adapter.api.link.LinksRewriter; import de.adorsys.xs2a.adapter.api.model.*; import de.adorsys.xs2a.adapter.impl.http.ApacheHttpClient; import de.adorsys.xs2a.adapter.impl.http.BaseHttpClientConfig; import de.adorsys.xs2a.adapter.impl.http.JacksonObjectMapper; import de.adorsys.xs2a.adapter.impl.http.Xs2aHttpLogSanitizer; import de.adorsys.xs2a.adapter.impl.link.identity.IdentityLinksRewriter; import org.apache.http.HttpStatus; import org.apache.http.impl.client.HttpClientBuilder; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import pro.javatar.commons.reader.JsonReader; import pro.javatar.commons.reader.ResourceReader; import java.io.IOException; import java.util.EnumMap; import java.util.Map; import java.util.NoSuchElementException; import java.util.Optional; import java.util.stream.Stream; import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.params.provider.Arguments.arguments; class AdorsysPaymentInitiationServiceWireMockTest { private static final String PAYMENT_ID = "W_pFk5-4OqzsXpxKLs9h97q8bfPnV3XKAm5MxM8dnT60LxXyPaGedv4HPQtEQ8-mcgftJbETkzvNvu5mZQqWcA==_=_psGLvQpt9Q"; private static final String AUTHORISATION_ID = "259b8215-d14e-493a-ba01-c2243a9ff86a"; private final ObjectMapper objectMapper = new JacksonObjectMapper().copyObjectMapper() .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); private ResourceReader reader = JsonReader.getInstance(objectMapper); private static PaymentInitiationService service; private static WireMockServer wireMockServer; private static final Ids paymentIds = new Ids() .add(PaymentService.PAYMENTS, PaymentProduct.SEPA_CREDIT_TRANSFERS, PAYMENT_ID); private static final Ids authorisationIds = new Ids() .add(PaymentService.PAYMENTS, PaymentProduct.SEPA_CREDIT_TRANSFERS, AUTHORISATION_ID); @BeforeAll static void beforeAll() { wireMockServer = new WireMockServer(wireMockConfig() .port(8189) .usingFilesUnderClasspath("adorsys-adapter")); wireMockServer.start(); HttpClient httpClient = new ApacheHttpClient(new Xs2aHttpLogSanitizer(), HttpClientBuilder.create().build()); HttpClientConfig clientConfig = new BaseHttpClientConfig(null, null, null); HttpClientFactory httpClientFactory = getHttpClientFactory(httpClient, clientConfig); LinksRewriter linksRewriter = new IdentityLinksRewriter(); Aspsp aspsp = new Aspsp(); aspsp.setUrl("http://localhost:" + wireMockServer.port()); service = new AdorsysIntegServiceProvider().getPaymentInitiationService(aspsp, httpClientFactory, linksRewriter); } private static HttpClientFactory getHttpClientFactory(HttpClient httpClient, HttpClientConfig config) { return new HttpClientFactory() { @Override public HttpClient getHttpClient(String adapterId, String qwacAlias, String[] supportedCipherSuites) { return httpClient; } @Override public HttpClientConfig getHttpClientConfig() { return config; } }; } @AfterAll static void afterAll() { wireMockServer.stop(); } @Test void initiatePayment_Payments() throws IOException { Map<String, String> headersMap = reader.getObjectFromFile("pis/initiate-payment-request-headers.json", Map.class); PaymentInitiationJson paymentInitiationJson = reader.getObjectFromFile("pis/payments/sepa-credit-transfers/initiate-payment-request-body.json", PaymentInitiationJson.class); PaymentInitationRequestResponse201 expected = reader.getObjectFromFile("pis/payments/sepa-credit-transfers/initiate-payment-response-body.json", PaymentInitationRequestResponse201.class); Response<PaymentInitationRequestResponse201> response = service.initiatePayment(PaymentService.PAYMENTS, PaymentProduct.SEPA_CREDIT_TRANSFERS, RequestHeaders.fromMap(headersMap), RequestParams.empty(), paymentInitiationJson); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); assertThat(response.getBody()).isEqualTo(expected); } @ParameterizedTest @MethodSource("paymentTypes") void getScaStatus(PaymentService paymentService, PaymentProduct paymentProduct) throws IOException { Map<String, String> headersMap = reader.getObjectFromFile("pis/get-sca-status-request-headers.json", Map.class); ScaStatusResponse expected = reader.getObjectFromFile("pis/get-sca-status-response-body.json", ScaStatusResponse.class); Response<ScaStatusResponse> response = service.getPaymentInitiationScaStatus( paymentService, paymentProduct, paymentIds.get(paymentService, paymentProduct), authorisationIds.get(paymentService, paymentProduct), RequestHeaders.fromMap(headersMap), RequestParams.empty() ); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_OK); assertThat(response.getBody()).isEqualTo(expected); } @ParameterizedTest @MethodSource("paymentTypes") void authenticatePsu(PaymentService paymentService, PaymentProduct paymentProduct) throws IOException { Map<String, String> headersMap = reader.getObjectFromFile("pis/authenticate-psu-request-headers.json", Map.class); UpdatePsuAuthentication psuAuthentication = reader.getObjectFromFile("pis/authenticate-psu-request-body.json", UpdatePsuAuthentication.class); UpdatePsuAuthenticationResponse expected = reader.getObjectFromFile( "pis/" + paymentService + "/" + paymentProduct + "/authenticate-psu-response-body.json", UpdatePsuAuthenticationResponse.class); Response<UpdatePsuAuthenticationResponse> response = service.updatePaymentPsuData( paymentService, paymentProduct, paymentIds.get(paymentService, paymentProduct), authorisationIds.get(paymentService, paymentProduct), RequestHeaders.fromMap(headersMap), RequestParams.empty(), psuAuthentication); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_OK); assertThat(response.getBody()).isEqualTo(expected); } private static Stream<Arguments> paymentTypes() { return Stream.of(arguments(PaymentService.PAYMENTS, PaymentProduct.SEPA_CREDIT_TRANSFERS)); } private static class Ids { private final Map<PaymentService, Map<PaymentProduct, String>> map = new EnumMap<>(PaymentService.class); Ids add(PaymentService paymentService, PaymentProduct paymentProduct, String id) { map.computeIfAbsent(paymentService, k -> new EnumMap<>(PaymentProduct.class)) .put(paymentProduct, id); return this; } String get(PaymentService paymentService, PaymentProduct paymentProduct) { return Optional.ofNullable(map.get(paymentService)) .map(m -> m.get(paymentProduct)) .orElseThrow(NoSuchElementException::new); } } @ParameterizedTest @MethodSource("paymentTypes") void selectScaMethod(PaymentService paymentService, PaymentProduct paymentProduct) throws IOException { Map<String, String> headersMap = reader.getObjectFromFile("pis/select-sca-method-request-headers.json", Map.class); SelectPsuAuthenticationMethod authenticationMethod = reader.getObjectFromFile("pis/select-sca-method-request-body.json", SelectPsuAuthenticationMethod.class); SelectPsuAuthenticationMethodResponse expected = reader.getObjectFromFile( "pis/" + paymentService + "/" + paymentProduct + "/select-sca-method-response-body.json", SelectPsuAuthenticationMethodResponse.class); Response<SelectPsuAuthenticationMethodResponse> response = service.updatePaymentPsuData( paymentService, paymentProduct, paymentIds.get(paymentService, paymentProduct), authorisationIds.get(paymentService, paymentProduct), RequestHeaders.fromMap(headersMap), RequestParams.empty(), authenticationMethod); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_OK); assertThat(response.getBody()).isEqualTo(expected); } @ParameterizedTest @MethodSource("paymentTypes") void authoriseTransaction(PaymentService paymentService, PaymentProduct paymentProduct) throws IOException { Map<String, String> headersMap = reader.getObjectFromFile("pis/authorise-transaction-request-headers.json", Map.class); TransactionAuthorisation authorisation = reader.getObjectFromFile("pis/authorise-transaction-request-body.json", TransactionAuthorisation.class); ScaStatusResponse expected = reader.getObjectFromFile( "pis/" + paymentService + "/" + paymentProduct + "/authorise-transaction-response-body.json", ScaStatusResponse.class); Response<ScaStatusResponse> response = service.updatePaymentPsuData( paymentService, paymentProduct, paymentIds.get(paymentService, paymentProduct), authorisationIds.get(paymentService, paymentProduct), RequestHeaders.fromMap(headersMap), RequestParams.empty(), authorisation); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_OK); assertThat(response.getBody()).isEqualTo(expected); } @ParameterizedTest @MethodSource("paymentTypes") void getTransactionStatus(PaymentService paymentService, PaymentProduct paymentProduct) throws IOException { Map<String, String> headersMap = reader.getObjectFromFile("pis/get-transaction-status-request-headers.json", Map.class); PaymentInitiationStatusResponse200Json expected = reader.getObjectFromFile( "pis/" + paymentService + "/" + paymentProduct + "/get-transaction-status-response-body.json", PaymentInitiationStatusResponse200Json.class); Response<PaymentInitiationStatusResponse200Json> response = service.getPaymentInitiationStatus( paymentService, paymentProduct, paymentIds.get(paymentService, paymentProduct), RequestHeaders.fromMap(headersMap), RequestParams.empty() ); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_OK); assertThat(response.getBody()).isEqualTo(expected); } }
13,187
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdorsysSigningHeadersInterceptorTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/test/java/de/adorsys/xs2a/adapter/adorsys/AdorsysSigningHeadersInterceptorTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys; import de.adorsys.xs2a.adapter.api.Pkcs12KeyStore; import de.adorsys.xs2a.adapter.api.config.AdapterConfig; import de.adorsys.xs2a.adapter.api.http.HttpClient; import de.adorsys.xs2a.adapter.api.http.Request; import de.adorsys.xs2a.adapter.impl.http.RequestBuilderImpl; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Test; import java.io.ByteArrayInputStream; import java.io.File; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.security.*; import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import static de.adorsys.xs2a.adapter.api.RequestHeaders.*; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.*; class AdorsysSigningHeadersInterceptorTest { private static final String CERTIFICATE = "-----BEGIN CERTIFICATE-----\n" + "MIIBLTCB2KADAgECAgEDMA0GCSqGSIb3DQEBBAUAMA0xCzAJBgNVBAMTAkNBMB4X\n" + "DTAyMTEwNzExNTcwM1oXDTIyMTEwNzExNTcwM1owFTETMBEGA1UEAxMKRW5kIEVu\n" + "dGl0eTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDVBDfF+uBr5s5jzzDs1njKlZNt\n" + "h8hHzEt3ASh67Peos+QrDzgpUyFXT6fdW2h7iPf0ifjM8eW2xa+3EnPjjU5jAgMB\n" + "AAGjGzAZMBcGA1UdIAQQMA4wBgYEVR0gADAEBgIqADANBgkqhkiG9w0BAQQFAANB\n" + "AFo//WOboCNOCcA1fvcWW9oc4MvV8ZPvFIAbyEbgyFd4id5lGDTRbRPvvNZRvdsN\n" + "NM2gXYr+f87NHIXc9EF3pzw=\n" + "-----END CERTIFICATE-----"; private final Pkcs12KeyStore keyStore = mock(Pkcs12KeyStore.class); private final HttpClient client = mock(HttpClient.class); private final Request.Builder builder = new RequestBuilderImpl(client, null, null); private AdorsysSigningHeadersInterceptor adorsysSigningHeadersInterceptor; @AfterAll static void afterAll() { // Re-set configuration properties to defaults AdapterConfig.setConfigFile(""); } @Test void preHandle_requestSigningEnabled() throws KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException { String file = getClass().getResource(File.separator + "adorsys.adapter.config.signing-enabled.properties").getFile(); AdapterConfig.setConfigFile(file); adorsysSigningHeadersInterceptor = new AdorsysSigningHeadersInterceptor(keyStore); when(keyStore.getQsealCertificate()).thenReturn(generateCertificate()); when(keyStore.getQsealPrivateKey()).thenReturn(generatePrivateKey()); Request.Builder actualBuilder = adorsysSigningHeadersInterceptor.preHandle(builder); verify(keyStore, times(2)).getQsealCertificate(); verify(keyStore, times(1)).getQsealPrivateKey(); assertThat(actualBuilder.headers()) .isNotEmpty() .containsKeys(DATE, TPP_SIGNATURE_CERTIFICATE, DIGEST, SIGNATURE) .hasEntrySatisfying(TPP_SIGNATURE_CERTIFICATE, value -> assertThat(value).contains(CERTIFICATE.replace("\n", ""))); } @Test void preHandle_requestSigningDisabled() { String file = getClass().getResource(File.separator + "adorsys.adapter.config.signing-disabled.properties").getFile(); AdapterConfig.setConfigFile(file); adorsysSigningHeadersInterceptor = new AdorsysSigningHeadersInterceptor(keyStore); adorsysSigningHeadersInterceptor.preHandle(builder); verifyNoInteractions(keyStore); } private static X509Certificate generateCertificate() { X509Certificate certificate = null; CertificateFactory cf = null; InputStream is = new ByteArrayInputStream(CERTIFICATE.getBytes(StandardCharsets.UTF_8)); try { cf = CertificateFactory.getInstance("X.509"); certificate = (X509Certificate) cf.generateCertificate(is); } catch (CertificateException e) { throw new RuntimeException(e); } return certificate; } private PrivateKey generatePrivateKey() throws NoSuchAlgorithmException { KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA"); KeyPair keyPair = generator.genKeyPair(); return keyPair.getPrivate(); } }
5,040
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdorsysIntegOauth2ServiceTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/test/java/de/adorsys/xs2a/adapter/adorsys/AdorsysIntegOauth2ServiceTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys; import de.adorsys.xs2a.adapter.api.Oauth2Service.Parameters; import de.adorsys.xs2a.adapter.api.Response; import de.adorsys.xs2a.adapter.api.ResponseHeaders; import de.adorsys.xs2a.adapter.api.http.HttpClient; import de.adorsys.xs2a.adapter.api.http.HttpClientConfig; import de.adorsys.xs2a.adapter.api.http.HttpClientFactory; import de.adorsys.xs2a.adapter.api.http.Request; import de.adorsys.xs2a.adapter.api.model.Aspsp; import de.adorsys.xs2a.adapter.api.model.TokenResponse; import de.adorsys.xs2a.adapter.api.oauth.Oauth2Api; import de.adorsys.xs2a.adapter.api.validation.RequestValidationException; import de.adorsys.xs2a.adapter.impl.http.StringUri; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import java.net.URI; import java.util.HashMap; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class AdorsysIntegOauth2ServiceTest { private static final String IDP_URL = "https://example.com"; private static final String AUTH_URL = "https://example.com/auth"; private static final String TOKEN_URL = "https://example.com/token"; private static final String REDIRECT_URI = "https://example.com/redirect"; private static final String AUTHORISATION_CODE = "qwerty"; private static final String AUTH_URL_WITH_REDIRECT_URI_PARAM = StringUri.withQuery(AUTH_URL, "redirect_uri", REDIRECT_URI); private static final String TOKEN_URL_WITH_AUTHORISATION_CODE = StringUri.withQuery(TOKEN_URL, "code", AUTHORISATION_CODE); private static final URI AUTH_REQUEST_URI = buildAuthRequestURI(); private static final String ACCESS_TOKEN = "testAccessToken"; private static final String TOKEN_TYPE = "testTokenType"; private static final Long EXPIRES_IN_SECONDS = 300L; private static final String REFRESH_TOKEN = "testRefreshToken"; private static final String SCOPE = "testScope"; private static final int HTTP_CODE_OK = 200; private static final Response<TokenResponse> OAUTH_TOKEN_RESPONSE = new Response<>(HTTP_CODE_OK, buildTokenResponse(), ResponseHeaders.emptyResponseHeaders()); private AdorsysIntegOauth2Service oauth2Service; @Mock private Aspsp aspsp; @Mock private Oauth2Api oauth2Api; @Mock private HttpClient httpClient; @Mock private Request.Builder requestBuilder; @Mock private HttpClientFactory httpClientFactory; @Mock private HttpClientConfig httpClientConfig; @BeforeEach void setUp() { when(httpClientFactory.getHttpClient(any())).thenReturn(httpClient); when(httpClientFactory.getHttpClientConfig()).thenReturn(httpClientConfig); oauth2Service = new AdorsysIntegOauth2Service(aspsp, httpClientFactory, oauth2Api); } @Test void getAuthorizationRequestUri_Failure_ScaOauthUrlIsNotProvided() { Parameters parameters = new Parameters(new HashMap<>()); when(aspsp.getIdpUrl()).thenReturn(null); Assertions.assertThrows( RequestValidationException.class, () -> { oauth2Service.getAuthorizationRequestUri(null, parameters); } ); } @Test void getAuthorizationRequestUri_Failure_ScaOauthUrlIsEmptyParam() { Parameters parameters = new Parameters(new HashMap<>()); parameters.setScaOAuthLink(" "); when(aspsp.getIdpUrl()).thenReturn(null); Assertions.assertThrows( RequestValidationException.class, () -> oauth2Service.getAuthorizationRequestUri(null, parameters) ); } @Test void getAuthorizationRequestUri_Failure_ScaOauthUrlIsEmpty() { Parameters parameters = new Parameters(new HashMap<>()); when(aspsp.getIdpUrl()).thenReturn(" "); Assertions.assertThrows( RequestValidationException.class, () -> oauth2Service.getAuthorizationRequestUri(null, parameters) ); } @Test void getAuthorizationRequestUri_Success() { Parameters parameters = new Parameters(new HashMap<>()); parameters.setRedirectUri(REDIRECT_URI); when(aspsp.getIdpUrl()).thenReturn(IDP_URL); when(oauth2Api.getAuthorisationUri(IDP_URL)).thenReturn(AUTH_URL); URI actual = oauth2Service.getAuthorizationRequestUri(null, parameters); assertThat(actual).isEqualTo(AUTH_REQUEST_URI); } @Test void getToken_Failure_ScaOauthUrlIsNotProvided() { Parameters parameters = new Parameters(new HashMap<>()); when(aspsp.getIdpUrl()).thenReturn(null); Assertions.assertThrows( RequestValidationException.class, () -> oauth2Service.getToken(null, parameters) ); } @Test void getToken_Failure_ScaOauthUrlIsEmptyParam() { Parameters parameters = new Parameters(new HashMap<>()); parameters.setScaOAuthLink(" "); when(aspsp.getIdpUrl()).thenReturn(null); Assertions.assertThrows( RequestValidationException.class, () -> oauth2Service.getToken(null, parameters) ); } @Test void getToken_Failure_ScaOauthUrlIsEmpty() { Parameters parameters = new Parameters(new HashMap<>()); when(aspsp.getIdpUrl()).thenReturn(" "); Assertions.assertThrows( RequestValidationException.class, () -> oauth2Service.getToken(null, parameters) ); } @Test void getToken_Failure_ScaOauthUrlHasWrongFormat() { Parameters parameters = new Parameters(new HashMap<>()); when(aspsp.getIdpUrl()).thenReturn("wrong-idp-url"); Assertions.assertThrows( RequestValidationException.class, () -> oauth2Service.getToken(null, parameters) ); } @Test void getToken_Success() { Parameters parameters = new Parameters(new HashMap<>()); parameters.setScaOAuthLink(IDP_URL); parameters.setAuthorizationCode(AUTHORISATION_CODE); when(oauth2Api.getTokenUri(IDP_URL)) .thenReturn(TOKEN_URL); when(httpClient.post(TOKEN_URL_WITH_AUTHORISATION_CODE)) .thenReturn(requestBuilder); when(requestBuilder.send(any(HttpClient.ResponseHandler.class))) .thenReturn(OAUTH_TOKEN_RESPONSE); TokenResponse tokenResponse = oauth2Service.getToken(null, parameters); assertThat(tokenResponse).isNotNull(); assertThat(tokenResponse.getAccessToken()).isEqualTo(ACCESS_TOKEN); assertThat(tokenResponse.getTokenType()).isEqualTo(TOKEN_TYPE); assertThat(tokenResponse.getExpiresInSeconds()).isEqualTo(EXPIRES_IN_SECONDS); assertThat(tokenResponse.getRefreshToken()).isEqualTo(REFRESH_TOKEN); assertThat(tokenResponse.getScope()).isEqualTo(SCOPE); } private static URI buildAuthRequestURI() { return URI.create(AUTH_URL_WITH_REDIRECT_URI_PARAM); } private static TokenResponse buildTokenResponse() { TokenResponse tokenResponse = new TokenResponse(); tokenResponse.setAccessToken(ACCESS_TOKEN); tokenResponse.setTokenType(TOKEN_TYPE); tokenResponse.setExpiresInSeconds(EXPIRES_IN_SECONDS); tokenResponse.setRefreshToken(REFRESH_TOKEN); tokenResponse.setScope(SCOPE); return tokenResponse; } }
8,507
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdorsysIntegServiceProviderTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/test/java/de/adorsys/xs2a/adapter/adorsys/AdorsysIntegServiceProviderTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys; import de.adorsys.xs2a.adapter.api.AccountInformationService; import de.adorsys.xs2a.adapter.api.Oauth2Service; import de.adorsys.xs2a.adapter.api.PaymentInitiationService; import de.adorsys.xs2a.adapter.api.Pkcs12KeyStore; import de.adorsys.xs2a.adapter.api.http.HttpClientConfig; import de.adorsys.xs2a.adapter.api.http.HttpClientFactory; import de.adorsys.xs2a.adapter.api.http.Interceptor; import de.adorsys.xs2a.adapter.api.model.Aspsp; import de.adorsys.xs2a.adapter.impl.BasePaymentInitiationService; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.*; class AdorsysIntegServiceProviderTest { private AdorsysIntegServiceProvider provider; private final HttpClientConfig httpClientConfig = mock(HttpClientConfig.class); private final HttpClientFactory httpClientFactory = mock(HttpClientFactory.class); private final Aspsp aspsp = new Aspsp(); @BeforeEach void setUp() { provider = spy(new AdorsysIntegServiceProvider()); when(httpClientFactory.getHttpClientConfig()).thenReturn(httpClientConfig); } @Test void getPaymentInitiationService() { PaymentInitiationService actualService = provider.getPaymentInitiationService(aspsp, httpClientFactory, null); assertThat(actualService) .isExactlyInstanceOf(BasePaymentInitiationService.class); } @Test void getAccountInformationService() { AccountInformationService actualService = provider.getAccountInformationService(aspsp, httpClientFactory, null); assertThat(actualService) .isExactlyInstanceOf(AdorsysAccountInformationService.class); } @Test void getService_checkInterceptors() { ArgumentCaptor<Interceptor> interceptorCaptor = ArgumentCaptor.forClass(Interceptor.class); Pkcs12KeyStore mockedKeyStore = mock(Pkcs12KeyStore.class); when(httpClientConfig.getKeyStore()).thenReturn(mockedKeyStore); provider.getAccountInformationService(aspsp, httpClientFactory, null); verify(provider, times(1)).getInterceptors(any(), interceptorCaptor.capture()); Interceptor[] actualAdorsysInterceptors = interceptorCaptor.getAllValues().toArray(new Interceptor[0]); assertThat(actualAdorsysInterceptors) .hasSize(2) .matches(interceptors -> interceptors[0] instanceof OauthHeaderInterceptor) .matches(interceptors -> interceptors[1] instanceof AdorsysSigningHeadersInterceptor); } @Test void getOauth2Service() { Oauth2Service actualService = provider.getOauth2Service(aspsp, httpClientFactory); assertThat(actualService) .isExactlyInstanceOf(AdorsysIntegOauth2Service.class); } }
3,770
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdorsysAccountInformationServiceTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/test/java/de/adorsys/xs2a/adapter/adorsys/AdorsysAccountInformationServiceTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.RequestParams; import de.adorsys.xs2a.adapter.api.Response; import de.adorsys.xs2a.adapter.api.ResponseHeaders; import de.adorsys.xs2a.adapter.api.http.HttpClient; import de.adorsys.xs2a.adapter.api.http.HttpClientConfig; import de.adorsys.xs2a.adapter.api.http.HttpClientFactory; import de.adorsys.xs2a.adapter.api.http.Interceptor; import de.adorsys.xs2a.adapter.api.link.LinksRewriter; import de.adorsys.xs2a.adapter.api.model.Aspsp; import de.adorsys.xs2a.adapter.api.model.OK200TransactionDetails; import de.adorsys.xs2a.adapter.api.model.TransactionsResponse200Json; import de.adorsys.xs2a.adapter.impl.http.RequestBuilderImpl; import org.assertj.core.api.InstanceOfAssertFactories; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.Spy; import org.mockito.junit.jupiter.MockitoExtension; import java.io.ByteArrayInputStream; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.*; @ExtendWith(MockitoExtension.class) class AdorsysAccountInformationServiceTest { private static final String ACCEPT_ALL = "*/*"; private static final String ACCEPT_JSON = "application/json"; private static final String ACCEPT_XML = "application/xml"; private static final String URI = "https://foo.boo"; private static final String ACCOUNT_ID = "accountId"; private static final String REMITTANCE_INFORMATION_STRUCTURED = "remittanceInformationStructuredStringValue"; private AdorsysAccountInformationService accountInformationService; @Mock private HttpClient httpClient; @Mock private Aspsp aspsp; @Mock private LinksRewriter linksRewriter; @Mock private HttpClientFactory httpClientFactory; @Mock private HttpClientConfig httpClientConfig; @Spy private final List<Interceptor> interceptors = new LinkedList<>(); @BeforeEach void setUp() { when(httpClientFactory.getHttpClient(any())).thenReturn(httpClient); when(httpClientFactory.getHttpClientConfig()).thenReturn(httpClientConfig); accountInformationService = new AdorsysAccountInformationService(aspsp, httpClientFactory, interceptors, linksRewriter); } @Test void populatePostHeaders_withoutAcceptHeader() { Map<String, String> actual = accountInformationService.populatePostHeaders(new HashMap<>()); assertThat(actual).containsEntry(RequestHeaders.ACCEPT, ACCEPT_JSON); } @Test void populatePostHeaders_acceptAll() { HashMap<String, String> headers = new HashMap<>(); headers.put(RequestHeaders.ACCEPT, ACCEPT_ALL); Map<String, String> actual = accountInformationService.populatePostHeaders(headers); assertThat(actual).containsEntry(RequestHeaders.ACCEPT, ACCEPT_JSON); } @Test void populatePostHeaders_acceptJson() { HashMap<String, String> headers = new HashMap<>(); headers.put(RequestHeaders.ACCEPT, ACCEPT_JSON); Map<String, String> actual = accountInformationService.populatePostHeaders(headers); assertThat(actual).containsEntry(RequestHeaders.ACCEPT, ACCEPT_JSON); } @Test void populatePostHeaders_acceptXml() { HashMap<String, String> headers = new HashMap<>(); headers.put(RequestHeaders.ACCEPT, ACCEPT_XML); Map<String, String> actual = accountInformationService.populatePostHeaders(headers); assertThat(actual).containsEntry(RequestHeaders.ACCEPT, ACCEPT_XML); } @Test void populatePutHeaders_withoutAcceptHeader() { Map<String, String> actual = accountInformationService.populatePutHeaders(new HashMap<>()); assertThat(actual).containsEntry(RequestHeaders.ACCEPT, ACCEPT_JSON); } @Test void populatePutHeaders_acceptAll() { HashMap<String, String> headers = new HashMap<>(); headers.put(RequestHeaders.ACCEPT, ACCEPT_ALL); Map<String, String> actual = accountInformationService.populatePutHeaders(headers); assertThat(actual).containsEntry(RequestHeaders.ACCEPT, ACCEPT_JSON); } @Test void populatePutHeaders_acceptJson() { HashMap<String, String> headers = new HashMap<>(); headers.put(RequestHeaders.ACCEPT, ACCEPT_JSON); Map<String, String> actual = accountInformationService.populatePutHeaders(headers); assertThat(actual).containsEntry(RequestHeaders.ACCEPT, ACCEPT_JSON); } @Test void populatePutHeaders_acceptXml() { HashMap<String, String> headers = new HashMap<>(); headers.put(RequestHeaders.ACCEPT, ACCEPT_XML); Map<String, String> actual = accountInformationService.populatePutHeaders(headers); assertThat(actual).containsEntry(RequestHeaders.ACCEPT, ACCEPT_XML); } @Test void populateGetHeaders_withoutAcceptHeader() { Map<String, String> actual = accountInformationService.populateGetHeaders(new HashMap<>()); assertThat(actual).containsEntry(RequestHeaders.ACCEPT, ACCEPT_JSON); } @Test void populateGetHeaders_acceptAll() { HashMap<String, String> headers = new HashMap<>(); headers.put(RequestHeaders.ACCEPT, ACCEPT_ALL); Map<String, String> actual = accountInformationService.populateGetHeaders(headers); assertThat(actual).containsEntry(RequestHeaders.ACCEPT, ACCEPT_JSON); } @Test void populateGetHeaders_acceptJson() { HashMap<String, String> headers = new HashMap<>(); headers.put(RequestHeaders.ACCEPT, ACCEPT_JSON); Map<String, String> actual = accountInformationService.populateGetHeaders(headers); assertThat(actual).containsEntry(RequestHeaders.ACCEPT, ACCEPT_JSON); } @Test void populateGetHeaders_acceptXml() { HashMap<String, String> headers = new HashMap<>(); headers.put(RequestHeaders.ACCEPT, ACCEPT_XML); Map<String, String> actual = accountInformationService.populateGetHeaders(headers); assertThat(actual).containsEntry(RequestHeaders.ACCEPT, ACCEPT_XML); } @Test void populateDeleteHeaders_withoutAcceptHeader() { Map<String, String> actual = accountInformationService.populateDeleteHeaders(new HashMap<>()); assertThat(actual).containsEntry(RequestHeaders.ACCEPT, ACCEPT_JSON); } @Test void populateDeleteHeaders_acceptAll() { HashMap<String, String> headers = new HashMap<>(); headers.put(RequestHeaders.ACCEPT, ACCEPT_ALL); Map<String, String> actual = accountInformationService.populateDeleteHeaders(headers); assertThat(actual).containsEntry(RequestHeaders.ACCEPT, ACCEPT_JSON); } @Test void populateDeleteHeaders_acceptJson() { HashMap<String, String> headers = new HashMap<>(); headers.put(RequestHeaders.ACCEPT, ACCEPT_JSON); Map<String, String> actual = accountInformationService.populateDeleteHeaders(headers); assertThat(actual).containsEntry(RequestHeaders.ACCEPT, ACCEPT_JSON); } @Test void populateDeleteHeaders_acceptXml() { HashMap<String, String> headers = new HashMap<>(); headers.put(RequestHeaders.ACCEPT, ACCEPT_XML); Map<String, String> actual = accountInformationService.populateDeleteHeaders(headers); assertThat(actual).containsEntry(RequestHeaders.ACCEPT, ACCEPT_XML); } @Test void getTransactionList() { String rawResponse = "{\n" + " \"transactions\": {\n" + " \"booked\": [\n" + " {\n" + " \"remittanceInformationStructuredArray\": [" + " \"" + REMITTANCE_INFORMATION_STRUCTURED + "\"\n" + " ]\n" + " }\n" + " ]\n" + " }\n" + "}"; when(httpClient.get(anyString())) .thenReturn(new RequestBuilderImpl(httpClient, "GET", URI)); when(httpClient.send(any(), any())) .thenAnswer(invocationOnMock -> { HttpClient.ResponseHandler responseHandler = invocationOnMock.getArgument(1, HttpClient.ResponseHandler.class); return new Response<>(-1, responseHandler.apply(200, new ByteArrayInputStream(rawResponse.getBytes()), ResponseHeaders.emptyResponseHeaders()), null); }); Response<?> actualResponse = accountInformationService.getTransactionList(ACCOUNT_ID, RequestHeaders.empty(), RequestParams.empty()); verify(httpClient, times(1)).get(anyString()); verify(httpClient, times(1)).send(any(), any()); assertThat(actualResponse) .isNotNull() .extracting(Response::getBody) .asInstanceOf(InstanceOfAssertFactories.type(TransactionsResponse200Json.class)) .matches(body -> body.getTransactions() .getBooked() .get(0) .getRemittanceInformationStructuredArray() .get(0) .equals(REMITTANCE_INFORMATION_STRUCTURED)); } @Test void getTransactionDetails() { String rawResponse = "{\n" + " \"transactionsDetails\": {\n" + " \"transactionDetails\": {\n" + " \"remittanceInformationStructuredArray\": [" + " \"" + REMITTANCE_INFORMATION_STRUCTURED + "\"\n" + " ]\n" + " }\n" + " }\n" + "}"; when(httpClient.get(anyString())) .thenReturn(new RequestBuilderImpl(httpClient, "GET", URI)); when(httpClient.send(any(), any())) .thenAnswer(invocationOnMock -> { HttpClient.ResponseHandler responseHandler = invocationOnMock.getArgument(1, HttpClient.ResponseHandler.class); return new Response<>( -1, responseHandler.apply(200, new ByteArrayInputStream(rawResponse.getBytes()), ResponseHeaders.emptyResponseHeaders()), null); }); Response<?> actualResponse = accountInformationService.getTransactionDetails(ACCOUNT_ID, "transactionId", RequestHeaders.empty(), RequestParams.empty()); verify(httpClient, times(1)).get(anyString()); verify(httpClient, times(1)).send(any(), any()); assertThat(actualResponse) .isNotNull() .extracting(Response::getBody) .asInstanceOf(InstanceOfAssertFactories.type(OK200TransactionDetails.class)) .matches(body -> body.getTransactionsDetails() .getRemittanceInformationStructuredArray() .get(0) .equals(REMITTANCE_INFORMATION_STRUCTURED)); } }
12,216
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdorsysAccountInformationServiceWireMockTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/test/java/de/adorsys/xs2a/adapter/adorsys/AdorsysAccountInformationServiceWireMockTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys; import com.fasterxml.jackson.databind.ObjectMapper; import com.github.tomakehurst.wiremock.WireMockServer; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.RequestParams; import de.adorsys.xs2a.adapter.api.Response; import de.adorsys.xs2a.adapter.api.http.HttpClient; import de.adorsys.xs2a.adapter.api.http.HttpClientConfig; import de.adorsys.xs2a.adapter.api.http.HttpClientFactory; import de.adorsys.xs2a.adapter.api.link.LinksRewriter; import de.adorsys.xs2a.adapter.api.model.*; import de.adorsys.xs2a.adapter.impl.http.ApacheHttpClient; import de.adorsys.xs2a.adapter.impl.http.JacksonObjectMapper; import de.adorsys.xs2a.adapter.impl.http.Xs2aHttpLogSanitizer; import de.adorsys.xs2a.adapter.impl.link.identity.IdentityLinksRewriter; import org.apache.http.HttpStatus; import org.apache.http.impl.client.HttpClientBuilder; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.mockito.Mockito; import pro.javatar.commons.reader.JsonReader; import pro.javatar.commons.reader.ResourceReader; import java.io.IOException; import java.util.ArrayList; import java.util.Map; import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; import static org.assertj.core.api.Assertions.assertThat; class AdorsysAccountInformationServiceWireMockTest { private static final String ACCOUNT_ID = "HGlNA7CqT8sjd_1aV2v2LI"; private static final String CONSENT_ID = "LWigcCDnqIju2WxmN2QJiIIwDPJRCi55C92NUPa5IXRNg8JYEtRvNJAdwuefV7G4XcX1qLGcJAusajIQOAZagMz9MpaJIQIH3NJX8IHgetw=_=_psGLvQpt9Q"; private static final String AUTHORISATION_ID = "19636dbe-99db-4d0f-90de-2573057bc7e4"; private final ObjectMapper objectMapper = new JacksonObjectMapper().copyObjectMapper(); private ResourceReader reader = JsonReader.getInstance(objectMapper); private static AdorsysAccountInformationService service; private static WireMockServer wireMockServer; private static final HttpClientFactory httpClientFactory = Mockito.mock(HttpClientFactory.class); private static final HttpClientConfig httpClientConfig = Mockito.mock(HttpClientConfig.class); @BeforeAll static void beforeAll() { wireMockServer = new WireMockServer(wireMockConfig() .port(8189) .usingFilesUnderClasspath("adorsys-adapter")); wireMockServer.start(); HttpClient httpClient = new ApacheHttpClient(new Xs2aHttpLogSanitizer(), HttpClientBuilder.create().build()); LinksRewriter linksRewriter = new IdentityLinksRewriter(); Aspsp aspsp = new Aspsp(); aspsp.setName("adorsys-adapter"); aspsp.setUrl("http://localhost:" + wireMockServer.port()); Mockito.when(httpClientFactory.getHttpClient(Mockito.any())).thenReturn(httpClient); Mockito.when(httpClientFactory.getHttpClientConfig()).thenReturn(httpClientConfig); service = new AdorsysAccountInformationService(aspsp, httpClientFactory, new ArrayList<>(), linksRewriter); } @AfterAll static void afterAll() { wireMockServer.stop(); } @Test void createConsent() throws IOException { Map<String, String> headersMap = reader.getObjectFromFile("ais/create-consent/request-headers.json", Map.class); Consents consents = reader.getObjectFromFile("ais/create-consent/request-body.json", Consents.class); ConsentsResponse201 expected = reader.getObjectFromFile("ais/create-consent/response-body.json", ConsentsResponse201.class); Response<ConsentsResponse201> response = service.createConsent(RequestHeaders.fromMap(headersMap), RequestParams.empty(), consents); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); assertThat(response.getBody()).isEqualTo(expected); } @Test void updatePsuData() throws IOException { Map<String, String> headersMap = reader.getObjectFromFile("ais/update-psu-data/request-headers.json", Map.class); UpdatePsuAuthentication psuAuthentication = reader.getObjectFromFile("ais/update-psu-data/request-body.json", UpdatePsuAuthentication.class); UpdatePsuAuthenticationResponse expected = reader.getObjectFromFile("ais/update-psu-data/response-body.json", UpdatePsuAuthenticationResponse.class); Response<UpdatePsuAuthenticationResponse> response = service.updateConsentsPsuData(CONSENT_ID, AUTHORISATION_ID, RequestHeaders.fromMap(headersMap), RequestParams.empty(), psuAuthentication); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_OK); assertThat(response.getBody()).isEqualTo(expected); } @Test void selectScaMethod() throws IOException { Map<String, String> headersMap = reader.getObjectFromFile("ais/select-sca-method/request-headers.json", Map.class); SelectPsuAuthenticationMethod authenticationMethod = reader.getObjectFromFile("ais/select-sca-method/request-body.json", SelectPsuAuthenticationMethod.class); SelectPsuAuthenticationMethodResponse expected = reader.getObjectFromFile("ais/select-sca-method/response-body.json", SelectPsuAuthenticationMethodResponse.class); Response<SelectPsuAuthenticationMethodResponse> response = service.updateConsentsPsuData(CONSENT_ID, AUTHORISATION_ID, RequestHeaders.fromMap(headersMap), RequestParams.empty(), authenticationMethod); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_OK); assertThat(response.getBody()).isEqualTo(expected); } @Test void sendOtp() throws IOException { Map<String, String> headersMap = reader.getObjectFromFile("ais/send-otp/request-headers.json", Map.class); TransactionAuthorisation authorisation = reader.getObjectFromFile("ais/send-otp/request-body.json", TransactionAuthorisation.class); ScaStatusResponse expected = reader.getObjectFromFile("ais/send-otp/response-body.json", ScaStatusResponse.class); Response<ScaStatusResponse> response = service.updateConsentsPsuData(CONSENT_ID, AUTHORISATION_ID, RequestHeaders.fromMap(headersMap), RequestParams.empty(), authorisation); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_OK); assertThat(response.getBody()).isEqualTo(expected); } @Test void getScaStatus() throws IOException { Map<String, String> headersMap = reader.getObjectFromFile("ais/get-sca-status/request-headers.json", Map.class); ScaStatusResponse expected = reader.getObjectFromFile("ais/get-sca-status/response-body.json", ScaStatusResponse.class); Response<ScaStatusResponse> response = service.getConsentScaStatus(CONSENT_ID, AUTHORISATION_ID, RequestHeaders.fromMap(headersMap), RequestParams.empty()); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_OK); assertThat(response.getBody()).isEqualTo(expected); } @Test void deleteConsent() throws IOException { Map<String, String> headersMap = reader.getObjectFromFile("ais/delete-consent/request-headers.json", Map.class); Response<Void> response = service.deleteConsent(CONSENT_ID, RequestHeaders.fromMap(headersMap), RequestParams.empty()); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_NO_CONTENT); assertThat(response.getBody()).isNull(); } @Test void getAccounts() throws IOException { Map<String, String> headersMap = reader.getObjectFromFile("ais/get-accounts/request-headers.json", Map.class); Map<String, String> paramsMap = reader.getObjectFromFile("ais/get-accounts/request-params.json", Map.class); AccountList expected = reader.getObjectFromFile("ais/get-accounts/response-body.json", AccountList.class); Response<AccountList> response = service.getAccountList(RequestHeaders.fromMap(headersMap), RequestParams.fromMap(paramsMap)); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_OK); assertThat(response.getBody()).isEqualTo(expected); } @Test void getBalances() throws IOException { Map<String, String> headersMap = reader.getObjectFromFile("ais/get-balances/request-headers.json", Map.class); ReadAccountBalanceResponse200 expected = reader.getObjectFromFile("ais/get-balances/response-body.json", ReadAccountBalanceResponse200.class); Response<ReadAccountBalanceResponse200> response = service.getBalances(ACCOUNT_ID, RequestHeaders.fromMap(headersMap), RequestParams.empty()); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_OK); assertThat(response.getBody()).isEqualTo(expected); } @Test void getTransactions() throws IOException { Map<String, String> headersMap = reader.getObjectFromFile("ais/get-transactions/request-headers.json", Map.class); Map<String, String> paramsMap = reader.getObjectFromFile("ais/get-transactions/request-params.json", Map.class); TransactionsResponse200Json expected = reader.getObjectFromFile("ais/get-transactions/response-body.json", TransactionsResponse200Json.class); Response<TransactionsResponse200Json> response = service.getTransactionList(ACCOUNT_ID, RequestHeaders.fromMap(headersMap), RequestParams.fromMap(paramsMap)); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_OK); assertThat(response.getBody()).isEqualTo(expected); } }
12,097
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
OauthHeaderInterceptorTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/test/java/de/adorsys/xs2a/adapter/adorsys/OauthHeaderInterceptorTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.config.AdapterConfig; import de.adorsys.xs2a.adapter.api.http.Request; import de.adorsys.xs2a.adapter.impl.http.RequestBuilderImpl; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static de.adorsys.xs2a.adapter.adorsys.OauthHeaderInterceptor.OAUTH_HEADER_NAME; class OauthHeaderInterceptorTest { private String header; private OauthHeaderInterceptor interceptor; @BeforeEach public void setUp() { header = AdapterConfig.readProperty(OAUTH_HEADER_NAME); interceptor = new OauthHeaderInterceptor(); } @Test void checkHeaderValueIsPreStep() { Request.Builder result = applyInterceptor("90001001"); Assertions.assertEquals("pre-step", result.headers().get(header)); } @Test void checkHeaderValueIsIntegrated() { Request.Builder result = applyInterceptor("90001002"); Assertions.assertEquals("integrated", result.headers().get(header)); } @Test void willNotOverrideHeader() { Request.Builder builder = initRequestBuilder("90001002"); builder.header("X-oauth-PREFERRED", "pre-step"); Request.Builder result = interceptor.preHandle(builder); // the value stays "pre-step" instead of being set to "integrated" by the interceptor Assertions.assertEquals("pre-step", result.headers().get(header)); } private Request.Builder applyInterceptor(String bankCode) { Request.Builder builder = initRequestBuilder(bankCode); interceptor.preHandle(builder); return builder; } private Request.Builder initRequestBuilder(String bankCode) { RequestBuilderImpl builder = new RequestBuilderImpl(null, null, null); builder.header(RequestHeaders.X_GTW_BANK_CODE, bankCode); return builder; } @Test void applyRequestBankCodeIsAbsent() { RequestBuilderImpl builder = new RequestBuilderImpl(null, null, null); interceptor.preHandle(builder); Assertions.assertEquals(0, builder.headers().size()); } }
3,064
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdorsysAccountInformationService.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/main/java/de/adorsys/xs2a/adapter/adorsys/AdorsysAccountInformationService.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys; import de.adorsys.xs2a.adapter.adorsys.model.AdorsysOK200TransactionDetails; import de.adorsys.xs2a.adapter.adorsys.model.AdorsysTransactionsResponse200Json; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.RequestParams; import de.adorsys.xs2a.adapter.api.Response; import de.adorsys.xs2a.adapter.api.http.HttpClientFactory; import de.adorsys.xs2a.adapter.api.http.Interceptor; import de.adorsys.xs2a.adapter.api.link.LinksRewriter; import de.adorsys.xs2a.adapter.api.model.*; import de.adorsys.xs2a.adapter.impl.BaseAccountInformationService; import de.adorsys.xs2a.adapter.impl.http.ResponseHandlers; import org.apache.commons.lang3.StringUtils; import org.mapstruct.factory.Mappers; import java.util.List; import java.util.Map; import static java.util.function.Function.identity; public class AdorsysAccountInformationService extends BaseAccountInformationService { private static final String ACCEPT_ALL = "*/*"; private static final String ACCEPT_JSON = "application/json"; private final AdorsysMapper mapper = Mappers.getMapper(AdorsysMapper.class); private final ResponseHandlers handlers; public AdorsysAccountInformationService(Aspsp aspsp, HttpClientFactory httpClientFactory, List<Interceptor> interceptors, LinksRewriter linksRewriter) { super(aspsp, httpClientFactory.getHttpClient(aspsp.getAdapterId()), interceptors, linksRewriter, httpClientFactory.getHttpClientConfig().getLogSanitizer()); this.handlers = new ResponseHandlers(httpClientFactory.getHttpClientConfig().getLogSanitizer()); } @Override public Response<ConsentsResponse201> createConsent(RequestHeaders requestHeaders, RequestParams requestParams, Consents body) { return createConsent(requestHeaders, requestParams, body, identity(), handlers.consentCreationResponseHandler(getIdpUri(), ConsentsResponse201.class)); } @Override public Response<TransactionsResponse200Json> getTransactionList(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return super.getTransactionList(accountId, requestHeaders, requestParams, AdorsysTransactionsResponse200Json.class, mapper::toTransactionsResponse200Json); } @Override public Response<OK200TransactionDetails> getTransactionDetails(String accountId, String transactionId, RequestHeaders requestHeaders, RequestParams requestParams) { return super.getTransactionDetails(accountId, transactionId, requestHeaders, requestParams, AdorsysOK200TransactionDetails.class, mapper::toOK200TransactionDetails); } @Override protected Map<String, String> populatePostHeaders(Map<String, String> headers) { return super.populatePostHeaders(modifyAcceptHeader(headers)); } @Override protected Map<String, String> populatePutHeaders(Map<String, String> headers) { return super.populatePutHeaders(modifyAcceptHeader(headers)); } @Override protected Map<String, String> populateGetHeaders(Map<String, String> headers) { return super.populateGetHeaders(modifyAcceptHeader(headers)); } @Override protected Map<String, String> populateDeleteHeaders(Map<String, String> headers) { return super.populateDeleteHeaders(modifyAcceptHeader(headers)); } private Map<String, String> modifyAcceptHeader(Map<String, String> headers) { String acceptValue = headers.get(RequestHeaders.ACCEPT); if (StringUtils.isBlank(acceptValue) || acceptValue.equals(ACCEPT_ALL)) { headers.put(RequestHeaders.ACCEPT, ACCEPT_JSON); } return headers; } }
5,634
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdorsysSigningHeadersInterceptor.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/main/java/de/adorsys/xs2a/adapter/adorsys/AdorsysSigningHeadersInterceptor.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys; import de.adorsys.xs2a.adapter.api.Pkcs12KeyStore; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.config.AdapterConfig; import de.adorsys.xs2a.adapter.api.http.Interceptor; import de.adorsys.xs2a.adapter.api.http.Request; import de.adorsys.xs2a.adapter.impl.http.RequestSigningInterceptor; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; public class AdorsysSigningHeadersInterceptor implements Interceptor { private final RequestSigningInterceptor signingInterceptor; private final boolean requestSigningEnabled = Boolean.parseBoolean(AdapterConfig.readProperty("adorsys.request_signing.enabled", "false")); public AdorsysSigningHeadersInterceptor(Pkcs12KeyStore keyStore) { this.signingInterceptor = new RequestSigningInterceptor(keyStore); } @Override public Request.Builder preHandle(Request.Builder requestBuilder) { if (requestSigningEnabled) { requestBuilder.header(RequestHeaders.DATE, DateTimeFormatter.RFC_1123_DATE_TIME.format(ZonedDateTime.now())); signingInterceptor.preHandle(requestBuilder); String certificate = requestBuilder.headers().get(RequestHeaders.TPP_SIGNATURE_CERTIFICATE); requestBuilder.header(RequestHeaders.TPP_SIGNATURE_CERTIFICATE, "-----BEGIN CERTIFICATE-----" + certificate + "-----END CERTIFICATE-----"); return requestBuilder; } return requestBuilder; } }
2,395
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
OauthHeaderInterceptor.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/main/java/de/adorsys/xs2a/adapter/adorsys/OauthHeaderInterceptor.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.config.AdapterConfig; import de.adorsys.xs2a.adapter.api.http.Interceptor; import de.adorsys.xs2a.adapter.api.http.Request; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; public class OauthHeaderInterceptor implements Interceptor { private static final String BANK_CODE_FOR_OAUTH = "adorsys.oauth_approach.bank_code"; private static final String OAUTH_HEADER_VALUE = "adorsys.oauth_approach.header_value"; static final String OAUTH_HEADER_NAME = "adorsys.oauth_approach.header_name"; @Override public Request.Builder preHandle(Request.Builder builder) { String oauthBankCode = AdapterConfig.readProperty(BANK_CODE_FOR_OAUTH, ""); List<String> bankCodes = Arrays.stream(oauthBankCode.split(",")) .map(String::trim).collect(Collectors.toList()); String requestBankCode = builder.headers().get(RequestHeaders.X_GTW_BANK_CODE); if (oauthBankCode.isEmpty() || !bankCodes.contains(requestBankCode)) { return builder; } String oauthHeaderName = AdapterConfig.readProperty(OAUTH_HEADER_NAME, ""); if (builder.headers().containsKey(oauthHeaderName)) { return builder; } String headerValue = getOauthHeaderValue(bankCodes, requestBankCode); if (!oauthHeaderName.isEmpty() && !headerValue.isEmpty()) { builder.header(oauthHeaderName, headerValue); } return builder; } private String getOauthHeaderValue(List<String> oauthBankCodes, String requestBankCode) { int idx = oauthBankCodes.indexOf(requestBankCode); String headerValue = AdapterConfig.readProperty(OAUTH_HEADER_VALUE, "true"); List<String> headerValues = Arrays.stream(headerValue.split(",")) .map(String::trim).collect(Collectors.toList()); return headerValues.size() > idx ? headerValues.get(idx) : ""; } }
2,936
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdorsysMapper.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/main/java/de/adorsys/xs2a/adapter/adorsys/AdorsysMapper.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys; import de.adorsys.xs2a.adapter.adorsys.model.AdorsysOK200TransactionDetails; import de.adorsys.xs2a.adapter.adorsys.model.AdorsysTransactionsResponse200Json; import de.adorsys.xs2a.adapter.api.model.OK200TransactionDetails; import de.adorsys.xs2a.adapter.api.model.TransactionsResponse200Json; import org.mapstruct.Mapper; import org.mapstruct.Mapping; @Mapper public interface AdorsysMapper { TransactionsResponse200Json toTransactionsResponse200Json(AdorsysTransactionsResponse200Json value); @Mapping(target = "transactionsDetails", source = "transactionsDetails.transactionDetails") OK200TransactionDetails toOK200TransactionDetails(AdorsysOK200TransactionDetails value); }
1,564
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdorsysIntegServiceProvider.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/main/java/de/adorsys/xs2a/adapter/adorsys/AdorsysIntegServiceProvider.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys; import de.adorsys.xs2a.adapter.api.*; import de.adorsys.xs2a.adapter.api.http.HttpClient; import de.adorsys.xs2a.adapter.api.http.HttpClientConfig; import de.adorsys.xs2a.adapter.api.http.HttpClientFactory; import de.adorsys.xs2a.adapter.api.http.Interceptor; import de.adorsys.xs2a.adapter.api.link.LinksRewriter; import de.adorsys.xs2a.adapter.api.model.Aspsp; import de.adorsys.xs2a.adapter.impl.AbstractAdapterServiceProvider; import de.adorsys.xs2a.adapter.impl.BasePaymentInitiationService; import de.adorsys.xs2a.adapter.impl.oauth2.api.BaseOauth2Api; import de.adorsys.xs2a.adapter.impl.oauth2.api.model.AuthorisationServerMetaData; import java.util.ArrayList; import java.util.List; public class AdorsysIntegServiceProvider extends AbstractAdapterServiceProvider implements Oauth2ServiceProvider { private final OauthHeaderInterceptor oauthHeaderInterceptor = new OauthHeaderInterceptor(); @Override public PaymentInitiationService getPaymentInitiationService(Aspsp aspsp, HttpClientFactory httpClientFactory, LinksRewriter linksRewriter) { HttpClientConfig config = httpClientFactory.getHttpClientConfig(); return new BasePaymentInitiationService(aspsp, httpClientFactory.getHttpClient(getAdapterId()), getInterceptors(aspsp, getAdorsysInterceptors(config.getKeyStore())), linksRewriter, config.getLogSanitizer()); } private Interceptor[] getAdorsysInterceptors(Pkcs12KeyStore keyStore) { List<Interceptor> interceptors = new ArrayList<>(); interceptors.add(oauthHeaderInterceptor); if (keyStore != null) { interceptors.add(new AdorsysSigningHeadersInterceptor(keyStore)); } return interceptors.toArray(new Interceptor[0]); } @Override public AccountInformationService getAccountInformationService(Aspsp aspsp, HttpClientFactory httpClientFactory, LinksRewriter linksRewriter) { HttpClientConfig config = httpClientFactory.getHttpClientConfig(); return new AdorsysAccountInformationService(aspsp, httpClientFactory, getInterceptors(aspsp, getAdorsysInterceptors(config.getKeyStore())), linksRewriter); } @Override public Oauth2Service getOauth2Service(Aspsp aspsp, HttpClientFactory httpClientFactory) { HttpClient httpClient = httpClientFactory.getHttpClient(getAdapterId()); HttpClientConfig config = httpClientFactory.getHttpClientConfig(); return new AdorsysIntegOauth2Service(aspsp, httpClientFactory, new BaseOauth2Api<>(httpClient, AuthorisationServerMetaData.class, config.getLogSanitizer())); } @Override public String getAdapterId() { return "adorsys-adapter"; } }
4,096
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdorsysIntegOauth2Service.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/main/java/de/adorsys/xs2a/adapter/adorsys/AdorsysIntegOauth2Service.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys; import de.adorsys.xs2a.adapter.api.Oauth2Service; import de.adorsys.xs2a.adapter.api.Response; import de.adorsys.xs2a.adapter.api.http.HttpClient; import de.adorsys.xs2a.adapter.api.http.HttpClientConfig; import de.adorsys.xs2a.adapter.api.http.HttpClientFactory; import de.adorsys.xs2a.adapter.api.model.Aspsp; import de.adorsys.xs2a.adapter.api.model.TokenResponse; import de.adorsys.xs2a.adapter.api.oauth.Oauth2Api; import de.adorsys.xs2a.adapter.api.validation.ValidationError; import de.adorsys.xs2a.adapter.impl.http.ResponseHandlers; import de.adorsys.xs2a.adapter.impl.http.StringUri; import org.apache.commons.lang3.StringUtils; import java.net.URI; import java.util.Collections; import java.util.List; import java.util.Map; import static de.adorsys.xs2a.adapter.api.validation.Validation.requireValid; public class AdorsysIntegOauth2Service implements Oauth2Service { private static final String SCA_OAUTH_LINK_MISSING_ERROR_MESSAGE = "SCA OAuth link is missing or has a wrong format: " + "it has to be either provided as a request parameter or preconfigured for the current ASPSP"; private final Aspsp aspsp; private final HttpClient httpClient; private final Oauth2Api oauth2Api; private final ResponseHandlers handlers; public AdorsysIntegOauth2Service(Aspsp aspsp, HttpClientFactory httpClientFactory, Oauth2Api oauth2Api) { HttpClientConfig httpClientConfig = httpClientFactory.getHttpClientConfig(); this.aspsp = aspsp; this.httpClient = httpClientFactory.getHttpClient(aspsp.getAdapterId()); this.oauth2Api = oauth2Api; this.handlers = new ResponseHandlers(httpClientConfig.getLogSanitizer()); } @Override public URI getAuthorizationRequestUri(Map<String, String> headers, Parameters parameters) { requireValid(validateGetAuthorizationRequestUri(headers, parameters)); String scaOAuthUrl = getScaOAuthUrl(parameters); String authorisationUri = oauth2Api.getAuthorisationUri(scaOAuthUrl); authorisationUri = StringUri.appendQueryParam( authorisationUri, "redirect_uri", parameters.getRedirectUri() ); return URI.create(authorisationUri); } @Override public List<ValidationError> validateGetAuthorizationRequestUri(Map<String, String> headers, Parameters parameters) { if (StringUtils.isBlank(getScaOAuthUrl(parameters))) { return Collections.singletonList(new ValidationError(ValidationError.Code.REQUIRED, Parameters.SCA_OAUTH_LINK, SCA_OAUTH_LINK_MISSING_ERROR_MESSAGE)); } return Collections.emptyList(); } @Override public TokenResponse getToken(Map<String, String> headers, Parameters parameters) { requireValid(validateGetToken(headers, parameters)); String scaOAuthUrl = getScaOAuthUrl(parameters); String url = StringUri.withQuery( oauth2Api.getTokenUri(scaOAuthUrl), "code", parameters.getAuthorizationCode() ); Response<TokenResponse> response = httpClient.post(url) .send(handlers.jsonResponseHandler(TokenResponse.class)); return response.getBody(); } @Override public List<ValidationError> validateGetToken(Map<String, String> headers, Parameters parameters) { String scaOAuthUrl = getScaOAuthUrl(parameters); if (StringUtils.isBlank(scaOAuthUrl) || !StringUri.containsProtocol(scaOAuthUrl)) { return Collections.singletonList(new ValidationError(ValidationError.Code.REQUIRED, Parameters.SCA_OAUTH_LINK, SCA_OAUTH_LINK_MISSING_ERROR_MESSAGE)); } return Collections.emptyList(); } private String getScaOAuthUrl(Parameters parameters) { String scaOAuthLinkParam = parameters.getScaOAuthLink(); if (StringUtils.isNotBlank(scaOAuthLinkParam)) { return StringUri.decode(scaOAuthLinkParam); } return aspsp.getIdpUrl(); } }
5,071
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdorsysTransactionsResponse200Json.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/main/java/de/adorsys/xs2a/adapter/adorsys/model/AdorsysTransactionsResponse200Json.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys.model; import com.fasterxml.jackson.annotation.JsonProperty; import de.adorsys.xs2a.adapter.api.model.*; import java.util.List; import java.util.Map; import java.util.Objects; public class AdorsysTransactionsResponse200Json { private AccountReference account; private AdorsysAccountReport transactions; private List<Balance> balances; @JsonProperty("_links") private Map<String, HrefType> links; public AccountReference getAccount() { return account; } public void setAccount(AccountReference account) { this.account = account; } public AdorsysAccountReport getTransactions() { return transactions; } public void setTransactions(AdorsysAccountReport transactions) { this.transactions = transactions; } public List<Balance> getBalances() { return balances; } public void setBalances(List<Balance> balances) { this.balances = balances; } public Map<String, HrefType> getLinks() { return links; } public void setLinks(Map<String, HrefType> links) { this.links = links; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AdorsysTransactionsResponse200Json that = (AdorsysTransactionsResponse200Json) o; return Objects.equals(account, that.account) && Objects.equals(transactions, that.transactions) && Objects.equals(balances, that.balances) && Objects.equals(links, that.links); } @Override public int hashCode() { return Objects.hash(account, transactions, balances, links); } }
2,627
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdorsysOK200TransactionDetails.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/main/java/de/adorsys/xs2a/adapter/adorsys/model/AdorsysOK200TransactionDetails.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys.model; import java.util.Objects; public class AdorsysOK200TransactionDetails { private AdorsysTransactionDetailsBody transactionsDetails; public AdorsysTransactionDetailsBody getTransactionsDetails() { return transactionsDetails; } public void setTransactionsDetails(AdorsysTransactionDetailsBody transactionsDetails) { this.transactionsDetails = transactionsDetails; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AdorsysOK200TransactionDetails that = (AdorsysOK200TransactionDetails) o; return Objects.equals(transactionsDetails, that.transactionsDetails); } @Override public int hashCode() { return Objects.hash(transactionsDetails); } }
1,703
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdorsysTransactionDetailsBody.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/main/java/de/adorsys/xs2a/adapter/adorsys/model/AdorsysTransactionDetailsBody.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys.model; import java.util.Objects; public class AdorsysTransactionDetailsBody { private AdorsysTransactions transactionDetails; public AdorsysTransactions getTransactionDetails() { return transactionDetails; } public void setTransactionDetails(AdorsysTransactions transactionDetails) { this.transactionDetails = transactionDetails; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AdorsysTransactionDetailsBody that = (AdorsysTransactionDetailsBody) o; return Objects.equals(transactionDetails, that.transactionDetails); } @Override public int hashCode() { return Objects.hash(transactionDetails); } }
1,660
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdorsysAccountReport.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/main/java/de/adorsys/xs2a/adapter/adorsys/model/AdorsysAccountReport.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys.model; import com.fasterxml.jackson.annotation.JsonProperty; import de.adorsys.xs2a.adapter.api.model.HrefType; import java.util.List; import java.util.Map; import java.util.Objects; public class AdorsysAccountReport { private List<AdorsysTransactions> booked; private List<AdorsysTransactions> pending; @JsonProperty("_links") private Map<String, HrefType> links; public List<AdorsysTransactions> getBooked() { return booked; } public void setBooked(List<AdorsysTransactions> booked) { this.booked = booked; } public List<AdorsysTransactions> getPending() { return pending; } public void setPending(List<AdorsysTransactions> pending) { this.pending = pending; } public Map<String, HrefType> getLinks() { return links; } public void setLinks(Map<String, HrefType> links) { this.links = links; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AdorsysAccountReport that = (AdorsysAccountReport) o; return Objects.equals(booked, that.booked) && Objects.equals(pending, that.pending) && Objects.equals(links, that.links); } @Override public int hashCode() { return Objects.hash(booked, pending, links); } }
2,292
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdorsysTransactions.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/adorsys-adapter/src/main/java/de/adorsys/xs2a/adapter/adorsys/model/AdorsysTransactions.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.adorsys.model; import com.fasterxml.jackson.annotation.JsonProperty; import de.adorsys.xs2a.adapter.api.model.*; import java.time.LocalDate; import java.util.List; import java.util.Map; import java.util.Objects; public class AdorsysTransactions { private String transactionId; private String entryReference; private String endToEndId; private String mandateId; private String checkId; private String creditorId; private LocalDate bookingDate; private LocalDate valueDate; private Amount transactionAmount; private List<ReportExchangeRate> currencyExchange; private String creditorName; private AccountReference creditorAccount; private String creditorAgent; private String ultimateCreditor; private String debtorName; private AccountReference debtorAccount; private String debtorAgent; private String ultimateDebtor; private String remittanceInformationUnstructured; private List<String> remittanceInformationUnstructuredArray; private String remittanceInformationStructured; private List<String> remittanceInformationStructuredArray; private String additionalInformation; private AdditionalInformationStructured additionalInformationStructured; private PurposeCode purposeCode; private String bankTransactionCode; private String proprietaryBankTransactionCode; private Balance balanceAfterTransaction; @JsonProperty("_links") private Map<String, HrefType> links; public String getTransactionId() { return transactionId; } public void setTransactionId(String transactionId) { this.transactionId = transactionId; } public String getEntryReference() { return entryReference; } public void setEntryReference(String entryReference) { this.entryReference = entryReference; } public String getEndToEndId() { return endToEndId; } public void setEndToEndId(String endToEndId) { this.endToEndId = endToEndId; } public String getMandateId() { return mandateId; } public void setMandateId(String mandateId) { this.mandateId = mandateId; } public String getCheckId() { return checkId; } public void setCheckId(String checkId) { this.checkId = checkId; } public String getCreditorId() { return creditorId; } public void setCreditorId(String creditorId) { this.creditorId = creditorId; } public LocalDate getBookingDate() { return bookingDate; } public void setBookingDate(LocalDate bookingDate) { this.bookingDate = bookingDate; } public LocalDate getValueDate() { return valueDate; } public void setValueDate(LocalDate valueDate) { this.valueDate = valueDate; } public Amount getTransactionAmount() { return transactionAmount; } public void setTransactionAmount(Amount transactionAmount) { this.transactionAmount = transactionAmount; } public List<ReportExchangeRate> getCurrencyExchange() { return currencyExchange; } public void setCurrencyExchange(List<ReportExchangeRate> currencyExchange) { this.currencyExchange = currencyExchange; } public String getCreditorName() { return creditorName; } public void setCreditorName(String creditorName) { this.creditorName = creditorName; } public AccountReference getCreditorAccount() { return creditorAccount; } public void setCreditorAccount(AccountReference creditorAccount) { this.creditorAccount = creditorAccount; } public String getCreditorAgent() { return creditorAgent; } public void setCreditorAgent(String creditorAgent) { this.creditorAgent = creditorAgent; } public String getUltimateCreditor() { return ultimateCreditor; } public void setUltimateCreditor(String ultimateCreditor) { this.ultimateCreditor = ultimateCreditor; } public String getDebtorName() { return debtorName; } public void setDebtorName(String debtorName) { this.debtorName = debtorName; } public AccountReference getDebtorAccount() { return debtorAccount; } public void setDebtorAccount(AccountReference debtorAccount) { this.debtorAccount = debtorAccount; } public String getDebtorAgent() { return debtorAgent; } public void setDebtorAgent(String debtorAgent) { this.debtorAgent = debtorAgent; } public String getUltimateDebtor() { return ultimateDebtor; } public void setUltimateDebtor(String ultimateDebtor) { this.ultimateDebtor = ultimateDebtor; } public String getRemittanceInformationUnstructured() { return remittanceInformationUnstructured; } public void setRemittanceInformationUnstructured(String remittanceInformationUnstructured) { this.remittanceInformationUnstructured = remittanceInformationUnstructured; } public List<String> getRemittanceInformationUnstructuredArray() { return remittanceInformationUnstructuredArray; } public void setRemittanceInformationUnstructuredArray( List<String> remittanceInformationUnstructuredArray) { this.remittanceInformationUnstructuredArray = remittanceInformationUnstructuredArray; } public String getRemittanceInformationStructured() { return remittanceInformationStructured; } public void setRemittanceInformationStructured(String remittanceInformationStructured) { this.remittanceInformationStructured = remittanceInformationStructured; } public List<String> getRemittanceInformationStructuredArray() { return remittanceInformationStructuredArray; } public void setRemittanceInformationStructuredArray( List<String> remittanceInformationStructuredArray) { this.remittanceInformationStructuredArray = remittanceInformationStructuredArray; } public String getAdditionalInformation() { return additionalInformation; } public void setAdditionalInformation(String additionalInformation) { this.additionalInformation = additionalInformation; } public AdditionalInformationStructured getAdditionalInformationStructured() { return additionalInformationStructured; } public void setAdditionalInformationStructured( AdditionalInformationStructured additionalInformationStructured) { this.additionalInformationStructured = additionalInformationStructured; } public PurposeCode getPurposeCode() { return purposeCode; } public void setPurposeCode(PurposeCode purposeCode) { this.purposeCode = purposeCode; } public String getBankTransactionCode() { return bankTransactionCode; } public void setBankTransactionCode(String bankTransactionCode) { this.bankTransactionCode = bankTransactionCode; } public String getProprietaryBankTransactionCode() { return proprietaryBankTransactionCode; } public void setProprietaryBankTransactionCode(String proprietaryBankTransactionCode) { this.proprietaryBankTransactionCode = proprietaryBankTransactionCode; } public Balance getBalanceAfterTransaction() { return balanceAfterTransaction; } public void setBalanceAfterTransaction(Balance balanceAfterTransaction) { this.balanceAfterTransaction = balanceAfterTransaction; } public Map<String, HrefType> getLinks() { return links; } public void setLinks(Map<String, HrefType> links) { this.links = links; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AdorsysTransactions that = (AdorsysTransactions) o; return Objects.equals(transactionId, that.transactionId) && Objects.equals(entryReference, that.entryReference) && Objects.equals(endToEndId, that.endToEndId) && Objects.equals(mandateId, that.mandateId) && Objects.equals(checkId, that.checkId) && Objects.equals(creditorId, that.creditorId) && Objects.equals(bookingDate, that.bookingDate) && Objects.equals(valueDate, that.valueDate) && Objects.equals(transactionAmount, that.transactionAmount) && Objects.equals(currencyExchange, that.currencyExchange) && Objects.equals(creditorName, that.creditorName) && Objects.equals(creditorAccount, that.creditorAccount) && Objects.equals(creditorAgent, that.creditorAgent) && Objects.equals(ultimateCreditor, that.ultimateCreditor) && Objects.equals(debtorName, that.debtorName) && Objects.equals(debtorAccount, that.debtorAccount) && Objects.equals(debtorAgent, that.debtorAgent) && Objects.equals(ultimateDebtor, that.ultimateDebtor) && Objects.equals(remittanceInformationUnstructured, that.remittanceInformationUnstructured) && Objects.equals(remittanceInformationUnstructuredArray, that.remittanceInformationUnstructuredArray) && Objects.equals(remittanceInformationStructured, that.remittanceInformationStructured) && Objects.equals(remittanceInformationStructuredArray, that.remittanceInformationStructuredArray) && Objects.equals(additionalInformation, that.additionalInformation) && Objects.equals(additionalInformationStructured, that.additionalInformationStructured) && Objects.equals(purposeCode, that.purposeCode) && Objects.equals(bankTransactionCode, that.bankTransactionCode) && Objects.equals(proprietaryBankTransactionCode, that.proprietaryBankTransactionCode) && Objects.equals(balanceAfterTransaction, that.balanceAfterTransaction) && Objects.equals(links, that.links); } @Override public int hashCode() { return Objects.hash(transactionId, entryReference, endToEndId, mandateId, checkId, creditorId, bookingDate, valueDate, transactionAmount, currencyExchange, creditorName, creditorAccount, creditorAgent, ultimateCreditor, debtorName, debtorAccount, debtorAgent, ultimateDebtor, remittanceInformationUnstructured, remittanceInformationUnstructuredArray, remittanceInformationStructured, remittanceInformationStructuredArray, additionalInformation, additionalInformationStructured, purposeCode, bankTransactionCode, proprietaryBankTransactionCode, balanceAfterTransaction, links); } }
11,964
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaAccountInformationServiceWireMockTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/test/java/de/adorsys/xs2a/adapter/fiducia/FiduciaAccountInformationServiceWireMockTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia; import de.adorsys.xs2a.adapter.api.AccountInformationService; import de.adorsys.xs2a.adapter.api.RequestParams; import de.adorsys.xs2a.adapter.api.Response; import de.adorsys.xs2a.adapter.api.exception.ErrorResponseException; import de.adorsys.xs2a.adapter.api.model.*; import de.adorsys.xs2a.adapter.test.ServiceWireMockTest; import de.adorsys.xs2a.adapter.test.TestRequestResponse; import org.junit.jupiter.api.Test; import java.io.IOException; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowableOfType; @ServiceWireMockTest(FiduciaServiceProvider.class) class FiduciaAccountInformationServiceWireMockTest { private static final String CONSENT_ID = "8117230618090020246PSDDE-BAFIN-911360CO4960JJ"; private static final String AUTHORISATION_ID = "0942330618090020247PSDDE-BAFIN-911360AU4960JJ"; private static final String ACCOUNT_ID = "imxyy9AzEHJ0ZRRTWQKJtt"; private final AccountInformationService service; FiduciaAccountInformationServiceWireMockTest(AccountInformationService service) { this.service = service; } @Test void createConsent() throws IOException { TestRequestResponse requestResponse = new TestRequestResponse("ais/create-consent.json"); Response<ConsentsResponse201> response = service.createConsent(requestResponse.requestHeaders(), RequestParams.empty(), requestResponse.requestBody(Consents.class)); assertThat(response.getBody()).isEqualTo(requestResponse.responseBody(ConsentsResponse201.class)); } @Test void authenticatePsu() throws Exception { TestRequestResponse requestResponse = new TestRequestResponse("ais/authenticate-psu.json"); Response<StartScaprocessResponse> response = service.startConsentAuthorisation(CONSENT_ID, requestResponse.requestHeaders(), RequestParams.empty(), requestResponse.requestBody(UpdatePsuAuthentication.class)); assertThat(response.getBody()).isEqualTo(requestResponse.responseBody(StartScaprocessResponse.class)); } @Test void selectScaMethod() throws Exception { TestRequestResponse requestResponse = new TestRequestResponse("ais/select-sca-method.json"); Response<SelectPsuAuthenticationMethodResponse> response = service.updateConsentsPsuData(CONSENT_ID, AUTHORISATION_ID, requestResponse.requestHeaders(), RequestParams.empty(), requestResponse.requestBody(SelectPsuAuthenticationMethod.class)); assertThat(response.getBody()) .isEqualTo(requestResponse.responseBody(SelectPsuAuthenticationMethodResponse.class)); } @Test void authoriseTransaction() throws Exception { TestRequestResponse requestResponse = new TestRequestResponse("ais/authorise-transaction.json"); Response<ScaStatusResponse> response = service.updateConsentsPsuData(CONSENT_ID, AUTHORISATION_ID, requestResponse.requestHeaders(), RequestParams.empty(), requestResponse.requestBody(TransactionAuthorisation.class)); assertThat(response.getBody()).isEqualTo(requestResponse.responseBody(ScaStatusResponse.class)); } @Test void getAccounts() throws Exception { TestRequestResponse requestResponse = new TestRequestResponse("ais/get-accounts.json"); Response<AccountList> response = service.getAccountList(requestResponse.requestHeaders(), requestResponse.requestParams()); assertThat(response.getBody()).isEqualTo(requestResponse.responseBody(AccountList.class)); } @Test void getTransactions() throws Exception { TestRequestResponse requestResponse = new TestRequestResponse("ais/get-transactions.json"); Response<TransactionsResponse200Json> response = service.getTransactionList(ACCOUNT_ID, requestResponse.requestHeaders(), requestResponse.requestParams()); assertThat(response.getBody()).isEqualTo(requestResponse.responseBody(TransactionsResponse200Json.class)); } @Test void getConsentStatus() throws Exception { TestRequestResponse requestResponse = new TestRequestResponse("ais/get-consent-status.json"); Response<ConsentStatusResponse200> response = service.getConsentStatus(CONSENT_ID, requestResponse.requestHeaders(), RequestParams.empty()); assertThat(response.getBody()).isEqualTo(requestResponse.responseBody(ConsentStatusResponse200.class)); } @Test void deleteConsent() throws Exception { TestRequestResponse requestResponse = new TestRequestResponse("ais/delete-consent.json"); Response<Void> response = service.deleteConsent(CONSENT_ID, requestResponse.requestHeaders(), RequestParams.empty()); assertThat(response.getStatusCode()).isEqualTo(204); } @Test void getScaStatus() throws Exception { TestRequestResponse requestResponse = new TestRequestResponse("ais/get-sca-status.json"); Throwable exception = catchThrowableOfType(() -> service.getConsentScaStatus(CONSENT_ID, AUTHORISATION_ID, requestResponse.requestHeaders(), RequestParams.empty()), ErrorResponseException.class); assertThat(exception.getMessage()).isEqualTo(requestResponse.responseBody()); } }
6,388
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaServiceProviderTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/test/java/de/adorsys/xs2a/adapter/fiducia/FiduciaServiceProviderTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia; import de.adorsys.xs2a.adapter.api.AccountInformationService; import de.adorsys.xs2a.adapter.api.PaymentInitiationService; import de.adorsys.xs2a.adapter.api.http.HttpClientConfig; import de.adorsys.xs2a.adapter.api.http.HttpClientFactory; import de.adorsys.xs2a.adapter.api.model.Aspsp; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; class FiduciaServiceProviderTest { private FiduciaServiceProvider serviceProvider; private final HttpClientConfig httpClientConfig = mock(HttpClientConfig.class); private final HttpClientFactory httpClientFactory = mock(HttpClientFactory.class); private final Aspsp aspsp = new Aspsp(); @BeforeEach void setUp() { serviceProvider = new FiduciaServiceProvider(); when(httpClientFactory.getHttpClientConfig()).thenReturn(httpClientConfig); } @Test void getAccountInformationService() { AccountInformationService actualService = serviceProvider.getAccountInformationService(aspsp, httpClientFactory, null); assertThat(actualService) .isExactlyInstanceOf(FiduciaAccountInformationService.class); } @Test void getPaymentInitiationService() { PaymentInitiationService actualService = serviceProvider.getPaymentInitiationService(aspsp, httpClientFactory, null); assertThat(actualService) .isExactlyInstanceOf(FiduciaPaymentInitiationService.class); } }
2,476
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaPaymentInitiationServiceTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/test/java/de/adorsys/xs2a/adapter/fiducia/FiduciaPaymentInitiationServiceTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.Response; import de.adorsys.xs2a.adapter.api.ResponseHeaders; import de.adorsys.xs2a.adapter.api.http.HttpClient; import de.adorsys.xs2a.adapter.api.http.HttpClient.ResponseHandler; import de.adorsys.xs2a.adapter.api.http.HttpClientConfig; import de.adorsys.xs2a.adapter.api.http.HttpClientFactory; import de.adorsys.xs2a.adapter.api.http.Request; import de.adorsys.xs2a.adapter.api.model.*; import de.adorsys.xs2a.adapter.fiducia.model.FiduciaDayOfExecution; import de.adorsys.xs2a.adapter.fiducia.model.FiduciaExecutionRule; import de.adorsys.xs2a.adapter.fiducia.model.FiduciaPaymentInitationRequestResponse201; import de.adorsys.xs2a.adapter.fiducia.model.FiduciaPeriodicPaymentInitiationJson; import de.adorsys.xs2a.adapter.impl.http.AbstractHttpClient; import de.adorsys.xs2a.adapter.impl.http.JacksonObjectMapper; import de.adorsys.xs2a.adapter.impl.link.identity.IdentityLinksRewriter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import java.io.ByteArrayInputStream; import static java.util.Collections.singletonMap; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.*; class FiduciaPaymentInitiationServiceTest { private FiduciaPaymentInitiationService fiduciaPaymentInitiationService; private HttpClient httpClient; private HttpClientFactory httpClientFactory; private HttpClientConfig httpClientConfig; @BeforeEach void setUp() { httpClient = spy(AbstractHttpClient.class); httpClientFactory = mock(HttpClientFactory.class); httpClientConfig = mock(HttpClientConfig.class); when(httpClientFactory.getHttpClient(any())).thenReturn(httpClient); when(httpClientFactory.getHttpClientConfig()).thenReturn(httpClientConfig); fiduciaPaymentInitiationService = new FiduciaPaymentInitiationService(new Aspsp(), httpClientFactory, null, new IdentityLinksRewriter()); } @Test void initiatePaymentResponseUsesFiduciaChallengeData() { Mockito.doAnswer(invocationOnMock -> { HttpClient.ResponseHandler responseHandler = invocationOnMock.getArgument(1, HttpClient.ResponseHandler.class); //language=JSON String rawResponse = "{\n" + " \"challengeData\": {\n" + " \"data\": \"data\"\n" + " }\n" + "}"; return new Response<>(201, responseHandler.apply(201, new ByteArrayInputStream(rawResponse.getBytes()), ResponseHeaders.fromMap(singletonMap("Content-Type", "application/json"))), null); }).when(httpClient).send(Mockito.any(), Mockito.any()); Response<PaymentInitationRequestResponse201> response = fiduciaPaymentInitiationService.initiatePayment( PaymentService.PAYMENTS, PaymentProduct.SEPA_CREDIT_TRANSFERS, RequestHeaders.empty(), null, new PaymentInitiationJson()); assertThat(response.getBody().getChallengeData().getData().get(0)).isEqualTo("data"); } @Test void updatePaymentPsuDataSelectPsuAuthenticationMethodResponseUsesFiduciaChallengeData() { Mockito.doAnswer(invocationOnMock -> { HttpClient.ResponseHandler responseHandler = invocationOnMock.getArgument(1, HttpClient.ResponseHandler.class); //language=JSON String rawResponse = "{\n" + " \"challengeData\": {\n" + " \"data\": \"data\"\n" + " }\n" + "}"; return new Response<>(200, responseHandler.apply(200, new ByteArrayInputStream(rawResponse.getBytes()), ResponseHeaders.fromMap(singletonMap("Content-Type", "application/json"))), null); }).when(httpClient).send(Mockito.any(), Mockito.any()); Response<SelectPsuAuthenticationMethodResponse> response = fiduciaPaymentInitiationService.updatePaymentPsuData( PaymentService.PAYMENTS, PaymentProduct.SEPA_CREDIT_TRANSFERS, null, null, RequestHeaders.empty(), null, new SelectPsuAuthenticationMethod()); assertThat(response.getBody().getChallengeData().getData().get(0)).isEqualTo("data"); } @Test void startPaymentAuthorisationStartScaprocessResponseUsesFiduciaChallengeData() { Mockito.doAnswer(invocationOnMock -> { HttpClient.ResponseHandler responseHandler = invocationOnMock.getArgument(1, HttpClient.ResponseHandler.class); //language=JSON String rawResponse = "{\n" + " \"challengeData\": {\n" + " \"data\": \"data\"\n" + " }\n" + "}"; return new Response<>(200, responseHandler.apply(200, new ByteArrayInputStream(rawResponse.getBytes()), ResponseHeaders.fromMap(singletonMap("Content-Type", "application/json"))), null); }).when(httpClient).send(Mockito.any(), Mockito.any()); Response<StartScaprocessResponse> response = fiduciaPaymentInitiationService.startPaymentAuthorisation( PaymentService.PAYMENTS, PaymentProduct.SEPA_CREDIT_TRANSFERS, null, RequestHeaders.empty(), null, new UpdatePsuAuthentication()); assertThat(response.getBody().getChallengeData().getData().get(0)).isEqualTo("data"); } @Test void startPaymentAuthorisationWithoutRequestBodyStartScaprocessResponseUsesFiduciaChallengeData() { Mockito.doAnswer(invocationOnMock -> { HttpClient.ResponseHandler responseHandler = invocationOnMock.getArgument(1, HttpClient.ResponseHandler.class); //language=JSON String rawResponse = "{\n" + " \"challengeData\": {\n" + " \"data\": \"data\"\n" + " }\n" + "}"; return new Response<>(200, responseHandler.apply(200, new ByteArrayInputStream(rawResponse.getBytes()), ResponseHeaders.fromMap(singletonMap("Content-Type", "application/json"))), null); }).when(httpClient).send(Mockito.any(), Mockito.any()); Response<StartScaprocessResponse> response = fiduciaPaymentInitiationService.startPaymentAuthorisation( PaymentService.PAYMENTS, PaymentProduct.SEPA_CREDIT_TRANSFERS, null, RequestHeaders.empty(), null); assertThat(response.getBody().getChallengeData().getData().get(0)).isEqualTo("data"); } @Test void updatePaymentPsuDataUpdatePsuAuthenticationResponseUsesFiduciaChallengeData() { Mockito.doAnswer(invocationOnMock -> { HttpClient.ResponseHandler responseHandler = invocationOnMock.getArgument(1, HttpClient.ResponseHandler.class); //language=JSON String rawResponse = "{\n" + " \"challengeData\": {\n" + " \"data\": \"data\"\n" + " }\n" + "}"; return new Response<>(200, responseHandler.apply(200, new ByteArrayInputStream(rawResponse.getBytes()), ResponseHeaders.fromMap(singletonMap("Content-Type", "application/json"))), null); }).when(httpClient).send(Mockito.any(), Mockito.any()); Response<UpdatePsuAuthenticationResponse> response = fiduciaPaymentInitiationService.updatePaymentPsuData( PaymentService.PAYMENTS, PaymentProduct.SEPA_CREDIT_TRANSFERS, null, null, RequestHeaders.empty(), null, new UpdatePsuAuthentication()); assertThat(response.getBody().getChallengeData().getData().get(0)).isEqualTo("data"); } @Test void initiatePeriodicSctPaymentUsesFiduciaExecutionRule() { PeriodicPaymentInitiationJson body = new PeriodicPaymentInitiationJson(); body.setExecutionRule(ExecutionRule.PRECEDING); Mockito.doReturn(new Response<>(201, new FiduciaPaymentInitationRequestResponse201(), null)) .when(httpClient).send(Mockito.any(), Mockito.any()); fiduciaPaymentInitiationService.initiatePayment(PaymentService.PERIODIC_PAYMENTS, PaymentProduct.SEPA_CREDIT_TRANSFERS, RequestHeaders.empty(), null, body); FiduciaPeriodicPaymentInitiationJson actualBody = new FiduciaPeriodicPaymentInitiationJson(); actualBody.setExecutionRule(FiduciaExecutionRule.PRECEDING); ArgumentCaptor<Request.Builder> requestBuilderArgumentCaptor = ArgumentCaptor.forClass(Request.Builder.class); Mockito.verify(httpClient).send(requestBuilderArgumentCaptor.capture(), Mockito.any()); assertThat(requestBuilderArgumentCaptor.getValue().body()) .isEqualTo(new JacksonObjectMapper().writeValueAsString(actualBody)); } @Test void initiatePeriodicSctPaymentUsesFiduciaDayOfExecution() { PeriodicPaymentInitiationJson body = new PeriodicPaymentInitiationJson(); body.setDayOfExecution(DayOfExecution._1); Mockito.doReturn(new Response<>(201, new FiduciaPaymentInitationRequestResponse201(), null)) .when(httpClient).send(Mockito.any(), Mockito.any()); fiduciaPaymentInitiationService.initiatePayment(PaymentService.PERIODIC_PAYMENTS, PaymentProduct.SEPA_CREDIT_TRANSFERS, RequestHeaders.empty(), null, body); FiduciaPeriodicPaymentInitiationJson actualBody = new FiduciaPeriodicPaymentInitiationJson(); actualBody.setDayOfExecution(FiduciaDayOfExecution._1); ArgumentCaptor<Request.Builder> requestBuilderArgumentCaptor = ArgumentCaptor.forClass(Request.Builder.class); Mockito.verify(httpClient).send(requestBuilderArgumentCaptor.capture(), Mockito.any()); assertThat(requestBuilderArgumentCaptor.getValue().body()) .isEqualTo(new JacksonObjectMapper().writeValueAsString(actualBody)); } @Test void getPeriodicPaymentInformationUsesFiduciaExecutionRule() { Mockito.doAnswer(invocationOnMock -> { ResponseHandler responseHandler = invocationOnMock.getArgument(1, ResponseHandler.class); String rawResponse = "{\"executionRule\":\"preceeding\"}"; return new Response<>(200, responseHandler.apply(200, new ByteArrayInputStream(rawResponse.getBytes()), ResponseHeaders.emptyResponseHeaders()), null); }).when(httpClient).send(Mockito.any(), Mockito.any()); Response<PeriodicPaymentInitiationWithStatusResponse> adaptedResponse = fiduciaPaymentInitiationService.getPeriodicPaymentInformation(PaymentProduct.SEPA_CREDIT_TRANSFERS, null, RequestHeaders.empty(), null); assertThat(adaptedResponse.getBody().getExecutionRule()).isEqualTo(ExecutionRule.PRECEDING); } @Test void getPeriodicPaymentInformationUsesFiduciaDayOfExecution() { Mockito.doAnswer(invocationOnMock -> { ResponseHandler responseHandler = invocationOnMock.getArgument(1, ResponseHandler.class); String rawResponse = "{\"dayOfExecution\":\"01\"}"; return new Response<>(200, responseHandler.apply(200, new ByteArrayInputStream(rawResponse.getBytes()), ResponseHeaders.emptyResponseHeaders()), null); }).when(httpClient).send(Mockito.any(), Mockito.any()); Response<PeriodicPaymentInitiationWithStatusResponse> adaptedResponse = fiduciaPaymentInitiationService.getPeriodicPaymentInformation(PaymentProduct.SEPA_CREDIT_TRANSFERS, null, RequestHeaders.empty(), null); assertThat(adaptedResponse.getBody().getDayOfExecution()).isEqualTo(DayOfExecution._1); } @Test void getPeriodicPain001PaymentInformationUsesFiduciaExecutionRule() { Mockito.doAnswer(invocationOnMock -> { ResponseHandler responseHandler = invocationOnMock.getArgument(1, ResponseHandler.class); String rawResponse = "---\r\n" + "Content-Disposition: form-data; name=\"json_standingorderType\"\r\n" + "Content-Type: application/json\r\n\r\n" + "{\"executionRule\":\"preceeding\"}\r\n" + "-----\r\n"; return new Response<>(200, responseHandler.apply(200, new ByteArrayInputStream(rawResponse.getBytes()), ResponseHeaders.fromMap(singletonMap("Content-Type", "multipart/form-data; boundary=-"))), null); }).when(httpClient).send(Mockito.any(), Mockito.any()); Response<PeriodicPaymentInitiationMultipartBody> adaptedResponse = fiduciaPaymentInitiationService.getPeriodicPain001PaymentInformation(PaymentProduct.PAIN_001_SEPA_CREDIT_TRANSFERS, null, RequestHeaders.empty(), null); assertThat(adaptedResponse.getBody().getJson_standingorderType().getExecutionRule()) .isEqualTo(ExecutionRule.PRECEDING); } @Test void getPeriodicPain001PaymentInformationUsesFiduciaDayOfExecution() { Mockito.doAnswer(invocationOnMock -> { ResponseHandler responseHandler = invocationOnMock.getArgument(1, ResponseHandler.class); String rawResponse = "---\r\n" + "Content-Disposition: form-data; name=\"json_standingorderType\"\r\n" + "Content-Type: application/json\r\n\r\n" + "{\"dayOfExecution\":\"01\"}\r\n" + "-----\r\n"; return new Response<>(200, responseHandler.apply(200, new ByteArrayInputStream(rawResponse.getBytes()), ResponseHeaders.fromMap(singletonMap("Content-Type", "multipart/form-data; boundary=-"))), null); }).when(httpClient).send(Mockito.any(), Mockito.any()); Response<PeriodicPaymentInitiationMultipartBody> adaptedResponse = fiduciaPaymentInitiationService.getPeriodicPain001PaymentInformation(PaymentProduct.PAIN_001_SEPA_CREDIT_TRANSFERS, null, RequestHeaders.empty(), null); assertThat(adaptedResponse.getBody().getJson_standingorderType().getDayOfExecution()) .isEqualTo(DayOfExecution._1); } }
15,956
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaAccountInformationServiceTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/test/java/de/adorsys/xs2a/adapter/fiducia/FiduciaAccountInformationServiceTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.RequestParams; import de.adorsys.xs2a.adapter.api.Response; import de.adorsys.xs2a.adapter.api.ResponseHeaders; import de.adorsys.xs2a.adapter.api.http.HttpClient; import de.adorsys.xs2a.adapter.api.http.HttpClientConfig; import de.adorsys.xs2a.adapter.api.http.HttpClientFactory; import de.adorsys.xs2a.adapter.api.model.*; import de.adorsys.xs2a.adapter.api.validation.RequestValidationException; import de.adorsys.xs2a.adapter.impl.http.AbstractHttpClient; import de.adorsys.xs2a.adapter.impl.link.identity.IdentityLinksRewriter; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.mockito.Mockito; import java.io.ByteArrayInputStream; import java.util.HashMap; import java.util.Map; import static java.util.Collections.singletonMap; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; class FiduciaAccountInformationServiceTest { private static final String ACCOUNT_ID = "1234567890"; private static final String UNSUPPORTED_BOOKING_STATUS = "unsupported"; private final HttpClient httpClient = Mockito.spy(AbstractHttpClient.class); private final HttpClientFactory httpClientFactory = mock(HttpClientFactory.class); private final HttpClientConfig httpClientConfig = mock(HttpClientConfig.class); private FiduciaAccountInformationService service; @BeforeEach void setUp() { when(httpClientFactory.getHttpClient(any())).thenReturn(httpClient); when(httpClientFactory.getHttpClientConfig()).thenReturn(httpClientConfig); service = new FiduciaAccountInformationService(new Aspsp(), httpClientFactory, null, new IdentityLinksRewriter()); } @ParameterizedTest @ValueSource(strings = {"booked", "information"}) void getTransactionList_success_checkSupportedBookingStatuses(String status) { RequestHeaders requestHeaders = RequestHeaders.fromMap(new HashMap<>()); RequestParams requestParams = RequestParams.fromMap(buildRequestParamsMapWithBookingStatus(status)); Assertions.assertDoesNotThrow( () -> service.validateGetTransactionList(ACCOUNT_ID, requestHeaders, requestParams) ); } @Test void getTransactionList_failure_notSupportedBookingStatus() { RequestHeaders requestHeaders = RequestHeaders.fromMap(new HashMap<>()); RequestParams requestParams = RequestParams.fromMap(buildRequestParamsMapWithBookingStatus(UNSUPPORTED_BOOKING_STATUS)); Assertions.assertThrows( RequestValidationException.class, () -> service.getTransactionList(ACCOUNT_ID, requestHeaders, requestParams) ); } @Test void getTransactionListAsString_failure_notSupportedBookingStatus() { RequestHeaders requestHeaders = RequestHeaders.fromMap(new HashMap<>()); RequestParams requestParams = RequestParams.fromMap(buildRequestParamsMapWithBookingStatus(UNSUPPORTED_BOOKING_STATUS)); Assertions.assertThrows( RequestValidationException.class, () -> service.getTransactionListAsString(ACCOUNT_ID, requestHeaders, requestParams) ); } private Map<String, String> buildRequestParamsMapWithBookingStatus(String bookingStatus) { Map<String, String> requestParams = new HashMap<>(); requestParams.put(RequestParams.BOOKING_STATUS, bookingStatus); return requestParams; } @Test void getTransactionListUsesFiduciaExecutionRule() { Mockito.doAnswer(invocationOnMock -> { HttpClient.ResponseHandler responseHandler = invocationOnMock.getArgument(1, HttpClient.ResponseHandler.class); //language=JSON String rawResponse = "{\n" + " \"transactions\": {\n" + " \"booked\": [\n" + " {\n" + " \"additionalInformationStructured\": {\n" + " \"standingOrderDetails\": {\n" + " \"executionRule\": \"preceeding\"\n" + " }\n" + " }\n" + " }\n" + " ]\n" + " }\n" + "}"; return new Response<>(200, responseHandler.apply(200, new ByteArrayInputStream(rawResponse.getBytes()), ResponseHeaders.fromMap(singletonMap("Content-Type", "application/json"))), null); }).when(httpClient).send(Mockito.any(), Mockito.any()); Response<TransactionsResponse200Json> response = service.getTransactionList(null, RequestHeaders.empty(), RequestParams.empty()); ExecutionRule executionRule = response.getBody() .getTransactions() .getBooked() .get(0) .getAdditionalInformationStructured() .getStandingOrderDetails() .getExecutionRule(); assertThat(executionRule).isEqualTo(ExecutionRule.PRECEDING); } @Test void getTransactionDetailsUsesFiduciaExecutionRule() { Mockito.doAnswer(invocationOnMock -> { HttpClient.ResponseHandler responseHandler = invocationOnMock.getArgument(1, HttpClient.ResponseHandler.class); //language=JSON String rawResponse = "{\n" + " \"transactionsDetails\": {\n" + " \"additionalInformationStructured\": {\n" + " \"standingOrderDetails\": {\n" + " \"executionRule\": \"preceeding\"\n" + " }\n" + " }\n" + " }\n" + "}"; return new Response<>(200, responseHandler.apply(200, new ByteArrayInputStream(rawResponse.getBytes()), ResponseHeaders.fromMap(singletonMap("Content-Type", "application/json"))), null); }).when(httpClient).send(Mockito.any(), Mockito.any()); Response<OK200TransactionDetails> response = service.getTransactionDetails((String) null, (String) null, RequestHeaders.empty(), RequestParams.empty()); ExecutionRule executionRule = response.getBody() .getTransactionsDetails() .getAdditionalInformationStructured() .getStandingOrderDetails() .getExecutionRule(); assertThat(executionRule).isEqualTo(ExecutionRule.PRECEDING); } @Test void getTransactionListUsesFiduciaDayOfExecution() { Mockito.doAnswer(invocationOnMock -> { HttpClient.ResponseHandler responseHandler = invocationOnMock.getArgument(1, HttpClient.ResponseHandler.class); //language=JSON String rawResponse = "{\n" + " \"transactions\": {\n" + " \"booked\": [\n" + " {\n" + " \"additionalInformationStructured\": {\n" + " \"standingOrderDetails\": {\n" + " \"dayOfExecution\": \"01\"\n" + " }\n" + " }\n" + " }\n" + " ]\n" + " }\n" + "}"; return new Response<>(200, responseHandler.apply(200, new ByteArrayInputStream(rawResponse.getBytes()), ResponseHeaders.fromMap(singletonMap("Content-Type", "application/json"))), null); }).when(httpClient).send(Mockito.any(), Mockito.any()); Response<TransactionsResponse200Json> response = service.getTransactionList(null, RequestHeaders.empty(), RequestParams.empty()); DayOfExecution dayOfExecution = response.getBody() .getTransactions() .getBooked() .get(0) .getAdditionalInformationStructured() .getStandingOrderDetails() .getDayOfExecution(); assertThat(dayOfExecution).isEqualTo(DayOfExecution._1); } @Test void getTransactionDetailsUsesFiduciaDayOfExecution() { Mockito.doAnswer(invocationOnMock -> { HttpClient.ResponseHandler responseHandler = invocationOnMock.getArgument(1, HttpClient.ResponseHandler.class); //language=JSON String rawResponse = "{\n" + " \"transactionsDetails\": {\n" + " \"additionalInformationStructured\": {\n" + " \"standingOrderDetails\": {\n" + " \"dayOfExecution\": \"01\"\n" + " }\n" + " }\n" + " }\n" + "}"; return new Response<>(200, responseHandler.apply(200, new ByteArrayInputStream(rawResponse.getBytes()), ResponseHeaders.fromMap(singletonMap("Content-Type", "application/json"))), null); }).when(httpClient).send(Mockito.any(), Mockito.any()); Response<OK200TransactionDetails> response = service.getTransactionDetails((String) null, (String) null, RequestHeaders.empty(), RequestParams.empty()); DayOfExecution dayOfExecution = response.getBody() .getTransactionsDetails() .getAdditionalInformationStructured() .getStandingOrderDetails() .getDayOfExecution(); assertThat(dayOfExecution).isEqualTo(DayOfExecution._1); } @Test void getTransactionListUsesFiduciaMonthsOfExecution() { Mockito.doAnswer(invocationOnMock -> { HttpClient.ResponseHandler responseHandler = invocationOnMock.getArgument(1, HttpClient.ResponseHandler.class); //language=JSON String rawResponse = "{\n" + " \"transactions\": {\n" + " \"booked\": [\n" + " {\n" + " \"additionalInformationStructured\": {\n" + " \"standingOrderDetails\": {\n" + " \"monthsOfExecution\": [\"01\"]\n" + " }\n" + " }\n" + " }\n" + " ]\n" + " }\n" + "}"; return new Response<>(200, responseHandler.apply(200, new ByteArrayInputStream(rawResponse.getBytes()), ResponseHeaders.fromMap(singletonMap("Content-Type", "application/json"))), null); }).when(httpClient).send(Mockito.any(), Mockito.any()); Response<TransactionsResponse200Json> response = service.getTransactionList(null, RequestHeaders.empty(), RequestParams.empty()); StandingOrderDetails.MonthsOfExecution monthsOfExecution = response.getBody() .getTransactions() .getBooked() .get(0) .getAdditionalInformationStructured() .getStandingOrderDetails() .getMonthsOfExecution() .get(0); assertThat(monthsOfExecution).isEqualTo(StandingOrderDetails.MonthsOfExecution._1); } @Test void getTransactionDetailsUsesFiduciaMonthsOfExecution() { Mockito.doAnswer(invocationOnMock -> { HttpClient.ResponseHandler responseHandler = invocationOnMock.getArgument(1, HttpClient.ResponseHandler.class); //language=JSON String rawResponse = "{\n" + " \"transactionsDetails\": {\n" + " \"additionalInformationStructured\": {\n" + " \"standingOrderDetails\": {\n" + " \"monthsOfExecution\": [\"01\"]\n" + " }\n" + " }\n" + " }\n" + "}"; return new Response<>(200, responseHandler.apply(200, new ByteArrayInputStream(rawResponse.getBytes()), ResponseHeaders.fromMap(singletonMap("Content-Type", "application/json"))), null); }).when(httpClient).send(Mockito.any(), Mockito.any()); Response<OK200TransactionDetails> response = service.getTransactionDetails((String) null, (String) null, RequestHeaders.empty(), RequestParams.empty()); StandingOrderDetails.MonthsOfExecution monthsOfExecution = response.getBody() .getTransactionsDetails() .getAdditionalInformationStructured() .getStandingOrderDetails() .getMonthsOfExecution() .get(0); assertThat(monthsOfExecution).isEqualTo(StandingOrderDetails.MonthsOfExecution._1); } }
14,039
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaPaymentInitiationServiceWireMockTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/test/java/de/adorsys/xs2a/adapter/fiducia/FiduciaPaymentInitiationServiceWireMockTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia; import de.adorsys.xs2a.adapter.api.PaymentInitiationService; import de.adorsys.xs2a.adapter.api.RequestParams; import de.adorsys.xs2a.adapter.api.Response; import de.adorsys.xs2a.adapter.api.model.*; import de.adorsys.xs2a.adapter.test.ServiceWireMockTest; import de.adorsys.xs2a.adapter.test.TestRequestResponse; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import java.util.EnumMap; import java.util.Map; import java.util.NoSuchElementException; import java.util.Optional; import java.util.stream.Stream; import static de.adorsys.xs2a.adapter.api.model.PaymentProduct.PAIN_001_SEPA_CREDIT_TRANSFERS; import static de.adorsys.xs2a.adapter.api.model.PaymentService.PAYMENTS; import static de.adorsys.xs2a.adapter.api.model.PaymentService.PERIODIC_PAYMENTS; import static java.lang.String.format; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.params.provider.Arguments.arguments; @ServiceWireMockTest(FiduciaServiceProvider.class) class FiduciaPaymentInitiationServiceWireMockTest { protected static final String PAYMENTS_PAYMENT_ID = "9667011219090020282PSDDE-BAFIN-911360PA4960JJ"; protected static final String PAYMENTS_AUTHORISATION_ID = "9592111219090020283PSDDE-BAFIN-911360AU4960JJ"; protected static final String PERIODIC_PAYMENT_ID = "2750410619090020256PSDDE-BAFIN-911360PA4960JJ"; protected static final String PERIODIC_AUTHORISATION_ID = "0509410619090020257PSDDE-BAFIN-911360AU4960JJ"; private final PaymentInitiationService service; private static final Ids paymentIds = getPaymentIds(); private static final Ids authorisationIds = getAuthorisationIds(); FiduciaPaymentInitiationServiceWireMockTest(PaymentInitiationService service) { this.service = service; } @ParameterizedTest @MethodSource("paymentTypes") void initiatePayment(PaymentService paymentService, PaymentProduct paymentProduct) throws Exception { TestRequestResponse requestResponse = new TestRequestResponse(format("pis/%s/%s/initiate-payment.json", paymentService, paymentProduct)); Response<PaymentInitationRequestResponse201> response = service.initiatePayment(paymentService, paymentProduct, requestResponse.requestHeaders(), RequestParams.empty(), resolveRequestBody(requestResponse, paymentService)); assertThat(response.getBody()).isEqualTo(requestResponse.responseBody(PaymentInitationRequestResponse201.class)); } private Object resolveRequestBody(TestRequestResponse requestResponse, PaymentService paymentService) { if (paymentService == PERIODIC_PAYMENTS) { return requestResponse.requestBody(PeriodicPaymentInitiationMultipartBody.class); } return requestResponse.requestBody(); } @ParameterizedTest @MethodSource("paymentTypes") void authenticatePsu(PaymentService paymentService, PaymentProduct paymentProduct) throws Exception { TestRequestResponse requestResponse = new TestRequestResponse(format("pis/%s/%s/authenticate-psu.json", paymentService, paymentProduct)); Response<StartScaprocessResponse> response = service.startPaymentAuthorisation(paymentService, paymentProduct, paymentIds.get(paymentService, paymentProduct), requestResponse.requestHeaders(), RequestParams.empty(), requestResponse.requestBody(UpdatePsuAuthentication.class)); assertThat(response.getBody()).isEqualTo(requestResponse.responseBody(StartScaprocessResponse.class)); } @ParameterizedTest @MethodSource("paymentTypes") void selectScaMethod(PaymentService paymentService, PaymentProduct paymentProduct) throws Exception { TestRequestResponse requestResponse = new TestRequestResponse(format("pis/%s/%s/select-sca-method.json", paymentService, paymentProduct)); Response<SelectPsuAuthenticationMethodResponse> response = service.updatePaymentPsuData(paymentService, paymentProduct, paymentIds.get(paymentService, paymentProduct), authorisationIds.get(paymentService, paymentProduct), requestResponse.requestHeaders(), RequestParams.empty(), requestResponse.requestBody(SelectPsuAuthenticationMethod.class)); assertThat(response.getBody()).isEqualTo(requestResponse.responseBody(SelectPsuAuthenticationMethodResponse.class)); } @ParameterizedTest @MethodSource("paymentTypes") void authoriseTransaction(PaymentService paymentService, PaymentProduct paymentProduct) throws Exception { TestRequestResponse requestResponse = new TestRequestResponse(format("pis/%s/%s/authorise-transaction.json", paymentService, paymentProduct)); Response<ScaStatusResponse> response = service.updatePaymentPsuData(paymentService, paymentProduct, paymentIds.get(paymentService, paymentProduct), authorisationIds.get(paymentService, paymentProduct), requestResponse.requestHeaders(), RequestParams.empty(), requestResponse.requestBody(TransactionAuthorisation.class)); assertThat(response.getBody()).isEqualTo(requestResponse.responseBody(ScaStatusResponse.class)); } @ParameterizedTest @MethodSource("paymentTypes") void getPaymentStatus(PaymentService paymentService, PaymentProduct paymentProduct) throws Exception { TestRequestResponse requestResponse = new TestRequestResponse(format("pis/%s/%s/get-payment-status.json", paymentService, paymentProduct)); Response<String> response = service.getPaymentInitiationStatusAsString(paymentService, paymentProduct, paymentIds.get(paymentService, paymentProduct), requestResponse.requestHeaders(), RequestParams.empty()); assertThat(response.getBody()).isEqualTo(requestResponse.responseBody()); } @ParameterizedTest @MethodSource("paymentTypes") void getScaStatus(PaymentService paymentService, PaymentProduct paymentProduct) throws Exception { TestRequestResponse requestResponse = new TestRequestResponse(format("pis/%s/%s/get-sca-status.json", paymentService, paymentProduct)); Response<ScaStatusResponse> response = service.getPaymentInitiationScaStatus(paymentService, paymentProduct, paymentIds.get(paymentService, paymentProduct), authorisationIds.get(paymentService, paymentProduct), requestResponse.requestHeaders(), RequestParams.empty()); assertThat(response.getBody()).isEqualTo(requestResponse.responseBody(ScaStatusResponse.class)); } private static Stream<Arguments> paymentTypes() { return Stream.of(arguments(PAYMENTS, PAIN_001_SEPA_CREDIT_TRANSFERS), arguments(PERIODIC_PAYMENTS, PAIN_001_SEPA_CREDIT_TRANSFERS)); } private static Ids getPaymentIds() { return new Ids() .add(PAYMENTS, PAIN_001_SEPA_CREDIT_TRANSFERS, PAYMENTS_PAYMENT_ID) .add(PERIODIC_PAYMENTS, PAIN_001_SEPA_CREDIT_TRANSFERS, PERIODIC_PAYMENT_ID); } private static Ids getAuthorisationIds() { return new Ids() .add(PAYMENTS, PAIN_001_SEPA_CREDIT_TRANSFERS, PAYMENTS_AUTHORISATION_ID) .add(PERIODIC_PAYMENTS, PAIN_001_SEPA_CREDIT_TRANSFERS, PERIODIC_AUTHORISATION_ID); } private static class Ids { private final Map<PaymentService, Map<PaymentProduct, String>> map = new EnumMap<>(PaymentService.class); Ids add(PaymentService paymentService, PaymentProduct paymentProduct, String id) { map.computeIfAbsent(paymentService, k -> new EnumMap<>(PaymentProduct.class)) .put(paymentProduct, id); return this; } String get(PaymentService paymentService, PaymentProduct paymentProduct) { return Optional.ofNullable(map.get(paymentService)) .map(m -> m.get(paymentProduct)) .orElseThrow(NoSuchElementException::new); } } }
9,159
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaMapperTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/test/java/de/adorsys/xs2a/adapter/fiducia/mapper/FiduciaMapperTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.mapper; import org.junit.jupiter.api.Test; import org.mapstruct.factory.Mappers; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertNull; class FiduciaMapperTest { private final FiduciaMapper mapper = Mappers.getMapper(FiduciaMapper.class); @Test void toListOfStringsReturnsNullForNullInput() { assertNull(mapper.toListOfStrings(null)); } @Test void toListOfStringsCreatesListWithOneItem() { assertThat(mapper.toListOfStrings("asdf")).containsExactly("asdf"); } }
1,444
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaAccountInformationService.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/FiduciaAccountInformationService.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.RequestParams; import de.adorsys.xs2a.adapter.api.Response; import de.adorsys.xs2a.adapter.api.http.HttpClientFactory; import de.adorsys.xs2a.adapter.api.http.Interceptor; import de.adorsys.xs2a.adapter.api.link.LinksRewriter; import de.adorsys.xs2a.adapter.api.model.*; import de.adorsys.xs2a.adapter.api.validation.ValidationError; import de.adorsys.xs2a.adapter.fiducia.mapper.FiduciaMapper; import de.adorsys.xs2a.adapter.fiducia.model.FiduciaOK200TransactionDetails; import de.adorsys.xs2a.adapter.fiducia.model.FiduciaSelectPsuAuthenticationMethodResponse; import de.adorsys.xs2a.adapter.fiducia.model.FiduciaStartScaProcessResponse; import de.adorsys.xs2a.adapter.fiducia.model.FiduciaTransactionsResponse200Json; import de.adorsys.xs2a.adapter.impl.BaseAccountInformationService; import org.mapstruct.factory.Mappers; import java.util.Collections; import java.util.List; import java.util.Set; public class FiduciaAccountInformationService extends BaseAccountInformationService { private static final Set<String> SUPPORTED_BOOKING_STATUSES = Set.of("booked", "information"); private static final String BOOKING_STATUS_ERROR_MESSAGE = String.format( "ASPSP supports only the following booking statuses: %s. " + "The booking status from the request has to be changed to the supported ones.", SUPPORTED_BOOKING_STATUSES ); private static final FiduciaMapper mapper = Mappers.getMapper(FiduciaMapper.class); public FiduciaAccountInformationService(Aspsp aspsp, HttpClientFactory httpClientFactory, List<Interceptor> interceptors, LinksRewriter linksRewriter) { super(aspsp, httpClientFactory.getHttpClient(aspsp.getAdapterId()), interceptors, linksRewriter, httpClientFactory.getHttpClientConfig().getLogSanitizer()); } @Override public Response<ConsentsResponse201> createConsent(RequestHeaders requestHeaders, RequestParams requestParams, Consents body) { modifyRecurringIndicator(body); return super.createConsent(requestHeaders, requestParams, body); } // Needed to fix the issue on Fiducia side: ASPSP doesn't accept recurring indicator being equal to false. private void modifyRecurringIndicator(Consents body) { body.setRecurringIndicator(true); } @Override public Response<TransactionsResponse200Json> getTransactionList(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return getTransactionList(accountId, requestHeaders, requestParams, FiduciaTransactionsResponse200Json.class, mapper::toTransactionsResponse200Json); } @Override public List<ValidationError> validateGetTransactionList(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return validateBookingStatus(requestParams); } private List<ValidationError> validateBookingStatus(RequestParams requestParams) { if (notSupportedBookingStatus(requestParams)) { return Collections.singletonList(new ValidationError(ValidationError.Code.NOT_SUPPORTED, RequestParams.BOOKING_STATUS, BOOKING_STATUS_ERROR_MESSAGE)); } return Collections.emptyList(); } private boolean notSupportedBookingStatus(RequestParams requestParams) { String bookingStatus = requestParams.toMap().get(RequestParams.BOOKING_STATUS); return bookingStatus != null && !SUPPORTED_BOOKING_STATUSES.contains(bookingStatus); } @Override public List<ValidationError> validateGetTransactionListAsString(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return validateBookingStatus(requestParams); } @Override public Response<OK200TransactionDetails> getTransactionDetails(String accountId, String transactionId, RequestHeaders requestHeaders, RequestParams requestParams) { return getTransactionDetails(accountId, transactionId, requestHeaders, requestParams, FiduciaOK200TransactionDetails.class, mapper::toOK200TransactionDetails); } @Override public Response<SelectPsuAuthenticationMethodResponse> updateConsentsPsuData( String consentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams, SelectPsuAuthenticationMethod selectPsuAuthenticationMethod ) { return super.updateConsentsPsuData(consentId, authorisationId, requestHeaders, requestParams, selectPsuAuthenticationMethod, FiduciaSelectPsuAuthenticationMethodResponse.class, mapper::toSelectPsuAuthenticationMethodResponse); } @Override public Response<StartScaprocessResponse> startConsentAuthorisation( String consentId, RequestHeaders requestHeaders, RequestParams requestParams, UpdatePsuAuthentication updatePsuAuthentication ) { return super.startConsentAuthorisation(consentId, requestHeaders, requestParams, updatePsuAuthentication, FiduciaStartScaProcessResponse.class, mapper::toStartScaProcessResponse); } }
7,802
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaPaymentInitiationService.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/FiduciaPaymentInitiationService.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.RequestParams; import de.adorsys.xs2a.adapter.api.Response; import de.adorsys.xs2a.adapter.api.http.HttpClientFactory; import de.adorsys.xs2a.adapter.api.http.Interceptor; import de.adorsys.xs2a.adapter.api.link.LinksRewriter; import de.adorsys.xs2a.adapter.api.model.*; import de.adorsys.xs2a.adapter.fiducia.mapper.FiduciaMapper; import de.adorsys.xs2a.adapter.fiducia.model.*; import de.adorsys.xs2a.adapter.impl.BasePaymentInitiationService; import org.mapstruct.factory.Mappers; import java.util.List; public class FiduciaPaymentInitiationService extends BasePaymentInitiationService { private final FiduciaMapper mapper = Mappers.getMapper(FiduciaMapper.class); public FiduciaPaymentInitiationService(Aspsp aspsp, HttpClientFactory httpClientFactory, List<Interceptor> interceptors, LinksRewriter linksRewriter) { super(aspsp, httpClientFactory.getHttpClient(aspsp.getAdapterId()), interceptors, linksRewriter, httpClientFactory.getHttpClientConfig().getLogSanitizer()); } @Override public Response<PaymentInitationRequestResponse201> initiatePayment(PaymentService paymentService, PaymentProduct paymentProduct, RequestHeaders requestHeaders, RequestParams requestParams, Object body) { if (body instanceof PeriodicPaymentInitiationJson) { body = mapper.toFiduciaPeriodicPaymentInitiationJson((PeriodicPaymentInitiationJson) body); } return initiatePayment(paymentService, paymentProduct, requestHeaders, requestParams, body, FiduciaPaymentInitationRequestResponse201.class, mapper::toPaymentInitationRequestResponse201); } @Override protected Class<?> getPaymentInitiationBodyClass(PaymentService paymentService) { if (paymentService == PaymentService.PERIODIC_PAYMENTS) { return FiduciaPeriodicPaymentInitiationJson.class; } return super.getPaymentInitiationBodyClass(paymentService); } @Override public Response<SelectPsuAuthenticationMethodResponse> updatePaymentPsuData(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams, SelectPsuAuthenticationMethod selectPsuAuthenticationMethod) { return updatePaymentPsuData(paymentService, paymentProduct, paymentId, authorisationId, requestHeaders, requestParams, selectPsuAuthenticationMethod, FiduciaSelectPsuAuthenticationMethodResponse.class, mapper::toSelectPsuAuthenticationMethodResponse); } @Override public Response<StartScaprocessResponse> startPaymentAuthorisation(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams, UpdatePsuAuthentication updatePsuAuthentication) { return super.startPaymentAuthorisation(paymentService, paymentProduct, paymentId, requestHeaders, requestParams, updatePsuAuthentication, FiduciaStartScaProcessResponse.class, mapper::toStartScaProcessResponse); } @Override public Response<StartScaprocessResponse> startPaymentAuthorisation(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return startPaymentAuthorisation(paymentService, paymentProduct, paymentId, requestHeaders, requestParams, FiduciaStartScaProcessResponse.class, mapper::toStartScaProcessResponse); } @Override public Response<UpdatePsuAuthenticationResponse> updatePaymentPsuData(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams, UpdatePsuAuthentication updatePsuAuthentication) { return updatePaymentPsuData(paymentService, paymentProduct, paymentId, authorisationId, requestHeaders, requestParams, updatePsuAuthentication, FiduciaUpdatePsuAuthenticationResponse.class, mapper::toUpdatePsuAuthenticationResponse); } @Override public Response<PeriodicPaymentInitiationWithStatusResponse> getPeriodicPaymentInformation(PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return getPeriodicPaymentInformation(paymentProduct, paymentId, requestHeaders, requestParams, FiduciaPeriodicPaymentInitiationWithStatusResponse.class, mapper::toPeriodicPaymentInitiationWithStatusResponse); } @Override public Response<PeriodicPaymentInitiationMultipartBody> getPeriodicPain001PaymentInformation(PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return getPeriodicPain001PaymentInformation(paymentProduct, paymentId, requestHeaders, requestParams, FiduciaPeriodicPaymentInitiationMultipartBody.class, mapper::toPeriodicPaymentInitiationMultipartBody); } }
10,257
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaServiceProvider.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/FiduciaServiceProvider.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia; import de.adorsys.xs2a.adapter.api.*; import de.adorsys.xs2a.adapter.api.http.HttpClientConfig; import de.adorsys.xs2a.adapter.api.http.HttpClientFactory; import de.adorsys.xs2a.adapter.api.link.LinksRewriter; import de.adorsys.xs2a.adapter.api.model.Aspsp; import de.adorsys.xs2a.adapter.impl.AbstractAdapterServiceProvider; import de.adorsys.xs2a.adapter.impl.http.RequestSigningInterceptor; public class FiduciaServiceProvider extends AbstractAdapterServiceProvider { @Override public AccountInformationService getAccountInformationService(Aspsp aspsp, HttpClientFactory httpClientFactory, LinksRewriter linksRewriter) { HttpClientConfig config = httpClientFactory.getHttpClientConfig(); return new FiduciaAccountInformationService(aspsp, httpClientFactory, getInterceptors(aspsp, new RequestSigningInterceptor(config.getKeyStore())), linksRewriter); } @Override public PaymentInitiationService getPaymentInitiationService(Aspsp aspsp, HttpClientFactory httpClientFactory, LinksRewriter linksRewriter) { HttpClientConfig config = httpClientFactory.getHttpClientConfig(); return new FiduciaPaymentInitiationService(aspsp, httpClientFactory, getInterceptors(aspsp, new RequestSigningInterceptor(config.getKeyStore())), linksRewriter); } @Override public String getAdapterId() { return "fiducia-adapter"; } }
2,593
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaMapper.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/mapper/FiduciaMapper.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.mapper; import de.adorsys.xs2a.adapter.api.model.*; import de.adorsys.xs2a.adapter.fiducia.model.*; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import java.util.Collections; import java.util.List; @Mapper public interface FiduciaMapper { SelectPsuAuthenticationMethodResponse toSelectPsuAuthenticationMethodResponse( FiduciaSelectPsuAuthenticationMethodResponse value); default List<String> toListOfStrings(String challengeData) { if (challengeData == null) { return null; } return Collections.singletonList(challengeData); } StartScaprocessResponse toStartScaProcessResponse(FiduciaStartScaProcessResponse value); UpdatePsuAuthenticationResponse toUpdatePsuAuthenticationResponse(FiduciaUpdatePsuAuthenticationResponse value); FiduciaPeriodicPaymentInitiationJson toFiduciaPeriodicPaymentInitiationJson(PeriodicPaymentInitiationJson value); PeriodicPaymentInitiationWithStatusResponse toPeriodicPaymentInitiationWithStatusResponse( FiduciaPeriodicPaymentInitiationWithStatusResponse value); PeriodicPaymentInitiationMultipartBody toPeriodicPaymentInitiationMultipartBody( FiduciaPeriodicPaymentInitiationMultipartBody value); TransactionsResponse200Json toTransactionsResponse200Json(FiduciaTransactionsResponse200Json value); OK200TransactionDetails toOK200TransactionDetails(FiduciaOK200TransactionDetails value); @Mapping(target = "currencyExchange", ignore = true) Transactions toTransactionDetails(FiduciaTransactionDetails value); default String map(RemittanceInformationStructured value) { return value == null ? null : value.getReference(); } PaymentInitationRequestResponse201 toPaymentInitationRequestResponse201(FiduciaPaymentInitationRequestResponse201 value); }
2,703
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaPeriodicPaymentInitiationWithStatusResponse.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/model/FiduciaPeriodicPaymentInitiationWithStatusResponse.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.model; import de.adorsys.xs2a.adapter.api.model.*; import java.time.LocalDate; import java.util.Objects; public class FiduciaPeriodicPaymentInitiationWithStatusResponse { private String endToEndIdentification; private AccountReference debtorAccount; private Amount instructedAmount; private AccountReference creditorAccount; private String creditorAgent; private String creditorName; private Address creditorAddress; private String remittanceInformationUnstructured; private LocalDate startDate; private LocalDate endDate; private FiduciaExecutionRule executionRule; private FrequencyCode frequency; private FiduciaDayOfExecution dayOfExecution; private TransactionStatus transactionStatus; public String getEndToEndIdentification() { return endToEndIdentification; } public void setEndToEndIdentification(String endToEndIdentification) { this.endToEndIdentification = endToEndIdentification; } public AccountReference getDebtorAccount() { return debtorAccount; } public void setDebtorAccount(AccountReference debtorAccount) { this.debtorAccount = debtorAccount; } public Amount getInstructedAmount() { return instructedAmount; } public void setInstructedAmount(Amount instructedAmount) { this.instructedAmount = instructedAmount; } public AccountReference getCreditorAccount() { return creditorAccount; } public void setCreditorAccount(AccountReference creditorAccount) { this.creditorAccount = creditorAccount; } public String getCreditorAgent() { return creditorAgent; } public void setCreditorAgent(String creditorAgent) { this.creditorAgent = creditorAgent; } public String getCreditorName() { return creditorName; } public void setCreditorName(String creditorName) { this.creditorName = creditorName; } public Address getCreditorAddress() { return creditorAddress; } public void setCreditorAddress(Address creditorAddress) { this.creditorAddress = creditorAddress; } public String getRemittanceInformationUnstructured() { return remittanceInformationUnstructured; } public void setRemittanceInformationUnstructured(String remittanceInformationUnstructured) { this.remittanceInformationUnstructured = remittanceInformationUnstructured; } public LocalDate getStartDate() { return startDate; } public void setStartDate(LocalDate startDate) { this.startDate = startDate; } public LocalDate getEndDate() { return endDate; } public void setEndDate(LocalDate endDate) { this.endDate = endDate; } public FiduciaExecutionRule getExecutionRule() { return executionRule; } public void setExecutionRule(FiduciaExecutionRule executionRule) { this.executionRule = executionRule; } public FrequencyCode getFrequency() { return frequency; } public void setFrequency(FrequencyCode frequency) { this.frequency = frequency; } public FiduciaDayOfExecution getDayOfExecution() { return dayOfExecution; } public void setDayOfExecution(FiduciaDayOfExecution dayOfExecution) { this.dayOfExecution = dayOfExecution; } public TransactionStatus getTransactionStatus() { return transactionStatus; } public void setTransactionStatus(TransactionStatus transactionStatus) { this.transactionStatus = transactionStatus; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FiduciaPeriodicPaymentInitiationWithStatusResponse that = (FiduciaPeriodicPaymentInitiationWithStatusResponse) o; return Objects.equals(endToEndIdentification, that.endToEndIdentification) && Objects.equals(debtorAccount, that.debtorAccount) && Objects.equals(instructedAmount, that.instructedAmount) && Objects.equals(creditorAccount, that.creditorAccount) && Objects.equals(creditorAgent, that.creditorAgent) && Objects.equals(creditorName, that.creditorName) && Objects.equals(creditorAddress, that.creditorAddress) && Objects.equals(remittanceInformationUnstructured, that.remittanceInformationUnstructured) && Objects.equals(startDate, that.startDate) && Objects.equals(endDate, that.endDate) && Objects.equals(executionRule, that.executionRule) && Objects.equals(frequency, that.frequency) && Objects.equals(dayOfExecution, that.dayOfExecution) && Objects.equals(transactionStatus, that.transactionStatus); } @Override public int hashCode() { return Objects.hash(endToEndIdentification, debtorAccount, instructedAmount, creditorAccount, creditorAgent, creditorName, creditorAddress, remittanceInformationUnstructured, startDate, endDate, executionRule, frequency, dayOfExecution, transactionStatus); } }
6,232
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaAccountReport.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/model/FiduciaAccountReport.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.model; import com.fasterxml.jackson.annotation.JsonProperty; import de.adorsys.xs2a.adapter.api.model.HrefType; import java.util.List; import java.util.Map; import java.util.Objects; public class FiduciaAccountReport { private List<FiduciaTransactionDetails> booked; private List<FiduciaTransactionDetails> pending; @JsonProperty("_links") private Map<String, HrefType> links; public List<FiduciaTransactionDetails> getBooked() { return booked; } public void setBooked(List<FiduciaTransactionDetails> booked) { this.booked = booked; } public List<FiduciaTransactionDetails> getPending() { return pending; } public void setPending(List<FiduciaTransactionDetails> pending) { this.pending = pending; } public Map<String, HrefType> getLinks() { return links; } public void setLinks(Map<String, HrefType> links) { this.links = links; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FiduciaAccountReport that = (FiduciaAccountReport) o; return Objects.equals(booked, that.booked) && Objects.equals(pending, that.pending) && Objects.equals(links, that.links); } @Override public int hashCode() { return Objects.hash(booked, pending, links); } }
2,330
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaPaymentInitationRequestResponse201.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/model/FiduciaPaymentInitationRequestResponse201.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.model; import com.fasterxml.jackson.annotation.JsonProperty; import de.adorsys.xs2a.adapter.api.model.*; import java.util.List; import java.util.Map; import java.util.Objects; public class FiduciaPaymentInitationRequestResponse201 { private TransactionStatus transactionStatus; private String paymentId; private Amount transactionFees; private Boolean transactionFeeIndicator; private List<AuthenticationObject> scaMethods; private AuthenticationObject chosenScaMethod; private FiduciaChallengeData challengeData; @JsonProperty("_links") private Map<String, HrefType> links; private String psuMessage; private List<TppMessage2XX> tppMessages; public TransactionStatus getTransactionStatus() { return transactionStatus; } public void setTransactionStatus(TransactionStatus transactionStatus) { this.transactionStatus = transactionStatus; } public String getPaymentId() { return paymentId; } public void setPaymentId(String paymentId) { this.paymentId = paymentId; } public Amount getTransactionFees() { return transactionFees; } public void setTransactionFees(Amount transactionFees) { this.transactionFees = transactionFees; } public Boolean getTransactionFeeIndicator() { return transactionFeeIndicator; } public void setTransactionFeeIndicator(Boolean transactionFeeIndicator) { this.transactionFeeIndicator = transactionFeeIndicator; } public List<AuthenticationObject> getScaMethods() { return scaMethods; } public void setScaMethods(List<AuthenticationObject> scaMethods) { this.scaMethods = scaMethods; } public AuthenticationObject getChosenScaMethod() { return chosenScaMethod; } public void setChosenScaMethod(AuthenticationObject chosenScaMethod) { this.chosenScaMethod = chosenScaMethod; } public FiduciaChallengeData getChallengeData() { return challengeData; } public void setChallengeData(FiduciaChallengeData challengeData) { this.challengeData = challengeData; } public Map<String, HrefType> getLinks() { return links; } public void setLinks(Map<String, HrefType> links) { this.links = links; } public String getPsuMessage() { return psuMessage; } public void setPsuMessage(String psuMessage) { this.psuMessage = psuMessage; } public List<TppMessage2XX> getTppMessages() { return tppMessages; } public void setTppMessages(List<TppMessage2XX> tppMessages) { this.tppMessages = tppMessages; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FiduciaPaymentInitationRequestResponse201 that = (FiduciaPaymentInitationRequestResponse201) o; return Objects.equals(transactionStatus, that.transactionStatus) && Objects.equals(paymentId, that.paymentId) && Objects.equals(transactionFees, that.transactionFees) && Objects.equals(transactionFeeIndicator, that.transactionFeeIndicator) && Objects.equals(scaMethods, that.scaMethods) && Objects.equals(chosenScaMethod, that.chosenScaMethod) && Objects.equals(challengeData, that.challengeData) && Objects.equals(links, that.links) && Objects.equals(psuMessage, that.psuMessage) && Objects.equals(tppMessages, that.tppMessages); } @Override public int hashCode() { return Objects.hash(transactionStatus, paymentId, transactionFees, transactionFeeIndicator, scaMethods, chosenScaMethod, challengeData, links, psuMessage, tppMessages); } }
4,822
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaExecutionRule.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/model/FiduciaExecutionRule.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.model; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; public enum FiduciaExecutionRule { FOLLOWING("following"), // incorrect spelling PRECEDING("preceeding"); private String value; FiduciaExecutionRule(String value) { this.value = value; } @JsonCreator public static FiduciaExecutionRule fromValue(String value) { for (FiduciaExecutionRule e : FiduciaExecutionRule.values()) { if (e.value.equals(value)) { return e; } } return null; } @Override @JsonValue public String toString() { return value; } }
1,568
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaOK200TransactionDetails.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/model/FiduciaOK200TransactionDetails.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.model; import java.util.Objects; public class FiduciaOK200TransactionDetails { private FiduciaTransactionDetails transactionsDetails; public FiduciaTransactionDetails getTransactionsDetails() { return transactionsDetails; } public void setTransactionsDetails(FiduciaTransactionDetails transactionsDetails) { this.transactionsDetails = transactionsDetails; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FiduciaOK200TransactionDetails that = (FiduciaOK200TransactionDetails) o; return Objects.equals(transactionsDetails, that.transactionsDetails); } @Override public int hashCode() { return Objects.hash(transactionsDetails); } }
1,691
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaStartScaProcessResponse.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/model/FiduciaStartScaProcessResponse.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.model; import com.fasterxml.jackson.annotation.JsonProperty; import de.adorsys.xs2a.adapter.api.model.AuthenticationObject; import de.adorsys.xs2a.adapter.api.model.HrefType; import de.adorsys.xs2a.adapter.api.model.ScaStatus; import java.util.List; import java.util.Map; public class FiduciaStartScaProcessResponse { private ScaStatus scaStatus; private String authorisationId; private List<AuthenticationObject> scaMethods; private AuthenticationObject chosenScaMethod; private FiduciaChallengeData challengeData; @JsonProperty("_links") private Map<String, HrefType> links; private String psuMessage; public ScaStatus getScaStatus() { return scaStatus; } public void setScaStatus(ScaStatus scaStatus) { this.scaStatus = scaStatus; } public String getAuthorisationId() { return authorisationId; } public void setAuthorisationId(String authorisationId) { this.authorisationId = authorisationId; } public List<AuthenticationObject> getScaMethods() { return scaMethods; } public void setScaMethods(List<AuthenticationObject> scaMethods) { this.scaMethods = scaMethods; } public AuthenticationObject getChosenScaMethod() { return chosenScaMethod; } public void setChosenScaMethod(AuthenticationObject chosenScaMethod) { this.chosenScaMethod = chosenScaMethod; } public FiduciaChallengeData getChallengeData() { return challengeData; } public void setChallengeData(FiduciaChallengeData challengeData) { this.challengeData = challengeData; } public Map<String, HrefType> getLinks() { return links; } public void setLinks(Map<String, HrefType> links) { this.links = links; } public String getPsuMessage() { return psuMessage; } public void setPsuMessage(String psuMessage) { this.psuMessage = psuMessage; } public boolean isChosenScaMethodStage() { return chosenScaMethod != null; } public boolean isSelectScaMethodStage() { return scaMethods != null; } }
3,028
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaPeriodicPaymentInitiationJson.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/model/FiduciaPeriodicPaymentInitiationJson.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.model; import de.adorsys.xs2a.adapter.api.model.AccountReference; import de.adorsys.xs2a.adapter.api.model.Address; import de.adorsys.xs2a.adapter.api.model.Amount; import de.adorsys.xs2a.adapter.api.model.FrequencyCode; import java.time.LocalDate; import java.util.Objects; public class FiduciaPeriodicPaymentInitiationJson { private String endToEndIdentification; private AccountReference debtorAccount; private Amount instructedAmount; private AccountReference creditorAccount; private String creditorAgent; private String creditorName; private Address creditorAddress; private String remittanceInformationUnstructured; private LocalDate startDate; private LocalDate endDate; private FiduciaExecutionRule executionRule; private FrequencyCode frequency; private FiduciaDayOfExecution dayOfExecution; public String getEndToEndIdentification() { return endToEndIdentification; } public void setEndToEndIdentification(String endToEndIdentification) { this.endToEndIdentification = endToEndIdentification; } public AccountReference getDebtorAccount() { return debtorAccount; } public void setDebtorAccount(AccountReference debtorAccount) { this.debtorAccount = debtorAccount; } public Amount getInstructedAmount() { return instructedAmount; } public void setInstructedAmount(Amount instructedAmount) { this.instructedAmount = instructedAmount; } public AccountReference getCreditorAccount() { return creditorAccount; } public void setCreditorAccount(AccountReference creditorAccount) { this.creditorAccount = creditorAccount; } public String getCreditorAgent() { return creditorAgent; } public void setCreditorAgent(String creditorAgent) { this.creditorAgent = creditorAgent; } public String getCreditorName() { return creditorName; } public void setCreditorName(String creditorName) { this.creditorName = creditorName; } public Address getCreditorAddress() { return creditorAddress; } public void setCreditorAddress(Address creditorAddress) { this.creditorAddress = creditorAddress; } public String getRemittanceInformationUnstructured() { return remittanceInformationUnstructured; } public void setRemittanceInformationUnstructured(String remittanceInformationUnstructured) { this.remittanceInformationUnstructured = remittanceInformationUnstructured; } public LocalDate getStartDate() { return startDate; } public void setStartDate(LocalDate startDate) { this.startDate = startDate; } public LocalDate getEndDate() { return endDate; } public void setEndDate(LocalDate endDate) { this.endDate = endDate; } public FiduciaExecutionRule getExecutionRule() { return executionRule; } public void setExecutionRule(FiduciaExecutionRule executionRule) { this.executionRule = executionRule; } public FrequencyCode getFrequency() { return frequency; } public void setFrequency(FrequencyCode frequency) { this.frequency = frequency; } public FiduciaDayOfExecution getDayOfExecution() { return dayOfExecution; } public void setDayOfExecution(FiduciaDayOfExecution dayOfExecution) { this.dayOfExecution = dayOfExecution; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FiduciaPeriodicPaymentInitiationJson that = (FiduciaPeriodicPaymentInitiationJson) o; return Objects.equals(endToEndIdentification, that.endToEndIdentification) && Objects.equals(debtorAccount, that.debtorAccount) && Objects.equals(instructedAmount, that.instructedAmount) && Objects.equals(creditorAccount, that.creditorAccount) && Objects.equals(creditorAgent, that.creditorAgent) && Objects.equals(creditorName, that.creditorName) && Objects.equals(creditorAddress, that.creditorAddress) && Objects.equals(remittanceInformationUnstructured, that.remittanceInformationUnstructured) && Objects.equals(startDate, that.startDate) && Objects.equals(endDate, that.endDate) && Objects.equals(executionRule, that.executionRule) && Objects.equals(frequency, that.frequency) && Objects.equals(dayOfExecution, that.dayOfExecution); } @Override public int hashCode() { return Objects.hash(endToEndIdentification, debtorAccount, instructedAmount, creditorAccount, creditorAgent, creditorName, creditorAddress, remittanceInformationUnstructured, startDate, endDate, executionRule, frequency, dayOfExecution); } }
5,976
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaSelectPsuAuthenticationMethodResponse.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/model/FiduciaSelectPsuAuthenticationMethodResponse.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.model; import com.fasterxml.jackson.annotation.JsonProperty; import de.adorsys.xs2a.adapter.api.model.AuthenticationObject; import de.adorsys.xs2a.adapter.api.model.HrefType; import de.adorsys.xs2a.adapter.api.model.ScaStatus; import java.util.Map; public class FiduciaSelectPsuAuthenticationMethodResponse { private AuthenticationObject chosenScaMethod; private FiduciaChallengeData challengeData; @JsonProperty("_links") private Map<String, HrefType> links; private ScaStatus scaStatus; private String psuMessage; public AuthenticationObject getChosenScaMethod() { return chosenScaMethod; } public void setChosenScaMethod(AuthenticationObject chosenScaMethod) { this.chosenScaMethod = chosenScaMethod; } public FiduciaChallengeData getChallengeData() { return challengeData; } public void setChallengeData(FiduciaChallengeData challengeData) { this.challengeData = challengeData; } public Map<String, HrefType> getLinks() { return links; } public void setLinks(Map<String, HrefType> links) { this.links = links; } public ScaStatus getScaStatus() { return scaStatus; } public void setScaStatus(ScaStatus scaStatus) { this.scaStatus = scaStatus; } public String getPsuMessage() { return psuMessage; } public void setPsuMessage(String psuMessage) { this.psuMessage = psuMessage; } }
2,349
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaPeriodicPaymentInitiationMultipartBody.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/model/FiduciaPeriodicPaymentInitiationMultipartBody.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.model; import java.util.Objects; public class FiduciaPeriodicPaymentInitiationMultipartBody { private Object xml_sct; private FiduciaPeriodicPaymentInitiationXmlPart2StandingorderTypeJson json_standingorderType; public Object getXml_sct() { return xml_sct; } public void setXml_sct(Object xml_sct) { this.xml_sct = xml_sct; } public FiduciaPeriodicPaymentInitiationXmlPart2StandingorderTypeJson getJson_standingorderType() { return json_standingorderType; } public void setJson_standingorderType( FiduciaPeriodicPaymentInitiationXmlPart2StandingorderTypeJson json_standingorderType) { this.json_standingorderType = json_standingorderType; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FiduciaPeriodicPaymentInitiationMultipartBody that = (FiduciaPeriodicPaymentInitiationMultipartBody) o; return Objects.equals(xml_sct, that.xml_sct) && Objects.equals(json_standingorderType, that.json_standingorderType); } @Override public int hashCode() { return Objects.hash(xml_sct, json_standingorderType); } }
2,134
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaTransactionsResponse200Json.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/model/FiduciaTransactionsResponse200Json.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.model; import com.fasterxml.jackson.annotation.JsonProperty; import de.adorsys.xs2a.adapter.api.model.AccountReference; import de.adorsys.xs2a.adapter.api.model.Balance; import de.adorsys.xs2a.adapter.api.model.HrefType; import java.util.List; import java.util.Map; import java.util.Objects; public class FiduciaTransactionsResponse200Json { private AccountReference account; private FiduciaAccountReport transactions; private List<Balance> balances; @JsonProperty("_links") private Map<String, HrefType> links; public AccountReference getAccount() { return account; } public void setAccount(AccountReference account) { this.account = account; } public FiduciaAccountReport getTransactions() { return transactions; } public void setTransactions(FiduciaAccountReport transactions) { this.transactions = transactions; } public List<Balance> getBalances() { return balances; } public void setBalances(List<Balance> balances) { this.balances = balances; } public Map<String, HrefType> getLinks() { return links; } public void setLinks(Map<String, HrefType> links) { this.links = links; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FiduciaTransactionsResponse200Json that = (FiduciaTransactionsResponse200Json) o; return Objects.equals(account, that.account) && Objects.equals(transactions, that.transactions) && Objects.equals(balances, that.balances) && Objects.equals(links, that.links); } @Override public int hashCode() { return Objects.hash(account, transactions, balances, links); } }
2,745
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaDayOfExecution.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/model/FiduciaDayOfExecution.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.model; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; public enum FiduciaDayOfExecution { _1("01"), _2("02"), _3("03"), _4("04"), _5("05"), _6("06"), _7("07"), _8("08"), _9("09"), _10("10"), _11("11"), _12("12"), _13("13"), _14("14"), _15("15"), _16("16"), _17("17"), _18("18"), _19("19"), _20("20"), _21("21"), _22("22"), _23("23"), _24("24"), _25("25"), _26("26"), _27("27"), _28("28"), _29("29"), _30("30"), _31("31"); private String value; FiduciaDayOfExecution(String value) { this.value = value; } @JsonCreator public static FiduciaDayOfExecution fromValue(String value) { for (FiduciaDayOfExecution e : FiduciaDayOfExecution.values()) { if (e.value.equals(value)) { return e; } } return null; } @Override @JsonValue public String toString() { return value; } }
1,975
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaTransactionDetails.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/model/FiduciaTransactionDetails.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.model; import com.fasterxml.jackson.annotation.JsonProperty; import de.adorsys.xs2a.adapter.api.model.*; import java.time.LocalDate; import java.util.List; import java.util.Map; import java.util.Objects; public class FiduciaTransactionDetails { private String transactionId; private String entryReference; private String endToEndId; private String mandateId; private String checkId; private String creditorId; private LocalDate bookingDate; private LocalDate valueDate; private Amount transactionAmount; private String creditorName; private AccountReference creditorAccount; private String creditorAgent; private String ultimateCreditor; private String debtorName; private AccountReference debtorAccount; private String debtorAgent; private String ultimateDebtor; private String remittanceInformationUnstructured; private List<String> remittanceInformationUnstructuredArray; private String remittanceInformationStructured; private List<RemittanceInformationStructured> remittanceInformationStructuredArray; private String additionalInformation; private FiduciaAdditionalInformationStructured additionalInformationStructured; private PurposeCode purposeCode; private String bankTransactionCode; private String proprietaryBankTransactionCode; private Balance balanceAfterTransaction; @JsonProperty("_links") private Map<String, HrefType> links; public String getTransactionId() { return transactionId; } public void setTransactionId(String transactionId) { this.transactionId = transactionId; } public String getEntryReference() { return entryReference; } public void setEntryReference(String entryReference) { this.entryReference = entryReference; } public String getEndToEndId() { return endToEndId; } public void setEndToEndId(String endToEndId) { this.endToEndId = endToEndId; } public String getMandateId() { return mandateId; } public void setMandateId(String mandateId) { this.mandateId = mandateId; } public String getCheckId() { return checkId; } public void setCheckId(String checkId) { this.checkId = checkId; } public String getCreditorId() { return creditorId; } public void setCreditorId(String creditorId) { this.creditorId = creditorId; } public LocalDate getBookingDate() { return bookingDate; } public void setBookingDate(LocalDate bookingDate) { this.bookingDate = bookingDate; } public LocalDate getValueDate() { return valueDate; } public void setValueDate(LocalDate valueDate) { this.valueDate = valueDate; } public Amount getTransactionAmount() { return transactionAmount; } public void setTransactionAmount(Amount transactionAmount) { this.transactionAmount = transactionAmount; } public String getCreditorName() { return creditorName; } public void setCreditorName(String creditorName) { this.creditorName = creditorName; } public AccountReference getCreditorAccount() { return creditorAccount; } public void setCreditorAccount(AccountReference creditorAccount) { this.creditorAccount = creditorAccount; } public String getCreditorAgent() { return creditorAgent; } public void setCreditorAgent(String creditorAgent) { this.creditorAgent = creditorAgent; } public String getUltimateCreditor() { return ultimateCreditor; } public void setUltimateCreditor(String ultimateCreditor) { this.ultimateCreditor = ultimateCreditor; } public String getDebtorName() { return debtorName; } public void setDebtorName(String debtorName) { this.debtorName = debtorName; } public AccountReference getDebtorAccount() { return debtorAccount; } public void setDebtorAccount(AccountReference debtorAccount) { this.debtorAccount = debtorAccount; } public String getDebtorAgent() { return debtorAgent; } public void setDebtorAgent(String debtorAgent) { this.debtorAgent = debtorAgent; } public String getUltimateDebtor() { return ultimateDebtor; } public void setUltimateDebtor(String ultimateDebtor) { this.ultimateDebtor = ultimateDebtor; } public String getRemittanceInformationUnstructured() { return remittanceInformationUnstructured; } public void setRemittanceInformationUnstructured(String remittanceInformationUnstructured) { this.remittanceInformationUnstructured = remittanceInformationUnstructured; } public List<String> getRemittanceInformationUnstructuredArray() { return remittanceInformationUnstructuredArray; } public void setRemittanceInformationUnstructuredArray( List<String> remittanceInformationUnstructuredArray) { this.remittanceInformationUnstructuredArray = remittanceInformationUnstructuredArray; } public String getRemittanceInformationStructured() { return remittanceInformationStructured; } public void setRemittanceInformationStructured( String remittanceInformationStructured) { this.remittanceInformationStructured = remittanceInformationStructured; } public List<RemittanceInformationStructured> getRemittanceInformationStructuredArray() { return remittanceInformationStructuredArray; } public void setRemittanceInformationStructuredArray( List<RemittanceInformationStructured> remittanceInformationStructuredArray) { this.remittanceInformationStructuredArray = remittanceInformationStructuredArray; } public String getAdditionalInformation() { return additionalInformation; } public void setAdditionalInformation(String additionalInformation) { this.additionalInformation = additionalInformation; } public FiduciaAdditionalInformationStructured getAdditionalInformationStructured() { return additionalInformationStructured; } public void setAdditionalInformationStructured( FiduciaAdditionalInformationStructured additionalInformationStructured) { this.additionalInformationStructured = additionalInformationStructured; } public PurposeCode getPurposeCode() { return purposeCode; } public void setPurposeCode(PurposeCode purposeCode) { this.purposeCode = purposeCode; } public String getBankTransactionCode() { return bankTransactionCode; } public void setBankTransactionCode(String bankTransactionCode) { this.bankTransactionCode = bankTransactionCode; } public String getProprietaryBankTransactionCode() { return proprietaryBankTransactionCode; } public void setProprietaryBankTransactionCode(String proprietaryBankTransactionCode) { this.proprietaryBankTransactionCode = proprietaryBankTransactionCode; } public Balance getBalanceAfterTransaction() { return balanceAfterTransaction; } public void setBalanceAfterTransaction(Balance balanceAfterTransaction) { this.balanceAfterTransaction = balanceAfterTransaction; } public Map<String, HrefType> getLinks() { return links; } public void setLinks(Map<String, HrefType> links) { this.links = links; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FiduciaTransactionDetails that = (FiduciaTransactionDetails) o; return Objects.equals(transactionId, that.transactionId) && Objects.equals(entryReference, that.entryReference) && Objects.equals(endToEndId, that.endToEndId) && Objects.equals(mandateId, that.mandateId) && Objects.equals(checkId, that.checkId) && Objects.equals(creditorId, that.creditorId) && Objects.equals(bookingDate, that.bookingDate) && Objects.equals(valueDate, that.valueDate) && Objects.equals(transactionAmount, that.transactionAmount) && Objects.equals(creditorName, that.creditorName) && Objects.equals(creditorAccount, that.creditorAccount) && Objects.equals(creditorAgent, that.creditorAgent) && Objects.equals(ultimateCreditor, that.ultimateCreditor) && Objects.equals(debtorName, that.debtorName) && Objects.equals(debtorAccount, that.debtorAccount) && Objects.equals(debtorAgent, that.debtorAgent) && Objects.equals(ultimateDebtor, that.ultimateDebtor) && Objects.equals(remittanceInformationUnstructured, that.remittanceInformationUnstructured) && Objects.equals(remittanceInformationUnstructuredArray, that.remittanceInformationUnstructuredArray) && Objects.equals(remittanceInformationStructured, that.remittanceInformationStructured) && Objects.equals(remittanceInformationStructuredArray, that.remittanceInformationStructuredArray) && Objects.equals(additionalInformation, that.additionalInformation) && Objects.equals(additionalInformationStructured, that.additionalInformationStructured) && Objects.equals(purposeCode, that.purposeCode) && Objects.equals(bankTransactionCode, that.bankTransactionCode) && Objects.equals(proprietaryBankTransactionCode, that.proprietaryBankTransactionCode) && Objects.equals(balanceAfterTransaction, that.balanceAfterTransaction) && Objects.equals(links, that.links); } @Override public int hashCode() { return Objects.hash(transactionId, entryReference, endToEndId, mandateId, checkId, creditorId, bookingDate, valueDate, transactionAmount, creditorName, creditorAccount, creditorAgent, ultimateCreditor, debtorName, debtorAccount, debtorAgent, ultimateDebtor, remittanceInformationUnstructured, remittanceInformationUnstructuredArray, remittanceInformationStructured, remittanceInformationStructuredArray, additionalInformation, additionalInformationStructured, purposeCode, bankTransactionCode, proprietaryBankTransactionCode, balanceAfterTransaction, links); } }
11,720
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaAdditionalInformationStructured.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/model/FiduciaAdditionalInformationStructured.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.model; import java.util.Objects; public class FiduciaAdditionalInformationStructured { private FiduciaStandingOrderDetails standingOrderDetails; public FiduciaStandingOrderDetails getStandingOrderDetails() { return standingOrderDetails; } public void setStandingOrderDetails(FiduciaStandingOrderDetails standingOrderDetails) { this.standingOrderDetails = standingOrderDetails; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FiduciaAdditionalInformationStructured that = (FiduciaAdditionalInformationStructured) o; return Objects.equals(standingOrderDetails, that.standingOrderDetails); } @Override public int hashCode() { return Objects.hash(standingOrderDetails); } }
1,731
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaPeriodicPaymentInitiationXmlPart2StandingorderTypeJson.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/model/FiduciaPeriodicPaymentInitiationXmlPart2StandingorderTypeJson.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.model; import de.adorsys.xs2a.adapter.api.model.FrequencyCode; import java.time.LocalDate; import java.util.Objects; public class FiduciaPeriodicPaymentInitiationXmlPart2StandingorderTypeJson { private LocalDate startDate; private LocalDate endDate; private FiduciaExecutionRule executionRule; private FrequencyCode frequency; private FiduciaDayOfExecution dayOfExecution; public LocalDate getStartDate() { return startDate; } public void setStartDate(LocalDate startDate) { this.startDate = startDate; } public LocalDate getEndDate() { return endDate; } public void setEndDate(LocalDate endDate) { this.endDate = endDate; } public FiduciaExecutionRule getExecutionRule() { return executionRule; } public void setExecutionRule(FiduciaExecutionRule executionRule) { this.executionRule = executionRule; } public FrequencyCode getFrequency() { return frequency; } public void setFrequency(FrequencyCode frequency) { this.frequency = frequency; } public FiduciaDayOfExecution getDayOfExecution() { return dayOfExecution; } public void setDayOfExecution(FiduciaDayOfExecution dayOfExecution) { this.dayOfExecution = dayOfExecution; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FiduciaPeriodicPaymentInitiationXmlPart2StandingorderTypeJson that = (FiduciaPeriodicPaymentInitiationXmlPart2StandingorderTypeJson) o; return Objects.equals(startDate, that.startDate) && Objects.equals(endDate, that.endDate) && Objects.equals(executionRule, that.executionRule) && Objects.equals(frequency, that.frequency) && Objects.equals(dayOfExecution, that.dayOfExecution); } @Override public int hashCode() { return Objects.hash(startDate, endDate, executionRule, frequency, dayOfExecution); } }
2,992
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaUpdatePsuAuthenticationResponse.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/model/FiduciaUpdatePsuAuthenticationResponse.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.model; import com.fasterxml.jackson.annotation.JsonProperty; import de.adorsys.xs2a.adapter.api.model.AuthenticationObject; import de.adorsys.xs2a.adapter.api.model.HrefType; import de.adorsys.xs2a.adapter.api.model.ScaStatus; import java.util.List; import java.util.Map; import java.util.Objects; public class FiduciaUpdatePsuAuthenticationResponse { private AuthenticationObject chosenScaMethod; private FiduciaChallengeData challengeData; private List<AuthenticationObject> scaMethods; @JsonProperty("_links") private Map<String, HrefType> links; private ScaStatus scaStatus; private String psuMessage; private String authorisationId; public AuthenticationObject getChosenScaMethod() { return chosenScaMethod; } public void setChosenScaMethod(AuthenticationObject chosenScaMethod) { this.chosenScaMethod = chosenScaMethod; } public FiduciaChallengeData getChallengeData() { return challengeData; } public void setChallengeData(FiduciaChallengeData challengeData) { this.challengeData = challengeData; } public List<AuthenticationObject> getScaMethods() { return scaMethods; } public void setScaMethods(List<AuthenticationObject> scaMethods) { this.scaMethods = scaMethods; } public Map<String, HrefType> getLinks() { return links; } public void setLinks(Map<String, HrefType> links) { this.links = links; } public ScaStatus getScaStatus() { return scaStatus; } public void setScaStatus(ScaStatus scaStatus) { this.scaStatus = scaStatus; } public String getPsuMessage() { return psuMessage; } public void setPsuMessage(String psuMessage) { this.psuMessage = psuMessage; } public String getAuthorisationId() { return authorisationId; } public void setAuthorisationId(String authorisationId) { this.authorisationId = authorisationId; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FiduciaUpdatePsuAuthenticationResponse that = (FiduciaUpdatePsuAuthenticationResponse) o; return Objects.equals(chosenScaMethod, that.chosenScaMethod) && Objects.equals(challengeData, that.challengeData) && Objects.equals(scaMethods, that.scaMethods) && Objects.equals(links, that.links) && Objects.equals(scaStatus, that.scaStatus) && Objects.equals(psuMessage, that.psuMessage) && Objects.equals(authorisationId, that.authorisationId); } @Override public int hashCode() { return Objects.hash(chosenScaMethod, challengeData, scaMethods, links, scaStatus, psuMessage, authorisationId); } }
3,816
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaStandingOrderDetails.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/model/FiduciaStandingOrderDetails.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.model; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import de.adorsys.xs2a.adapter.api.model.Amount; import de.adorsys.xs2a.adapter.api.model.FrequencyCode; import java.time.LocalDate; import java.util.List; import java.util.Objects; public class FiduciaStandingOrderDetails { private LocalDate startDate; private FrequencyCode frequency; private LocalDate endDate; private FiduciaExecutionRule executionRule; private Boolean withinAMonthFlag; private List<FiduciaMonthsOfExecution> monthsOfExecution; private Integer multiplicator; private FiduciaDayOfExecution dayOfExecution; private Amount limitAmount; public LocalDate getStartDate() { return startDate; } public void setStartDate(LocalDate startDate) { this.startDate = startDate; } public FrequencyCode getFrequency() { return frequency; } public void setFrequency(FrequencyCode frequency) { this.frequency = frequency; } public LocalDate getEndDate() { return endDate; } public void setEndDate(LocalDate endDate) { this.endDate = endDate; } public FiduciaExecutionRule getExecutionRule() { return executionRule; } public void setExecutionRule(FiduciaExecutionRule executionRule) { this.executionRule = executionRule; } public Boolean getWithinAMonthFlag() { return withinAMonthFlag; } public void setWithinAMonthFlag(Boolean withinAMonthFlag) { this.withinAMonthFlag = withinAMonthFlag; } public List<FiduciaMonthsOfExecution> getMonthsOfExecution() { return monthsOfExecution; } public void setMonthsOfExecution(List<FiduciaMonthsOfExecution> monthsOfExecution) { this.monthsOfExecution = monthsOfExecution; } public Integer getMultiplicator() { return multiplicator; } public void setMultiplicator(Integer multiplicator) { this.multiplicator = multiplicator; } public FiduciaDayOfExecution getDayOfExecution() { return dayOfExecution; } public void setDayOfExecution(FiduciaDayOfExecution dayOfExecution) { this.dayOfExecution = dayOfExecution; } public Amount getLimitAmount() { return limitAmount; } public void setLimitAmount(Amount limitAmount) { this.limitAmount = limitAmount; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FiduciaStandingOrderDetails that = (FiduciaStandingOrderDetails) o; return Objects.equals(startDate, that.startDate) && Objects.equals(frequency, that.frequency) && Objects.equals(endDate, that.endDate) && Objects.equals(executionRule, that.executionRule) && Objects.equals(withinAMonthFlag, that.withinAMonthFlag) && Objects.equals(monthsOfExecution, that.monthsOfExecution) && Objects.equals(multiplicator, that.multiplicator) && Objects.equals(dayOfExecution, that.dayOfExecution) && Objects.equals(limitAmount, that.limitAmount); } @Override public int hashCode() { return Objects.hash(startDate, frequency, endDate, executionRule, withinAMonthFlag, monthsOfExecution, multiplicator, dayOfExecution, limitAmount); } public enum FiduciaMonthsOfExecution { _1("01"), _2("02"), _3("03"), _4("04"), _5("05"), _6("06"), _7("07"), _8("08"), _9("09"), _10("10"), _11("11"), _12("12"); private String value; FiduciaMonthsOfExecution(String value) { this.value = value; } @JsonCreator public static FiduciaMonthsOfExecution fromValue(String value) { for (FiduciaMonthsOfExecution e : FiduciaMonthsOfExecution.values()) { if (e.value.equals(value)) { return e; } } return null; } @Override @JsonValue public String toString() { return value; } } }
5,270
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
FiduciaChallengeData.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/adapters/fiducia-adapter/src/main/java/de/adorsys/xs2a/adapter/fiducia/model/FiduciaChallengeData.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.fiducia.model; import de.adorsys.xs2a.adapter.api.model.ChallengeData.OtpFormat; public class FiduciaChallengeData { private byte[] image; private String data; private String imageLink; private Integer otpMaxLength; private OtpFormat otpFormat; private String additionalInformation; public byte[] getImage() { return image; } public void setImage(byte[] image) { this.image = image; } public String getData() { return data; } public void setData(String data) { this.data = data; } public String getImageLink() { return imageLink; } public void setImageLink(String imageLink) { this.imageLink = imageLink; } public Integer getOtpMaxLength() { return otpMaxLength; } public void setOtpMaxLength(Integer otpMaxLength) { this.otpMaxLength = otpMaxLength; } public OtpFormat getOtpFormat() { return otpFormat; } public void setOtpFormat(OtpFormat otpFormat) { this.otpFormat = otpFormat; } public String getAdditionalInformation() { return additionalInformation; } public void setAdditionalInformation(String additionalInformation) { this.additionalInformation = additionalInformation; } }
2,074
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
ConsentApi.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-rest-api/src/main/java/de/adorsys/xs2a/adapter/rest/api/ConsentApi.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.rest.api; import com.fasterxml.jackson.databind.node.ObjectNode; import de.adorsys.xs2a.adapter.api.model.Authorisations; import de.adorsys.xs2a.adapter.api.model.ConsentInformationResponse200Json; import de.adorsys.xs2a.adapter.api.model.ConsentStatusResponse200; import de.adorsys.xs2a.adapter.api.model.Consents; import de.adorsys.xs2a.adapter.api.model.ConsentsResponse201; import de.adorsys.xs2a.adapter.api.model.ScaStatusResponse; import de.adorsys.xs2a.adapter.api.model.StartScaprocessResponse; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import javax.annotation.Generated; import java.util.Map; @Generated("xs2a-adapter-codegen") public interface ConsentApi { @RequestMapping( value = "/v1/consents", method = RequestMethod.POST, consumes = "application/json" ) ResponseEntity<ConsentsResponse201> createConsent( @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers, @RequestBody Consents body); @RequestMapping( value = "/v1/consents/{consentId}", method = RequestMethod.GET ) ResponseEntity<ConsentInformationResponse200Json> getConsentInformation( @PathVariable("consentId") String consentId, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); @RequestMapping( value = "/v1/consents/{consentId}", method = RequestMethod.DELETE ) ResponseEntity<Void> deleteConsent( @PathVariable("consentId") String consentId, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); @RequestMapping( value = "/v1/consents/{consentId}/status", method = RequestMethod.GET ) ResponseEntity<ConsentStatusResponse200> getConsentStatus( @PathVariable("consentId") String consentId, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); @RequestMapping( value = "/v1/consents/{consentId}/authorisations", method = RequestMethod.GET ) ResponseEntity<Authorisations> getConsentAuthorisation( @PathVariable("consentId") String consentId, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); @RequestMapping( value = "/v1/consents/{consentId}/authorisations", method = RequestMethod.POST, consumes = "application/json" ) ResponseEntity<StartScaprocessResponse> startConsentAuthorisation( @PathVariable("consentId") String consentId, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers, @RequestBody ObjectNode body); @RequestMapping( value = "/v1/consents/{consentId}/authorisations/{authorisationId}", method = RequestMethod.GET ) ResponseEntity<ScaStatusResponse> getConsentScaStatus( @PathVariable("consentId") String consentId, @PathVariable("authorisationId") String authorisationId, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); @RequestMapping( value = "/v1/consents/{consentId}/authorisations/{authorisationId}", method = RequestMethod.PUT, consumes = "application/json" ) ResponseEntity<Object> updateConsentsPsuData( @PathVariable("consentId") String consentId, @PathVariable("authorisationId") String authorisationId, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers, @RequestBody ObjectNode body); }
4,922
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AccountApi.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-rest-api/src/main/java/de/adorsys/xs2a/adapter/rest/api/AccountApi.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.rest.api; import de.adorsys.xs2a.adapter.api.model.AccountList; import de.adorsys.xs2a.adapter.api.model.BookingStatusCard; import de.adorsys.xs2a.adapter.api.model.BookingStatusGeneric; import de.adorsys.xs2a.adapter.api.model.CardAccountList; import de.adorsys.xs2a.adapter.api.model.CardAccountsTransactionsResponse200; import de.adorsys.xs2a.adapter.api.model.OK200AccountDetails; import de.adorsys.xs2a.adapter.api.model.OK200CardAccountDetails; import de.adorsys.xs2a.adapter.api.model.OK200TransactionDetails; import de.adorsys.xs2a.adapter.api.model.ReadAccountBalanceResponse200; import de.adorsys.xs2a.adapter.api.model.ReadCardAccountBalanceResponse200; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import javax.annotation.Generated; import java.time.LocalDate; import java.util.Map; @Generated("xs2a-adapter-codegen") public interface AccountApi { @RequestMapping( value = "/v1/accounts", method = RequestMethod.GET ) ResponseEntity<AccountList> getAccountList( @RequestParam(value = "withBalance", required = false) Boolean withBalance, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); @RequestMapping( value = "/v1/accounts/{account-id}", method = RequestMethod.GET ) ResponseEntity<OK200AccountDetails> readAccountDetails( @PathVariable("account-id") String accountId, @RequestParam(value = "withBalance", required = false) Boolean withBalance, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); @RequestMapping( value = "/v1/accounts/{account-id}/balances", method = RequestMethod.GET ) ResponseEntity<ReadAccountBalanceResponse200> getBalances( @PathVariable("account-id") String accountId, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); @SuppressWarnings("parameternumber") @RequestMapping( value = "/v1/accounts/{account-id}/transactions", method = RequestMethod.GET ) ResponseEntity<Object> getTransactionList( @PathVariable("account-id") String accountId, @RequestParam(value = "dateFrom", required = false) LocalDate dateFrom, @RequestParam(value = "dateTo", required = false) LocalDate dateTo, @RequestParam(value = "entryReferenceFrom", required = false) String entryReferenceFrom, @RequestParam(value = "bookingStatus", required = true) BookingStatusGeneric bookingStatus, @RequestParam(value = "deltaList", required = false) Boolean deltaList, @RequestParam(value = "withBalance", required = false) Boolean withBalance, @RequestParam(value = "pageIndex", required = false) Integer pageIndex, @RequestParam(value = "itemsPerPage", required = false) Integer itemsPerPage, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); @RequestMapping( value = "/v1/accounts/{account-id}/transactions/{transactionId}", method = RequestMethod.GET ) ResponseEntity<OK200TransactionDetails> getTransactionDetails( @PathVariable("account-id") String accountId, @PathVariable("transactionId") String transactionId, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); @RequestMapping( value = "/v1/card-accounts", method = RequestMethod.GET ) ResponseEntity<CardAccountList> getCardAccountList( @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); @RequestMapping( value = "/v1/card-accounts/{account-id}", method = RequestMethod.GET ) ResponseEntity<OK200CardAccountDetails> readCardAccountDetails( @PathVariable("account-id") String accountId, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); @RequestMapping( value = "/v1/card-accounts/{account-id}/balances", method = RequestMethod.GET ) ResponseEntity<ReadCardAccountBalanceResponse200> getCardAccountBalances( @PathVariable("account-id") String accountId, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); @RequestMapping( value = "/v1/card-accounts/{account-id}/transactions", method = RequestMethod.GET ) ResponseEntity<CardAccountsTransactionsResponse200> getCardAccountTransactionList( @PathVariable("account-id") String accountId, @RequestParam(value = "dateFrom", required = false) LocalDate dateFrom, @RequestParam(value = "dateTo", required = false) LocalDate dateTo, @RequestParam(value = "entryReferenceFrom", required = false) String entryReferenceFrom, @RequestParam(value = "bookingStatus", required = true) BookingStatusCard bookingStatus, @RequestParam(value = "deltaList", required = false) Boolean deltaList, @RequestParam(value = "withBalance", required = false) Boolean withBalance, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); }
6,459
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
PaymentApi.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-rest-api/src/main/java/de/adorsys/xs2a/adapter/rest/api/PaymentApi.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.rest.api; import com.fasterxml.jackson.databind.node.ObjectNode; import de.adorsys.xs2a.adapter.api.model.Authorisations; import de.adorsys.xs2a.adapter.api.model.PaymentInitationRequestResponse201; import de.adorsys.xs2a.adapter.api.model.PaymentProduct; import de.adorsys.xs2a.adapter.api.model.PaymentService; import de.adorsys.xs2a.adapter.api.model.PeriodicPaymentInitiationMultipartBody; import de.adorsys.xs2a.adapter.api.model.ScaStatusResponse; import de.adorsys.xs2a.adapter.api.model.StartScaprocessResponse; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import javax.annotation.Generated; import java.util.Map; @Generated("xs2a-adapter-codegen") public interface PaymentApi { @RequestMapping( value = "/v1/{payment-service}/{payment-product}", method = RequestMethod.POST, consumes = "application/json" ) ResponseEntity<PaymentInitationRequestResponse201> initiatePayment( @PathVariable("payment-service") PaymentService paymentService, @PathVariable("payment-product") PaymentProduct paymentProduct, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers, @RequestBody ObjectNode body); @RequestMapping( value = "/v1/{payment-service}/{payment-product}", method = RequestMethod.POST, consumes = { "application/xml", "text/plain" } ) ResponseEntity<PaymentInitationRequestResponse201> initiatePayment( @PathVariable("payment-service") PaymentService paymentService, @PathVariable("payment-product") PaymentProduct paymentProduct, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers, @RequestBody String body); @RequestMapping( value = "/v1/{payment-service}/{payment-product}", method = RequestMethod.POST, consumes = "multipart/form-data" ) ResponseEntity<PaymentInitationRequestResponse201> initiatePayment( @PathVariable("payment-service") PaymentService paymentService, @PathVariable("payment-product") PaymentProduct paymentProduct, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers, PeriodicPaymentInitiationMultipartBody body); @RequestMapping( value = "/v1/{payment-service}/{payment-product}/{paymentId}", method = RequestMethod.GET ) ResponseEntity<Object> getPaymentInformation( @PathVariable("payment-service") PaymentService paymentService, @PathVariable("payment-product") PaymentProduct paymentProduct, @PathVariable("paymentId") String paymentId, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); @RequestMapping( value = "/v1/{payment-service}/{payment-product}/{paymentId}/status", method = RequestMethod.GET ) ResponseEntity<Object> getPaymentInitiationStatus( @PathVariable("payment-service") PaymentService paymentService, @PathVariable("payment-product") PaymentProduct paymentProduct, @PathVariable("paymentId") String paymentId, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); @RequestMapping( value = "/v1/{payment-service}/{payment-product}/{paymentId}/authorisations", method = RequestMethod.GET ) ResponseEntity<Authorisations> getPaymentInitiationAuthorisation( @PathVariable("payment-service") PaymentService paymentService, @PathVariable("payment-product") PaymentProduct paymentProduct, @PathVariable("paymentId") String paymentId, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); @RequestMapping( value = "/v1/{payment-service}/{payment-product}/{paymentId}/authorisations", method = RequestMethod.POST, consumes = "application/json" ) ResponseEntity<StartScaprocessResponse> startPaymentAuthorisation( @PathVariable("payment-service") PaymentService paymentService, @PathVariable("payment-product") PaymentProduct paymentProduct, @PathVariable("paymentId") String paymentId, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers, @RequestBody ObjectNode body); @RequestMapping( value = "/v1/{payment-service}/{payment-product}/{paymentId}/authorisations/{authorisationId}", method = RequestMethod.GET ) ResponseEntity<ScaStatusResponse> getPaymentInitiationScaStatus( @PathVariable("payment-service") PaymentService paymentService, @PathVariable("payment-product") PaymentProduct paymentProduct, @PathVariable("paymentId") String paymentId, @PathVariable("authorisationId") String authorisationId, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers); @RequestMapping( value = "/v1/{payment-service}/{payment-product}/{paymentId}/authorisations/{authorisationId}", method = RequestMethod.PUT, consumes = "application/json" ) ResponseEntity<Object> updatePaymentPsuData( @PathVariable("payment-service") PaymentService paymentService, @PathVariable("payment-product") PaymentProduct paymentProduct, @PathVariable("paymentId") String paymentId, @PathVariable("authorisationId") String authorisationId, @RequestParam Map<String, String> parameters, @RequestHeader Map<String, String> headers, @RequestBody ObjectNode body); }
6,905
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
DownloadServiceImplTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/test/java/de/adorsys/xs2a/adapter/serviceloader/DownloadServiceImplTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.DownloadService; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.Response; import de.adorsys.xs2a.adapter.api.ResponseHeaders; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import java.util.Collections; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class DownloadServiceImplTest { private static final String DOWNLOAD_URL = "https://www.example.com"; private static final RequestHeaders REQUEST_HEADERS = RequestHeaders.fromMap(Collections.emptyMap()); private static final ResponseHeaders RESPONSE_HEADERS = ResponseHeaders.fromMap(Collections.emptyMap()); private static final int HTTP_CODE_200 = 200; private static final byte[] RESPONSE_BODY = "response body".getBytes(); private static final Response<byte[]> RESPONSE = new Response<>(HTTP_CODE_200, RESPONSE_BODY, RESPONSE_HEADERS); @Mock private AdapterServiceLoader adapterServiceLoader; @Mock private DownloadService downloadService; @InjectMocks private DownloadServiceImpl service; @Test void download() { when(adapterServiceLoader.getDownloadService(REQUEST_HEADERS)) .thenReturn(downloadService); when(downloadService.download(DOWNLOAD_URL, REQUEST_HEADERS)) .thenReturn(RESPONSE); Response<byte[]> actualResponse = service.download(DOWNLOAD_URL, REQUEST_HEADERS); assertThat(actualResponse).isEqualTo(RESPONSE); } }
2,593
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
EmbeddedPreAuthorisationServiceImplTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/test/java/de/adorsys/xs2a/adapter/serviceloader/EmbeddedPreAuthorisationServiceImplTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.EmbeddedPreAuthorisationService; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.model.EmbeddedPreAuthorisationRequest; import de.adorsys.xs2a.adapter.api.model.TokenResponse; import org.junit.jupiter.api.Test; import java.util.Collections; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; class EmbeddedPreAuthorisationServiceImplTest { @Test void getToken() { AdapterServiceLoader serviceLoader = mock(AdapterServiceLoader.class); EmbeddedPreAuthorisationService service = mock(EmbeddedPreAuthorisationService.class); EmbeddedPreAuthorisationServiceImpl serviceImpl = new EmbeddedPreAuthorisationServiceImpl(serviceLoader); RequestHeaders requestHeaders = RequestHeaders.fromMap(Collections.emptyMap()); EmbeddedPreAuthorisationRequest authorisationRequest = new EmbeddedPreAuthorisationRequest(); TokenResponse expected = new TokenResponse(); doReturn(service).when(serviceLoader).getEmbeddedPreAuthorisationService(eq(requestHeaders)); doReturn(expected).when(service).getToken(authorisationRequest, requestHeaders); TokenResponse actual = serviceImpl.getToken(authorisationRequest, requestHeaders); assertThat(actual).isEqualTo(expected); verify(serviceLoader, times(1)).getEmbeddedPreAuthorisationService(any()); verify(service, times(1)).getToken(any(), any()); } }
2,433
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
TestAccountInformationService.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/test/java/de/adorsys/xs2a/adapter/serviceloader/TestAccountInformationService.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.AccountInformationService; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.RequestParams; import de.adorsys.xs2a.adapter.api.Response; import de.adorsys.xs2a.adapter.api.model.*; public class TestAccountInformationService implements AccountInformationService { @Override public Response<ConsentsResponse201> createConsent(RequestHeaders requestHeaders, RequestParams requestParams, Consents body) { return null; } @Override public Response<ConsentInformationResponse200Json> getConsentInformation(String consentId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<Void> deleteConsent(String consentId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<ConsentStatusResponse200> getConsentStatus(String consentId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<Authorisations> getConsentAuthorisation(String consentId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<StartScaprocessResponse> startConsentAuthorisation(String consentId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<StartScaprocessResponse> startConsentAuthorisation(String consentId, RequestHeaders requestHeaders, RequestParams requestParams, UpdatePsuAuthentication updatePsuAuthentication) { return null; } @Override public Response<SelectPsuAuthenticationMethodResponse> updateConsentsPsuData(String consentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams, SelectPsuAuthenticationMethod selectPsuAuthenticationMethod) { return null; } @Override public Response<ScaStatusResponse> updateConsentsPsuData(String consentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams, TransactionAuthorisation transactionAuthorisation) { return null; } @Override public Response<UpdatePsuAuthenticationResponse> updateConsentsPsuData(String consentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams, UpdatePsuAuthentication updatePsuAuthentication) { return null; } @Override public Response<AccountList> getAccountList(RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<OK200AccountDetails> readAccountDetails(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<TransactionsResponse200Json> getTransactionList(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<String> getTransactionListAsString(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<ScaStatusResponse> getConsentScaStatus(String consentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<ReadAccountBalanceResponse200> getBalances(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<CardAccountList> getCardAccountList(RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<OK200CardAccountDetails> getCardAccountDetails(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<ReadCardAccountBalanceResponse200> getCardAccountBalances(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<CardAccountsTransactionsResponse200> getCardAccountTransactionList(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<OK200TransactionDetails> getTransactionDetails(String accountId, String transactionId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } }
8,156
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdapterDelegatingOauth2ServiceTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/test/java/de/adorsys/xs2a/adapter/serviceloader/AdapterDelegatingOauth2ServiceTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.Oauth2Service; import de.adorsys.xs2a.adapter.api.RequestHeaders; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Spy; import org.mockito.junit.jupiter.MockitoExtension; import java.io.IOException; import java.util.HashMap; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; @ExtendWith(MockitoExtension.class) class AdapterDelegatingOauth2ServiceTest { @Spy private final Oauth2Service testService = new TestOauth2Service(); @Mock private AdapterServiceLoader serviceLoader; @InjectMocks private AdapterDelegatingOauth2Service oauth2Service; @Test void getAuthorizationRequestUri() throws IOException { when(serviceLoader.getOauth2Service(any(RequestHeaders.class))).thenReturn(testService); oauth2Service.getAuthorizationRequestUri(new HashMap<>(), new Oauth2Service.Parameters()); verify(serviceLoader, times(1)).getOauth2Service(any(RequestHeaders.class)); verify(testService, times(1)).getAuthorizationRequestUri(anyMap(), any(Oauth2Service.Parameters.class)); } @Test void getToken() throws IOException { when(serviceLoader.getOauth2Service(any(RequestHeaders.class))).thenReturn(testService); oauth2Service.getToken(new HashMap<>(), new Oauth2Service.Parameters()); verify(serviceLoader, times(1)).getOauth2Service(any(RequestHeaders.class)); verify(testService, times(1)).getToken(anyMap(), any(Oauth2Service.Parameters.class)); } }
2,526
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
TestDownloadService.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/test/java/de/adorsys/xs2a/adapter/serviceloader/TestDownloadService.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.DownloadService; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.Response; public class TestDownloadService implements DownloadService { @Override public Response<byte[]> download(String downloadUrl, RequestHeaders requestHeaders) { return null; } }
1,223
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
TestOauth2Service.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/test/java/de/adorsys/xs2a/adapter/serviceloader/TestOauth2Service.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.Oauth2Service; import de.adorsys.xs2a.adapter.api.model.TokenResponse; import java.io.IOException; import java.net.URI; import java.util.Map; public class TestOauth2Service implements Oauth2Service { @Override public URI getAuthorizationRequestUri(Map<String, String> headers, Parameters parameters) throws IOException { return null; } @Override public TokenResponse getToken(Map<String, String> headers, Parameters parameters) throws IOException { return null; } }
1,498
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
TestPaymentInitiationService.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/test/java/de/adorsys/xs2a/adapter/serviceloader/TestPaymentInitiationService.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.PaymentInitiationService; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.RequestParams; import de.adorsys.xs2a.adapter.api.Response; import de.adorsys.xs2a.adapter.api.model.*; public class TestPaymentInitiationService implements PaymentInitiationService { @Override public Response<PaymentInitationRequestResponse201> initiatePayment(PaymentService paymentService, PaymentProduct paymentProduct, RequestHeaders requestHeaders, RequestParams requestParams, Object body) { return null; } @Override public Response<PaymentInitiationWithStatusResponse> getSinglePaymentInformation(PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<PeriodicPaymentInitiationWithStatusResponse> getPeriodicPaymentInformation(PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<PeriodicPaymentInitiationMultipartBody> getPeriodicPain001PaymentInformation(PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<String> getPaymentInformationAsString(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<ScaStatusResponse> getPaymentInitiationScaStatus(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<PaymentInitiationStatusResponse200Json> getPaymentInitiationStatus(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<String> getPaymentInitiationStatusAsString(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<Authorisations> getPaymentInitiationAuthorisation(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<StartScaprocessResponse> startPaymentAuthorisation(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return null; } @Override public Response<StartScaprocessResponse> startPaymentAuthorisation(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams, UpdatePsuAuthentication body) { return null; } @Override public Response<SelectPsuAuthenticationMethodResponse> updatePaymentPsuData(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams, SelectPsuAuthenticationMethod body) { return null; } @Override public Response<ScaStatusResponse> updatePaymentPsuData(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams, TransactionAuthorisation body) { return null; } @Override public Response<UpdatePsuAuthenticationResponse> updatePaymentPsuData(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams, UpdatePsuAuthentication body) { return null; } }
9,463
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdapterServiceLoaderTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/test/java/de/adorsys/xs2a/adapter/serviceloader/AdapterServiceLoaderTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.*; import de.adorsys.xs2a.adapter.api.config.AdapterConfig; import de.adorsys.xs2a.adapter.api.exception.AdapterNotFoundException; import de.adorsys.xs2a.adapter.api.exception.AspspRegistrationNotFoundException; import de.adorsys.xs2a.adapter.api.model.Aspsp; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import java.util.*; import static de.adorsys.xs2a.adapter.api.RequestHeaders.*; import static java.util.Collections.singletonMap; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.*; class AdapterServiceLoaderTest { private static final String ADAPTER_ID = "test-adapter"; private static final String ASPSP_ID = "test-aspsp-id"; private static final String BANK_CODE = "test-bank-code"; private static final String BIC = "test-bic"; private static RequestHeaders requestHeadersWithAspspId; private static RequestHeaders requestHeadersWithBankCode; private static RequestHeaders requestHeadersWithBic; private static RequestHeaders requestHeadersWithBankCodeAndBic; private final AspspReadOnlyRepository aspspRepository = mock(AspspReadOnlyRepository.class); private AdapterServiceLoader adapterServiceLoader = new AdapterServiceLoader(aspspRepository, null, null, null, false); @BeforeEach public void setUp() { requestHeadersWithAspspId = fromMap(singletonMap(X_GTW_ASPSP_ID, ASPSP_ID)); requestHeadersWithBankCode = fromMap(singletonMap(X_GTW_BANK_CODE, BANK_CODE)); requestHeadersWithBic = fromMap(singletonMap(X_GTW_BIC, BIC)); Map<String, String> headers = new HashMap<>(); headers.put(X_GTW_BANK_CODE, BANK_CODE); headers.put(X_GTW_BIC, BIC); requestHeadersWithBankCodeAndBic = fromMap(headers); } @Test void getServiceProvider() { Optional<AccountInformationServiceProvider> accountInformationServiceProvider = adapterServiceLoader.getServiceProvider(AccountInformationServiceProvider.class, ADAPTER_ID); assertThat(accountInformationServiceProvider).get().hasFieldOrPropertyWithValue("adapterId", ADAPTER_ID); } @Test void getServiceProviderIsCaseInsensitive() { Optional<AccountInformationServiceProvider> accountInformationServiceProvider = adapterServiceLoader.getServiceProvider(AccountInformationServiceProvider.class, ADAPTER_ID.toUpperCase()); assertThat(accountInformationServiceProvider).get().hasFieldOrPropertyWithValue("adapterId", ADAPTER_ID); } @Test void getAccountInformationServiceFindsAdapterByAspspId() { Aspsp aspsp = new Aspsp(); aspsp.setAdapterId(ADAPTER_ID); when(aspspRepository.findById(ASPSP_ID)) .thenReturn(Optional.of(aspsp)); adapterServiceLoader.getAccountInformationService(requestHeadersWithAspspId); verify(aspspRepository, times(1)).findById(ASPSP_ID); } @Test void getAccountInformationServiceThrowsWhenAspspNotFound() { when(aspspRepository.findById(ASPSP_ID)) .thenReturn(Optional.empty()); Assertions.assertThrows( AspspRegistrationNotFoundException.class, () -> adapterServiceLoader.getAccountInformationService(requestHeadersWithAspspId) ); } @Test void getServiceProviderThrowsExceptionWhenAdapterNotFound() { when(aspspRepository.findById(ASPSP_ID)) .thenReturn(Optional.of(new Aspsp())); Assertions.assertThrows( AdapterNotFoundException.class, () -> adapterServiceLoader.getAccountInformationService(requestHeadersWithAspspId) ); } @Test void getAccountInformationServiceThrowsIfNothingFoundByBankCode() { Assertions.assertThrows( AspspRegistrationNotFoundException.class, () -> adapterServiceLoader.getAccountInformationService(requestHeadersWithBankCode) ); } @Test void getAccountInformationServiceThrowsIfNothingFoundByBic() { Assertions.assertThrows( AspspRegistrationNotFoundException.class, () -> adapterServiceLoader.getAccountInformationService(requestHeadersWithBic) ); } @Test void getAccountInformationServiceThrowsIfNothingFoundByBankCodeAndBic() { Assertions.assertThrows( AspspRegistrationNotFoundException.class, () -> adapterServiceLoader.getAccountInformationService(requestHeadersWithBankCodeAndBic) ); } @Test void getAccountInformationServiceFindsAdapterByBankCode() { Aspsp aspsp = new Aspsp(); aspsp.setAdapterId(ADAPTER_ID); when(aspspRepository.findByBankCode(BANK_CODE)) .thenReturn(Collections.singletonList(aspsp)); AccountInformationService ais = adapterServiceLoader.getAccountInformationService(requestHeadersWithBankCode); assertThat(ais).isNotNull(); verify(aspspRepository, times(1)).findByBankCode(BANK_CODE); } @Test void getAccountInformationServiceFindsAdapterByIban() { Aspsp aspsp = new Aspsp(); aspsp.setAdapterId(ADAPTER_ID); String iban = "DE91100000000123456789"; when(aspspRepository.findByIban(iban)) .thenReturn(Collections.singletonList(aspsp)); RequestHeaders requestHeaders = fromMap(singletonMap(X_GTW_IBAN, iban)); AccountInformationService ais = adapterServiceLoader.getAccountInformationService(requestHeaders); assertThat(ais).isNotNull(); verify(aspspRepository, times(1)).findByIban(iban); } @Test void getAccountInformationServiceFindsAdapterByBic() { Aspsp aspsp = new Aspsp(); aspsp.setAdapterId(ADAPTER_ID); when(aspspRepository.findByBic(BIC)) .thenReturn(Collections.singletonList(aspsp)); AccountInformationService ais = adapterServiceLoader.getAccountInformationService(requestHeadersWithBic); assertThat(ais).isNotNull(); verify(aspspRepository, times(1)).findByBic(BIC); } @Test void getAccountInformationServiceFindsAdapterByBankCodeAndBic() { Aspsp aspsp = new Aspsp(); aspsp.setAdapterId(ADAPTER_ID); when(aspspRepository.findLike(buildAspsp(BANK_CODE, BIC, null))) .thenReturn(Collections.singletonList(aspsp)); AccountInformationService ais = adapterServiceLoader.getAccountInformationService(requestHeadersWithBankCodeAndBic); assertThat(ais).isNotNull(); verify(aspspRepository, times(1)).findLike(buildAspsp(BANK_CODE, BIC, null)); } @Test void getAccountInformationServicePrefersSearchingByAspspId() { Aspsp aspsp = new Aspsp(); aspsp.setAdapterId(ADAPTER_ID); when(aspspRepository.findById(ASPSP_ID)) .thenReturn(Optional.of(aspsp)); HashMap<String, String> requestHeadersMap = new HashMap<>(2); requestHeadersMap.put(X_GTW_ASPSP_ID, ASPSP_ID); requestHeadersMap.put(X_GTW_BANK_CODE, BANK_CODE); adapterServiceLoader.getAccountInformationService(RequestHeaders.fromMap(requestHeadersMap)); verify(aspspRepository, times(1)).findById(ASPSP_ID); } @Test void getAccountInformationServiceThrowsIfMoreThanOneAspspFoundByBankCode() { String file = getClass().getResource("/external.adapter.config.properties").getFile(); System.setProperty("adapter.config.file.path", file); AdapterConfig.reload(); when(aspspRepository.findByBankCode(BANK_CODE)) .thenReturn(Arrays.asList(new Aspsp(), new Aspsp())); Assertions.assertThrows( AspspRegistrationNotFoundException.class, () -> adapterServiceLoader.getAccountInformationService(requestHeadersWithBankCode) ); } @Test void getAccountInformationServiceReturnFirst() { adapterServiceLoader = new AdapterServiceLoader(aspspRepository, null, null, null, true); Aspsp aspsp1 = new Aspsp(); aspsp1.setId("1"); Aspsp aspsp2 = new Aspsp(); aspsp2.setId("2"); when(aspspRepository.findByBankCode(BANK_CODE)) .thenReturn(Arrays.asList(aspsp1, aspsp2)); Aspsp aspsp = adapterServiceLoader.getAspsp(requestHeadersWithBankCode); assertThat(aspsp).isSameAs(aspsp1); } @Test void getAccountInformationServiceThrowsIfMoreThanOneAspspFoundByBic() { when(aspspRepository.findByBic(BIC)) .thenReturn(Arrays.asList(new Aspsp(), new Aspsp())); Assertions.assertThrows( AspspRegistrationNotFoundException.class, () -> adapterServiceLoader.getAccountInformationService(requestHeadersWithBic) ); } @Test void getAccountInformationServiceThrowsIfMoreThanOneAspspFoundByBankCodeAndBic() { when(aspspRepository.findLike(buildAspsp(BANK_CODE, BIC, null))) .thenReturn(Arrays.asList(new Aspsp(), new Aspsp())); Assertions.assertThrows( AspspRegistrationNotFoundException.class, () -> adapterServiceLoader.getAccountInformationService(requestHeadersWithBankCodeAndBic) ); } @Test void getAccountInformationServiceThrowsIfNotAspspIdentifyingHeadersProvided() { RequestHeaders requestHeaders = empty(); Assertions.assertThrows( AspspRegistrationNotFoundException.class, () -> adapterServiceLoader.getAccountInformationService(requestHeaders) ); } @Test void getAccountInformationServiceThrowsAdapterNotFoundException() { when(aspspRepository.findById(ASPSP_ID)) .thenReturn(Optional.of(new Aspsp())); Assertions.assertThrows(AdapterNotFoundException.class, () -> adapterServiceLoader.getAccountInformationService(requestHeadersWithAspspId) ); } @Test void getPaymentInitiationService() { Aspsp aspsp = buildAspsp(null, null, ADAPTER_ID); when(aspspRepository.findById(anyString())) .thenReturn(Optional.of(aspsp)); PaymentInitiationService actualService = adapterServiceLoader.getPaymentInitiationService(requestHeadersWithAspspId); verify(aspspRepository, times(1)).findById(anyString()); assertThat(actualService).isInstanceOf(TestPaymentInitiationService.class); } @Test void getOauth2Service() { Aspsp aspsp = buildAspsp(null, null, ADAPTER_ID); when(aspspRepository.findById(anyString())) .thenReturn(Optional.of(aspsp)); Oauth2Service actualService = adapterServiceLoader.getOauth2Service(requestHeadersWithAspspId); verify(aspspRepository, times(1)).findById(anyString()); assertThat(actualService).isInstanceOf(TestOauth2Service.class); } @Test void getDownloadService() { Aspsp aspsp = buildAspsp(null, null, ADAPTER_ID); when(aspspRepository.findById(anyString())) .thenReturn(Optional.of(aspsp)); DownloadService actualService = adapterServiceLoader.getDownloadService(requestHeadersWithAspspId); verify(aspspRepository, times(1)).findById(anyString()); assertThat(actualService).isInstanceOf(TestDownloadService.class); } @Test void getEmbeddedPreAuthorisationService() { Aspsp aspsp = buildAspsp(null, null, ADAPTER_ID); when(aspspRepository.findById(anyString())) .thenReturn(Optional.of(aspsp)); EmbeddedPreAuthorisationService actualService = adapterServiceLoader.getEmbeddedPreAuthorisationService(requestHeadersWithAspspId); verify(aspspRepository, times(1)).findById(anyString()); assertThat(actualService).isInstanceOf(TestEmbeddedPreAuthorisationService.class); } private Aspsp buildAspsp(String bankCode, String bic, String adapterId) { Aspsp aspsp = new Aspsp(); aspsp.setBankCode(bankCode); aspsp.setBic(bic); aspsp.setAdapterId(adapterId); return aspsp; } }
13,014
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
TestEmbeddedPreAuthorisationService.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/test/java/de/adorsys/xs2a/adapter/serviceloader/TestEmbeddedPreAuthorisationService.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.EmbeddedPreAuthorisationService; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.model.EmbeddedPreAuthorisationRequest; import de.adorsys.xs2a.adapter.api.model.TokenResponse; public class TestEmbeddedPreAuthorisationService implements EmbeddedPreAuthorisationService { @Override public TokenResponse getToken(EmbeddedPreAuthorisationRequest request, RequestHeaders requestHeaders) { return null; } }
1,373
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AccountInformationServiceImplTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/test/java/de/adorsys/xs2a/adapter/serviceloader/AccountInformationServiceImplTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.*; import de.adorsys.xs2a.adapter.api.model.*; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import java.util.Collections; import java.util.HashMap; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Mockito.*; @ExtendWith(MockitoExtension.class) class AccountInformationServiceImplTest { private static final int HTTP_CODE_200 = 200; private static final RequestHeaders headers = RequestHeaders.fromMap(new HashMap<>()); private static final RequestParams parameters = RequestParams.empty(); private static final String CONSENT_ID = "consentId"; private static final String AUTHORISATION_ID = "authorisationId"; private static final String ACCOUNT_ID = "accountId"; private static final String TRANSACTION_ID = "transactionId"; @InjectMocks private AccountInformationServiceImpl service; @Mock private AccountInformationService accountInformationService; @Mock private AdapterServiceLoader adapterServiceLoader; @BeforeEach void setUp() { when(adapterServiceLoader.getAccountInformationService(any(RequestHeaders.class))) .thenReturn(accountInformationService); } @Test void createConsent() { Response<ConsentsResponse201> response = new Response<>(HTTP_CODE_200, new ConsentsResponse201(), ResponseHeaders.fromMap(Collections.emptyMap())); when(accountInformationService.createConsent(any(), any(), any())).thenReturn(response); Response<ConsentsResponse201> consentResponse = service.createConsent(RequestHeaders.fromMap(Collections.singletonMap(RequestHeaders.X_GTW_ASPSP_ID, "BIC")), RequestParams.empty(), new Consents()); verify(accountInformationService, times(1)).createConsent(any(), any(), any()); assertThat(consentResponse).isEqualTo(response); } @Test void getConsentInformation() { service.getConsentInformation(CONSENT_ID, headers, parameters); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .getConsentInformation(anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void deleteConsent() { service.deleteConsent(CONSENT_ID, headers, parameters); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .deleteConsent(anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void getConsentStatus() { service.getConsentStatus(CONSENT_ID, headers, parameters); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .getConsentStatus(anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void getConsentAuthorisation() { service.getConsentAuthorisation(CONSENT_ID, headers, parameters); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .getConsentAuthorisation(anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void startConsentAuthorisation() { service.startConsentAuthorisation(CONSENT_ID, headers, parameters); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .startConsentAuthorisation(anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void startConsentAuthorisation_updatePsuAuthentication() { service.startConsentAuthorisation(CONSENT_ID, headers, parameters, new UpdatePsuAuthentication()); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .startConsentAuthorisation(anyString(), any(RequestHeaders.class), any(RequestParams.class), any(UpdatePsuAuthentication.class)); } @Test void updateConsentsPsuData_selectPsuAuthenticationMethod() { service.updateConsentsPsuData(CONSENT_ID, AUTHORISATION_ID, headers, parameters, new SelectPsuAuthenticationMethod()); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .updateConsentsPsuData(anyString(), anyString(), any(RequestHeaders.class), any(RequestParams.class), any(SelectPsuAuthenticationMethod.class)); } @Test void updateConsentsPsuData_transactionAuthorisation() { service.updateConsentsPsuData(CONSENT_ID, AUTHORISATION_ID, headers, parameters, new TransactionAuthorisation()); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .updateConsentsPsuData(anyString(), anyString(), any(RequestHeaders.class), any(RequestParams.class), any(TransactionAuthorisation.class)); } @Test void updateConsentsPsuData_updatePsuAuthentication() { service.updateConsentsPsuData(CONSENT_ID, AUTHORISATION_ID, headers, parameters, new UpdatePsuAuthentication()); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .updateConsentsPsuData(anyString(), anyString(), any(RequestHeaders.class), any(RequestParams.class), any(UpdatePsuAuthentication.class)); } @Test void getAccountList() { service.getAccountList(headers, parameters); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .getAccountList(any(RequestHeaders.class), any(RequestParams.class)); } @Test void readAccountDetails() { service.readAccountDetails(ACCOUNT_ID, headers, parameters); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .readAccountDetails(anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void getTransactionList() { service.getTransactionList(ACCOUNT_ID, headers, parameters); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .getTransactionList(anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void getTransactionDetails() { service.getTransactionDetails(ACCOUNT_ID, TRANSACTION_ID, headers, parameters); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .getTransactionDetails(anyString(), anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void getTransactionListAsString() { service.getTransactionListAsString(ACCOUNT_ID, headers, parameters); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .getTransactionListAsString(anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void getConsentScaStatus() { service.getConsentScaStatus(CONSENT_ID, AUTHORISATION_ID, headers, parameters); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .getConsentScaStatus(anyString(), anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void getBalances() { service.getBalances(ACCOUNT_ID, headers, parameters); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .getBalances(anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void getCardAccountList() { service.getCardAccountList(headers, parameters); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .getCardAccountList(any(RequestHeaders.class), any(RequestParams.class)); } @Test void getCardAccountDetails() { service.getCardAccountDetails(ACCOUNT_ID, headers, parameters); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .getCardAccountDetails(anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void getCardAccountBalances() { service.getCardAccountBalances(ACCOUNT_ID, headers, parameters); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .getCardAccountBalances(anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void getCardAccountTransactionList() { service.getCardAccountTransactionList(ACCOUNT_ID, headers, parameters); verify(adapterServiceLoader, times(1)) .getAccountInformationService(any(RequestHeaders.class)); verify(accountInformationService, times(1)) .getCardAccountTransactionList(anyString(), any(RequestHeaders.class), any(RequestParams.class)); } }
11,649
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
TestServiceProvider.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/test/java/de/adorsys/xs2a/adapter/serviceloader/TestServiceProvider.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.*; import de.adorsys.xs2a.adapter.api.http.HttpClientFactory; import de.adorsys.xs2a.adapter.api.link.LinksRewriter; import de.adorsys.xs2a.adapter.api.model.Aspsp; import de.adorsys.xs2a.adapter.impl.AbstractAdapterServiceProvider; public class TestServiceProvider extends AbstractAdapterServiceProvider implements Oauth2ServiceProvider, DownloadServiceProvider, EmbeddedPreAuthorisationServiceProvider { @Override public AccountInformationService getAccountInformationService(Aspsp aspsp, HttpClientFactory httpClientFactory, LinksRewriter linksRewriter) { return new TestAccountInformationService(); } @Override public PaymentInitiationService getPaymentInitiationService(Aspsp aspsp, HttpClientFactory httpClientFactory, LinksRewriter linksRewriter) { return new TestPaymentInitiationService(); } @Override public Oauth2Service getOauth2Service(Aspsp aspsp, HttpClientFactory httpClientFactory) { return new TestOauth2Service(); } @Override public DownloadService getDownloadService(String baseUrl, HttpClientFactory httpClientFactory) { return new TestDownloadService(); } @Override public String getAdapterId() { return "test-adapter"; } @Override public EmbeddedPreAuthorisationService getEmbeddedPreAuthorisationService(Aspsp aspsp, HttpClientFactory httpClientFactory) { return new TestEmbeddedPreAuthorisationService(); } }
2,804
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
PaymentInitiationServiceImplTest.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/test/java/de/adorsys/xs2a/adapter/serviceloader/PaymentInitiationServiceImplTest.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.PaymentInitiationService; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.RequestParams; import de.adorsys.xs2a.adapter.api.model.*; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import java.util.HashMap; import static org.mockito.Mockito.*; @ExtendWith(MockitoExtension.class) class PaymentInitiationServiceImplTest { private static final PaymentService PAYMENT_SERVICE = PaymentService.PAYMENTS; private static final PaymentProduct PAYMENT_PRODUCT = PaymentProduct.SEPA_CREDIT_TRANSFERS; private static final RequestHeaders headers = RequestHeaders.fromMap(new HashMap<>()); private static final RequestParams params = RequestParams.empty(); private static final String PAYMENT_ID = "paymentId"; private static final String AUTHORISATION_ID = "authorisationId"; @InjectMocks private PaymentInitiationServiceImpl service; @Mock private AdapterServiceLoader serviceLoader; @Mock private PaymentInitiationService paymentInitiationService; @BeforeEach void setUp() { when(serviceLoader.getPaymentInitiationService(any(RequestHeaders.class))) .thenReturn(paymentInitiationService); } @Test void initiatePayment() { service.initiatePayment(PAYMENT_SERVICE, PAYMENT_PRODUCT, headers, params, new Object()); verify(serviceLoader, times(1)) .getPaymentInitiationService(any(RequestHeaders.class)); verify(paymentInitiationService, times(1)) .initiatePayment(eq(PAYMENT_SERVICE), eq(PAYMENT_PRODUCT), any(RequestHeaders.class), any(RequestParams.class), any()); } @Test void getSinglePaymentInformation() { service.getSinglePaymentInformation(PAYMENT_PRODUCT, PAYMENT_ID, headers, params); verify(serviceLoader, times(1)) .getPaymentInitiationService(any(RequestHeaders.class)); verify(paymentInitiationService, times(1)) .getSinglePaymentInformation(eq(PAYMENT_PRODUCT), anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void getPeriodicPaymentInformation() { service.getPeriodicPaymentInformation(PAYMENT_PRODUCT, PAYMENT_ID, headers, params); verify(serviceLoader, times(1)) .getPaymentInitiationService(any(RequestHeaders.class)); verify(paymentInitiationService, times(1)) .getPeriodicPaymentInformation(eq(PAYMENT_PRODUCT), anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void getPaymentInformationAsString() { service.getPaymentInformationAsString(PAYMENT_SERVICE, PAYMENT_PRODUCT, PAYMENT_ID, headers, params); verify(serviceLoader, times(1)) .getPaymentInitiationService(any(RequestHeaders.class)); verify(paymentInitiationService, times(1)) .getPaymentInformationAsString(eq(PAYMENT_SERVICE), eq(PAYMENT_PRODUCT), anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void getPaymentInitiationScaStatus() { service.getPaymentInitiationScaStatus(PAYMENT_SERVICE, PAYMENT_PRODUCT, PAYMENT_ID, AUTHORISATION_ID, headers, params); verify(serviceLoader, times(1)) .getPaymentInitiationService(any(RequestHeaders.class)); verify(paymentInitiationService, times(1)) .getPaymentInitiationScaStatus(eq(PAYMENT_SERVICE), eq(PAYMENT_PRODUCT), anyString(), anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void getPaymentInitiationStatus() { service.getPaymentInitiationStatus(PAYMENT_SERVICE, PAYMENT_PRODUCT, PAYMENT_ID, headers, params); verify(serviceLoader, times(1)) .getPaymentInitiationService(any(RequestHeaders.class)); verify(paymentInitiationService, times(1)) .getPaymentInitiationStatus(eq(PAYMENT_SERVICE), eq(PAYMENT_PRODUCT), anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void getPaymentInitiationStatusAsString() { service.getPaymentInitiationStatusAsString(PAYMENT_SERVICE, PAYMENT_PRODUCT, PAYMENT_ID, headers, params); verify(serviceLoader, times(1)) .getPaymentInitiationService(any(RequestHeaders.class)); verify(paymentInitiationService, times(1)) .getPaymentInitiationStatusAsString(eq(PAYMENT_SERVICE), eq(PAYMENT_PRODUCT), anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void getPaymentInitiationAuthorisation() { service.getPaymentInitiationAuthorisation(PAYMENT_SERVICE, PAYMENT_PRODUCT, PAYMENT_ID, headers, params); verify(serviceLoader, times(1)) .getPaymentInitiationService(any(RequestHeaders.class)); verify(paymentInitiationService, times(1)) .getPaymentInitiationAuthorisation(eq(PAYMENT_SERVICE), eq(PAYMENT_PRODUCT), anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void startPaymentAuthorisation() { service.startPaymentAuthorisation(PAYMENT_SERVICE, PAYMENT_PRODUCT, PAYMENT_ID, headers, params); verify(serviceLoader, times(1)) .getPaymentInitiationService(any(RequestHeaders.class)); verify(paymentInitiationService, times(1)) .startPaymentAuthorisation(eq(PAYMENT_SERVICE), eq(PAYMENT_PRODUCT), anyString(), any(RequestHeaders.class), any(RequestParams.class)); } @Test void startPaymentAuthorisation_updatePsuAuthentication() { service.startPaymentAuthorisation(PAYMENT_SERVICE, PAYMENT_PRODUCT, PAYMENT_ID, headers, params, new UpdatePsuAuthentication()); verify(serviceLoader, times(1)) .getPaymentInitiationService(any(RequestHeaders.class)); verify(paymentInitiationService, times(1)) .startPaymentAuthorisation(eq(PAYMENT_SERVICE), eq(PAYMENT_PRODUCT), anyString(), any(RequestHeaders.class), any(RequestParams.class), any(UpdatePsuAuthentication.class)); } @Test void updatePaymentPsuData_selectPsuAuthenticationMethod() { service.updatePaymentPsuData(PAYMENT_SERVICE, PAYMENT_PRODUCT, PAYMENT_ID, AUTHORISATION_ID, headers, params, new SelectPsuAuthenticationMethod()); verify(serviceLoader, times(1)) .getPaymentInitiationService(any(RequestHeaders.class)); verify(paymentInitiationService, times(1)) .updatePaymentPsuData(eq(PAYMENT_SERVICE), eq(PAYMENT_PRODUCT), anyString(), anyString(), any(RequestHeaders.class), any(RequestParams.class), any(SelectPsuAuthenticationMethod.class)); } @Test void updatePaymentPsuData_transactionAuthorisation() { service.updatePaymentPsuData(PAYMENT_SERVICE, PAYMENT_PRODUCT, PAYMENT_ID, AUTHORISATION_ID, headers, params, new TransactionAuthorisation()); verify(serviceLoader, times(1)) .getPaymentInitiationService(any(RequestHeaders.class)); verify(paymentInitiationService, times(1)) .updatePaymentPsuData(eq(PAYMENT_SERVICE), eq(PAYMENT_PRODUCT), anyString(), anyString(), any(RequestHeaders.class), any(RequestParams.class), any(TransactionAuthorisation.class)); } @Test void updatePaymentPsuData_updatePsuAuthentication() { service.updatePaymentPsuData(PAYMENT_SERVICE, PAYMENT_PRODUCT, PAYMENT_ID, AUTHORISATION_ID, headers, params, new UpdatePsuAuthentication()); verify(serviceLoader, times(1)) .getPaymentInitiationService(any(RequestHeaders.class)); verify(paymentInitiationService, times(1)) .updatePaymentPsuData(eq(PAYMENT_SERVICE), eq(PAYMENT_PRODUCT), anyString(), anyString(), any(RequestHeaders.class), any(RequestParams.class), any(UpdatePsuAuthentication.class)); } }
10,028
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AccountInformationServiceImpl.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/main/java/de/adorsys/xs2a/adapter/serviceloader/AccountInformationServiceImpl.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.AccountInformationService; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.RequestParams; import de.adorsys.xs2a.adapter.api.Response; import de.adorsys.xs2a.adapter.api.model.*; public class AccountInformationServiceImpl implements AccountInformationService { private final AdapterServiceLoader adapterServiceLoader; public AccountInformationServiceImpl(AdapterServiceLoader adapterServiceLoader) { this.adapterServiceLoader = adapterServiceLoader; } @Override public Response<ConsentsResponse201> createConsent(RequestHeaders requestHeaders, RequestParams requestParams, Consents consents) { return getAccountInformationService(requestHeaders) .createConsent(requestHeaders, requestParams, consents); } private AccountInformationService getAccountInformationService(RequestHeaders requestHeaders) { return adapterServiceLoader.getAccountInformationService(requestHeaders); } @Override public Response<ConsentInformationResponse200Json> getConsentInformation(String consentId, RequestHeaders requestHeaders, RequestParams requestParams) { return getAccountInformationService(requestHeaders) .getConsentInformation(consentId, requestHeaders, requestParams); } @Override public Response<Void> deleteConsent(String consentId, RequestHeaders requestHeaders, RequestParams requestParams) { return getAccountInformationService(requestHeaders) .deleteConsent(consentId, requestHeaders, requestParams); } @Override public Response<ConsentStatusResponse200> getConsentStatus(String consentId, RequestHeaders requestHeaders, RequestParams requestParams) { return getAccountInformationService(requestHeaders) .getConsentStatus(consentId, requestHeaders, requestParams); } @Override public Response<Authorisations> getConsentAuthorisation(String consentId, RequestHeaders requestHeaders, RequestParams requestParams) { return getAccountInformationService(requestHeaders) .getConsentAuthorisation(consentId, requestHeaders, requestParams); } @Override public Response<StartScaprocessResponse> startConsentAuthorisation(String consentId, RequestHeaders requestHeaders, RequestParams requestParams) { return getAccountInformationService(requestHeaders) .startConsentAuthorisation(consentId, requestHeaders, requestParams); } @Override public Response<StartScaprocessResponse> startConsentAuthorisation(String consentId, RequestHeaders requestHeaders, RequestParams requestParams, UpdatePsuAuthentication updatePsuAuthentication) { return getAccountInformationService(requestHeaders) .startConsentAuthorisation(consentId, requestHeaders, requestParams, updatePsuAuthentication); } @Override public Response<SelectPsuAuthenticationMethodResponse> updateConsentsPsuData(String consentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams, SelectPsuAuthenticationMethod selectPsuAuthenticationMethod) { return getAccountInformationService(requestHeaders) .updateConsentsPsuData(consentId, authorisationId, requestHeaders, requestParams, selectPsuAuthenticationMethod); } @Override public Response<ScaStatusResponse> updateConsentsPsuData(String consentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams, TransactionAuthorisation transactionAuthorisation) { return getAccountInformationService(requestHeaders) .updateConsentsPsuData(consentId, authorisationId, requestHeaders, requestParams, transactionAuthorisation); } @Override public Response<UpdatePsuAuthenticationResponse> updateConsentsPsuData(String consentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams, UpdatePsuAuthentication updatePsuAuthentication) { return getAccountInformationService(requestHeaders) .updateConsentsPsuData(consentId, authorisationId, requestHeaders, requestParams, updatePsuAuthentication); } @Override public Response<AccountList> getAccountList(RequestHeaders requestHeaders, RequestParams requestParams) { return getAccountInformationService(requestHeaders) .getAccountList(requestHeaders, requestParams); } @Override public Response<OK200AccountDetails> readAccountDetails(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return getAccountInformationService(requestHeaders) .readAccountDetails(accountId, requestHeaders, requestParams); } @Override public Response<TransactionsResponse200Json> getTransactionList(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return getAccountInformationService(requestHeaders) .getTransactionList(accountId, requestHeaders, requestParams); } @Override public Response<OK200TransactionDetails> getTransactionDetails(String accountId, String transactionId, RequestHeaders requestHeaders, RequestParams requestParams) { return getAccountInformationService(requestHeaders) .getTransactionDetails(accountId, transactionId, requestHeaders, requestParams); } @Override public Response<String> getTransactionListAsString(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return getAccountInformationService(requestHeaders) .getTransactionListAsString(accountId, requestHeaders, requestParams); } @Override public Response<ScaStatusResponse> getConsentScaStatus(String consentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams) { return getAccountInformationService(requestHeaders) .getConsentScaStatus(consentId, authorisationId, requestHeaders, requestParams); } @Override public Response<ReadAccountBalanceResponse200> getBalances(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return getAccountInformationService(requestHeaders) .getBalances(accountId, requestHeaders, requestParams); } @Override public Response<CardAccountList> getCardAccountList(RequestHeaders requestHeaders, RequestParams requestParams) { return getAccountInformationService(requestHeaders) .getCardAccountList(requestHeaders, requestParams); } @Override public Response<OK200CardAccountDetails> getCardAccountDetails(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return getAccountInformationService(requestHeaders) .getCardAccountDetails(accountId, requestHeaders, requestParams); } @Override public Response<ReadCardAccountBalanceResponse200> getCardAccountBalances(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return getAccountInformationService(requestHeaders) .getCardAccountBalances(accountId, requestHeaders, requestParams); } @Override public Response<CardAccountsTransactionsResponse200> getCardAccountTransactionList(String accountId, RequestHeaders requestHeaders, RequestParams requestParams) { return getAccountInformationService(requestHeaders) .getCardAccountTransactionList(accountId, requestHeaders, requestParams); } }
11,771
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdapterServiceLoader.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/main/java/de/adorsys/xs2a/adapter/serviceloader/AdapterServiceLoader.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.*; import de.adorsys.xs2a.adapter.api.exception.AdapterNotFoundException; import de.adorsys.xs2a.adapter.api.exception.AspspRegistrationNotFoundException; import de.adorsys.xs2a.adapter.api.http.HttpClientFactory; import de.adorsys.xs2a.adapter.api.link.LinksRewriter; import de.adorsys.xs2a.adapter.api.model.Aspsp; import org.slf4j.MDC; import java.util.*; import java.util.stream.StreamSupport; public class AdapterServiceLoader { private static final String EMPTY_STRING = ""; private final AspspReadOnlyRepository aspspRepository; protected final HttpClientFactory httpClientFactory; protected final LinksRewriter accountInformationLinksRewriter; protected final LinksRewriter paymentInitiationLinksRewriter; private final Map<Class<?>, ServiceLoader<? extends AdapterServiceProvider>> serviceLoaders = new HashMap<>(); protected final boolean chooseFirstFromMultipleAspsps; protected final boolean wiremockValidationEnabled; public AdapterServiceLoader(AspspReadOnlyRepository aspspRepository, HttpClientFactory httpClientFactory, LinksRewriter accountInformationLinksRewriter, LinksRewriter paymentInitiationLinksRewriter, boolean chooseFirstFromMultipleAspsps) { this(aspspRepository, httpClientFactory, accountInformationLinksRewriter, paymentInitiationLinksRewriter, chooseFirstFromMultipleAspsps, false); } public AdapterServiceLoader(AspspReadOnlyRepository aspspRepository, HttpClientFactory httpClientFactory, LinksRewriter accountInformationLinksRewriter, LinksRewriter paymentInitiationLinksRewriter, boolean chooseFirstFromMultipleAspsps, boolean wiremockValidationEnabled) { this.aspspRepository = aspspRepository; this.accountInformationLinksRewriter = accountInformationLinksRewriter; this.paymentInitiationLinksRewriter = paymentInitiationLinksRewriter; this.chooseFirstFromMultipleAspsps = chooseFirstFromMultipleAspsps; this.httpClientFactory = httpClientFactory; this.wiremockValidationEnabled = wiremockValidationEnabled; } public AccountInformationService getAccountInformationService(RequestHeaders requestHeaders) { Aspsp aspsp = getAspsp(requestHeaders); String adapterId = aspsp.getAdapterId(); AccountInformationServiceProvider provider = getServiceProvider(AccountInformationServiceProvider.class, adapterId) .orElseThrow(() -> new AdapterNotFoundException(adapterId)); provider.wiremockValidationEnabled(wiremockValidationEnabled); return provider.getAccountInformationService(aspsp, httpClientFactory, accountInformationLinksRewriter); } protected Aspsp getAspsp(RequestHeaders requestHeaders) { Optional<String> aspspId = requestHeaders.getAspspId(); Optional<String> bankCode = requestHeaders.getBankCode(); Optional<String> bic = requestHeaders.getBic(); Optional<String> iban = requestHeaders.getIban(); if (aspspId.isPresent()) { return aspspRepository.findById(aspspId.get()) .orElseThrow(() -> new AspspRegistrationNotFoundException("No ASPSP was found with id: " + aspspId.get())); } if (!bankCode.isPresent() && !bic.isPresent() && !iban.isPresent()) { throw new AspspRegistrationNotFoundException("None of " + RequestHeaders.X_GTW_ASPSP_ID + ", " + RequestHeaders.X_GTW_BIC + ", " + RequestHeaders.X_GTW_BANK_CODE + ", " + RequestHeaders.X_GTW_IBAN + " headers were provided to identify the ASPSP"); } List<Aspsp> aspsps; if (iban.isPresent()) { aspsps = aspspRepository.findByIban(iban.get()); } else if (bankCode.isPresent() && bic.isPresent()) { Aspsp aspsp = new Aspsp(); aspsp.setBankCode(bankCode.get()); aspsp.setBic(bic.get()); aspsps = aspspRepository.findLike(aspsp); } else if (bankCode.isPresent()) { aspsps = aspspRepository.findByBankCode(bankCode.get()); } else { aspsps = aspspRepository.findByBic(bic.get()); } if (aspsps.isEmpty()) { throw new AspspRegistrationNotFoundException( buildAspspNotFoundErrorMessage(bankCode.orElse(EMPTY_STRING), bic.orElse(EMPTY_STRING)) ); } else if (aspsps.size() > 1 && !chooseFirstFromMultipleAspsps) { throw new AspspRegistrationNotFoundException( buildAspspCouldNotBeIdentifiedErrorMessage(aspsps.size(), bankCode.orElse(EMPTY_STRING), bic.orElse(EMPTY_STRING)) ); } return aspsps.get(0); } public <T extends AdapterServiceProvider> Optional<T> getServiceProvider(Class<T> klass, String adapterId) { MDC.put("adapterId", adapterId); Optional<T> serviceProvider; synchronized (serviceLoaders) { serviceProvider = StreamSupport.stream(getServiceLoader(klass).spliterator(), false) .filter(provider -> provider.getAdapterId().equalsIgnoreCase(adapterId)) .findFirst(); } return serviceProvider; } @SuppressWarnings("unchecked") private <T extends AdapterServiceProvider> ServiceLoader<T> getServiceLoader(Class<T> klass) { return (ServiceLoader<T>) serviceLoaders.computeIfAbsent(klass, k -> ServiceLoader.load(klass)); } public PaymentInitiationService getPaymentInitiationService(RequestHeaders requestHeaders) { Aspsp aspsp = getAspsp(requestHeaders); String adapterId = aspsp.getAdapterId(); PaymentInitiationServiceProvider provider = getServiceProvider(PaymentInitiationServiceProvider.class, adapterId) .orElseThrow(() -> new AdapterNotFoundException(adapterId)); provider.wiremockValidationEnabled(wiremockValidationEnabled); return provider.getPaymentInitiationService(aspsp, httpClientFactory, paymentInitiationLinksRewriter); } public Oauth2Service getOauth2Service(RequestHeaders requestHeaders) { Aspsp aspsp = getAspsp(requestHeaders); String adapterId = aspsp.getAdapterId(); return getServiceProvider(Oauth2ServiceProvider.class, adapterId) .orElseThrow(() -> new AdapterNotFoundException(adapterId)) .getOauth2Service(aspsp, httpClientFactory); } public DownloadService getDownloadService(RequestHeaders requestHeaders) { Aspsp aspsp = getAspsp(requestHeaders); String adapterId = aspsp.getAdapterId(); String baseUrl = Optional.ofNullable(aspsp.getIdpUrl()).orElseGet(aspsp::getUrl); return getServiceProvider(DownloadServiceProvider.class, adapterId) .orElseThrow(() -> new AdapterNotFoundException(adapterId)) .getDownloadService(baseUrl, httpClientFactory); } public EmbeddedPreAuthorisationService getEmbeddedPreAuthorisationService(RequestHeaders requestHeaders) { Aspsp aspsp = getAspsp(requestHeaders); String adapterId = aspsp.getAdapterId(); return getServiceProvider(EmbeddedPreAuthorisationServiceProvider.class, adapterId) .orElseThrow(() -> new AdapterNotFoundException(adapterId)) .getEmbeddedPreAuthorisationService(aspsp, httpClientFactory); } private String buildAspspNotFoundErrorMessage(String bankCode, String bic) { return appendNotEmptyBankCodeAndBic(new StringBuilder("No ASPSP was found with "), bankCode, bic); } private String buildAspspCouldNotBeIdentifiedErrorMessage(int numberOfEntries, String bankCode, String bic) { return appendNotEmptyBankCodeAndBic( new StringBuilder(String.format("The ASPSP could not be identified: %s registry entries found for ", numberOfEntries)), bankCode, bic ); } private String appendNotEmptyBankCodeAndBic(StringBuilder errorMessageBuilder, String bankCode, String bic) { if (!bankCode.isEmpty() && !bic.isEmpty()) { return errorMessageBuilder.append("bank code ") .append(bankCode) .append(" and ") .append("BIC ") .append(bic) .toString(); } if (!bankCode.isEmpty()) { return errorMessageBuilder.append("bank code ") .append(bankCode) .toString(); } if (!bic.isEmpty()) { return errorMessageBuilder.append("BIC ") .append(bic) .toString(); } return EMPTY_STRING; } }
9,983
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
EmbeddedPreAuthorisationServiceImpl.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/main/java/de/adorsys/xs2a/adapter/serviceloader/EmbeddedPreAuthorisationServiceImpl.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.EmbeddedPreAuthorisationService; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.model.EmbeddedPreAuthorisationRequest; import de.adorsys.xs2a.adapter.api.model.TokenResponse; public class EmbeddedPreAuthorisationServiceImpl implements EmbeddedPreAuthorisationService { private final AdapterServiceLoader adapterServiceLoader; public EmbeddedPreAuthorisationServiceImpl(AdapterServiceLoader adapterServiceLoader) { this.adapterServiceLoader = adapterServiceLoader; } @Override public TokenResponse getToken(EmbeddedPreAuthorisationRequest request, RequestHeaders requestHeaders) { return adapterServiceLoader.getEmbeddedPreAuthorisationService(requestHeaders).getToken(request, requestHeaders); } }
1,693
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AdapterDelegatingOauth2Service.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/main/java/de/adorsys/xs2a/adapter/serviceloader/AdapterDelegatingOauth2Service.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.Oauth2Service; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.model.TokenResponse; import java.io.IOException; import java.net.URI; import java.util.Map; public class AdapterDelegatingOauth2Service implements Oauth2Service { private final AdapterServiceLoader adapterServiceLoader; public AdapterDelegatingOauth2Service(AdapterServiceLoader adapterServiceLoader) { this.adapterServiceLoader = adapterServiceLoader; } @Override public URI getAuthorizationRequestUri(Map<String, String> headers, Parameters parameters) throws IOException { return getOauth2Service(headers) .getAuthorizationRequestUri(headers, parameters); } private Oauth2Service getOauth2Service(Map<String, String> headers) { return adapterServiceLoader.getOauth2Service(RequestHeaders.fromMap(headers)); } @Override public TokenResponse getToken(Map<String, String> headers, Parameters parameters) throws IOException { return getOauth2Service(headers) .getToken(headers, parameters); } }
2,015
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
PaymentInitiationServiceImpl.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/main/java/de/adorsys/xs2a/adapter/serviceloader/PaymentInitiationServiceImpl.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.PaymentInitiationService; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.RequestParams; import de.adorsys.xs2a.adapter.api.Response; import de.adorsys.xs2a.adapter.api.model.*; public class PaymentInitiationServiceImpl implements PaymentInitiationService { private final AdapterServiceLoader adapterServiceLoader; public PaymentInitiationServiceImpl(AdapterServiceLoader adapterServiceLoader) { this.adapterServiceLoader = adapterServiceLoader; } @Override public Response<PaymentInitationRequestResponse201> initiatePayment(PaymentService paymentService, PaymentProduct paymentProduct, RequestHeaders requestHeaders, RequestParams requestParams, Object body) { return getPaymentInitiationService(requestHeaders) .initiatePayment(paymentService, paymentProduct, requestHeaders, requestParams, body); } private PaymentInitiationService getPaymentInitiationService(RequestHeaders requestHeaders) { return adapterServiceLoader.getPaymentInitiationService(requestHeaders); } @Override public Response<PaymentInitiationWithStatusResponse> getSinglePaymentInformation(PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return getPaymentInitiationService(requestHeaders) .getSinglePaymentInformation(paymentProduct, paymentId, requestHeaders, requestParams); } @Override public Response<PeriodicPaymentInitiationWithStatusResponse> getPeriodicPaymentInformation(PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return getPaymentInitiationService(requestHeaders) .getPeriodicPaymentInformation(paymentProduct, paymentId, requestHeaders, requestParams); } @Override public Response<PeriodicPaymentInitiationMultipartBody> getPeriodicPain001PaymentInformation(PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return getPaymentInitiationService(requestHeaders) .getPeriodicPain001PaymentInformation(paymentProduct, paymentId, requestHeaders, requestParams); } @Override public Response<String> getPaymentInformationAsString(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return getPaymentInitiationService(requestHeaders) .getPaymentInformationAsString(paymentService, paymentProduct, paymentId, requestHeaders, requestParams); } @Override public Response<ScaStatusResponse> getPaymentInitiationScaStatus(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams) { return getPaymentInitiationService(requestHeaders) .getPaymentInitiationScaStatus(paymentService, paymentProduct, paymentId, authorisationId, requestHeaders, requestParams); } @Override public Response<PaymentInitiationStatusResponse200Json> getPaymentInitiationStatus(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return getPaymentInitiationService(requestHeaders) .getPaymentInitiationStatus(paymentService, paymentProduct, paymentId, requestHeaders, requestParams); } @Override public Response<String> getPaymentInitiationStatusAsString(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return getPaymentInitiationService(requestHeaders) .getPaymentInitiationStatusAsString(paymentService, paymentProduct, paymentId, requestHeaders, requestParams); } @Override public Response<Authorisations> getPaymentInitiationAuthorisation(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return getPaymentInitiationService(requestHeaders) .getPaymentInitiationAuthorisation(paymentService, paymentProduct, paymentId, requestHeaders, requestParams); } @Override public Response<StartScaprocessResponse> startPaymentAuthorisation(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams) { return getPaymentInitiationService(requestHeaders) .startPaymentAuthorisation(paymentService, paymentProduct, paymentId, requestHeaders, requestParams); } @Override public Response<StartScaprocessResponse> startPaymentAuthorisation(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, RequestHeaders requestHeaders, RequestParams requestParams, UpdatePsuAuthentication updatePsuAuthentication) { return getPaymentInitiationService(requestHeaders) .startPaymentAuthorisation(paymentService, paymentProduct, paymentId, requestHeaders, requestParams, updatePsuAuthentication); } @Override public Response<SelectPsuAuthenticationMethodResponse> updatePaymentPsuData(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams, SelectPsuAuthenticationMethod body) { return getPaymentInitiationService(requestHeaders) .updatePaymentPsuData(paymentService, paymentProduct, paymentId, authorisationId, requestHeaders, requestParams, body); } @Override public Response<ScaStatusResponse> updatePaymentPsuData(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams, TransactionAuthorisation body) { return getPaymentInitiationService(requestHeaders) .updatePaymentPsuData(paymentService, paymentProduct, paymentId, authorisationId, requestHeaders, requestParams, body); } @Override public Response<UpdatePsuAuthenticationResponse> updatePaymentPsuData(PaymentService paymentService, PaymentProduct paymentProduct, String paymentId, String authorisationId, RequestHeaders requestHeaders, RequestParams requestParams, UpdatePsuAuthentication body) { return getPaymentInitiationService(requestHeaders) .updatePaymentPsuData(paymentService, paymentProduct, paymentId, authorisationId, requestHeaders, requestParams, body); } }
12,618
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
DownloadServiceImpl.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-service-loader/src/main/java/de/adorsys/xs2a/adapter/serviceloader/DownloadServiceImpl.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.serviceloader; import de.adorsys.xs2a.adapter.api.DownloadService; import de.adorsys.xs2a.adapter.api.RequestHeaders; import de.adorsys.xs2a.adapter.api.Response; public class DownloadServiceImpl implements DownloadService { private final AdapterServiceLoader adapterServiceLoader; public DownloadServiceImpl(AdapterServiceLoader adapterServiceLoader) { this.adapterServiceLoader = adapterServiceLoader; } @Override public Response<byte[]> download(String downloadUrl, RequestHeaders requestHeaders) { return adapterServiceLoader.getDownloadService(requestHeaders) .download(downloadUrl, requestHeaders); } }
1,534
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AspspSearchApi.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-rest-api/src/main/java/de/adorsys/xs2a/adapter/rest/api/AspspSearchApi.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.rest.api; import de.adorsys.xs2a.adapter.rest.api.model.AspspTO; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import java.util.List; public interface AspspSearchApi { String V1_APSPS = "/v1/aspsps"; String V1_APSPS_BY_ID = V1_APSPS + "/{aspsp-id}"; @RequestMapping(value = V1_APSPS, method = RequestMethod.GET) ResponseEntity<List<AspspTO>> getAspsps(@RequestParam(value = "name", required = false) String name, @RequestParam(value = "bic", required = false) String bic, @RequestParam(value = "bankCode", required = false) String bankCode, @RequestParam(value = "iban", required = false) String iban, // if present - other params ignored @RequestParam(value = "after", required = false) String after, @RequestParam(value = "size", required = false, defaultValue = "10") int size); @RequestMapping(value = V1_APSPS_BY_ID, method = RequestMethod.GET) ResponseEntity<AspspTO> getById(@PathVariable("aspsp-id") String id); }
2,283
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
EmbeddedPreAuthorisationApi.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-rest-api/src/main/java/de/adorsys/xs2a/adapter/rest/api/EmbeddedPreAuthorisationApi.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.rest.api; import de.adorsys.xs2a.adapter.rest.api.model.EmbeddedPreAuthorisationRequestTO; import de.adorsys.xs2a.adapter.rest.api.model.TokenResponseTO; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestHeader; import java.util.Map; public interface EmbeddedPreAuthorisationApi { @PostMapping(value = "/v1/embedded-pre-auth/token", consumes = "application/json") TokenResponseTO getToken(@RequestHeader Map<String, String> headers, @RequestBody EmbeddedPreAuthorisationRequestTO request); }
1,491
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
Oauth2Api.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-rest-api/src/main/java/de/adorsys/xs2a/adapter/rest/api/Oauth2Api.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.rest.api; import de.adorsys.xs2a.adapter.api.model.HrefType; import de.adorsys.xs2a.adapter.rest.api.model.TokenResponseTO; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestParam; import java.io.IOException; import java.util.Map; public interface Oauth2Api { String AUTHORIZATION_REQUEST_URI = "/oauth2/authorization-request-uri"; @GetMapping(AUTHORIZATION_REQUEST_URI) HrefType getAuthorizationUrl(@RequestHeader Map<String, String> headers, @RequestParam Map<String, String> parameters) throws IOException; @PostMapping("/oauth2/token") TokenResponseTO getToken(@RequestHeader Map<String, String> headers, @RequestParam Map<String, String> parameters) throws IOException; }
1,812
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
EmbeddedPreAuthorisationRequestTO.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-rest-api/src/main/java/de/adorsys/xs2a/adapter/rest/api/model/EmbeddedPreAuthorisationRequestTO.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.rest.api.model; public class EmbeddedPreAuthorisationRequestTO { private String username; private String password; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
1,296
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
TokenResponseTO.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-rest-api/src/main/java/de/adorsys/xs2a/adapter/rest/api/model/TokenResponseTO.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.rest.api.model; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Objects; public class TokenResponseTO { @JsonProperty("access_token") private String accessToken; @JsonProperty("token_type") private String tokenType; @JsonProperty("expires_in") private Long expiresInSeconds; @JsonProperty("refresh_token") private String refreshToken; private String scope; public String getAccessToken() { return accessToken; } public void setAccessToken(String accessToken) { this.accessToken = accessToken; } public String getTokenType() { return tokenType; } public void setTokenType(String tokenType) { this.tokenType = tokenType; } public Long getExpiresInSeconds() { return expiresInSeconds; } public void setExpiresInSeconds(Long expiresInSeconds) { this.expiresInSeconds = expiresInSeconds; } public String getRefreshToken() { return refreshToken; } public void setRefreshToken(String refreshToken) { this.refreshToken = refreshToken; } public String getScope() { return scope; } public void setScope(String scope) { this.scope = scope; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TokenResponseTO that = (TokenResponseTO) o; return Objects.equals(accessToken, that.accessToken) && Objects.equals(tokenType, that.tokenType) && Objects.equals(expiresInSeconds, that.expiresInSeconds) && Objects.equals(refreshToken, that.refreshToken) && Objects.equals(scope, that.scope); } @Override public int hashCode() { return Objects.hash(accessToken, tokenType, expiresInSeconds, refreshToken, scope); } }
2,816
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AspspScaApproachTO.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-rest-api/src/main/java/de/adorsys/xs2a/adapter/rest/api/model/AspspScaApproachTO.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.rest.api.model; public enum AspspScaApproachTO { EMBEDDED, REDIRECT, DECOUPLED, OAUTH }
967
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AspspTO.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-rest-api/src/main/java/de/adorsys/xs2a/adapter/rest/api/model/AspspTO.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.rest.api.model; import java.util.List; import java.util.Objects; public class AspspTO { private String id; private String name; private String bic; private String bankCode; private String url; private String adapterId; private String idpUrl; private List<AspspScaApproachTO> scaApproaches; private String paginationId; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getBic() { return bic; } public void setBic(String bic) { this.bic = bic; } public String getBankCode() { return bankCode; } public void setBankCode(String bankCode) { this.bankCode = bankCode; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getAdapterId() { return adapterId; } public void setAdapterId(String adapterId) { this.adapterId = adapterId; } public String getIdpUrl() { return idpUrl; } public void setIdpUrl(String idpUrl) { this.idpUrl = idpUrl; } public List<AspspScaApproachTO> getScaApproaches() { return scaApproaches; } public void setScaApproaches(List<AspspScaApproachTO> scaApproaches) { this.scaApproaches = scaApproaches; } public String getPaginationId() { return paginationId; } public void setPaginationId(String paginationId) { this.paginationId = paginationId; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AspspTO aspspTO = (AspspTO) o; return Objects.equals(id, aspspTO.id) && Objects.equals(name, aspspTO.name) && Objects.equals(bic, aspspTO.bic) && Objects.equals(bankCode, aspspTO.bankCode) && Objects.equals(url, aspspTO.url) && Objects.equals(adapterId, aspspTO.adapterId) && Objects.equals(idpUrl, aspspTO.idpUrl) && Objects.equals(scaApproaches, aspspTO.scaApproaches) && Objects.equals(paginationId, aspspTO.paginationId); } @Override public int hashCode() { return Objects.hash(id, name, bic, bankCode, url, adapterId, idpUrl, scaApproaches, paginationId); } @Override public String toString() { return "AspspTO{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", bic='" + bic + '\'' + ", bankCode='" + bankCode + '\'' + ", url='" + url + '\'' + ", adapterId='" + adapterId + '\'' + ", idpUrl='" + idpUrl + '\'' + ", scaApproaches=" + scaApproaches + ", paginationId='" + paginationId + '\'' + '}'; } }
4,039
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
Consents.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/Consents.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import javax.annotation.Generated; import java.time.LocalDate; import java.util.Objects; @Generated("xs2a-adapter-codegen") public class Consents { private AccountAccess access; private Boolean recurringIndicator; private LocalDate validUntil; private Integer frequencyPerDay; private Boolean combinedServiceIndicator; public AccountAccess getAccess() { return access; } public void setAccess(AccountAccess access) { this.access = access; } public Boolean getRecurringIndicator() { return recurringIndicator; } public void setRecurringIndicator(Boolean recurringIndicator) { this.recurringIndicator = recurringIndicator; } public LocalDate getValidUntil() { return validUntil; } public void setValidUntil(LocalDate validUntil) { this.validUntil = validUntil; } public Integer getFrequencyPerDay() { return frequencyPerDay; } public void setFrequencyPerDay(Integer frequencyPerDay) { this.frequencyPerDay = frequencyPerDay; } public Boolean getCombinedServiceIndicator() { return combinedServiceIndicator; } public void setCombinedServiceIndicator(Boolean combinedServiceIndicator) { this.combinedServiceIndicator = combinedServiceIndicator; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Consents that = (Consents) o; return Objects.equals(access, that.access) && Objects.equals(recurringIndicator, that.recurringIndicator) && Objects.equals(validUntil, that.validUntil) && Objects.equals(frequencyPerDay, that.frequencyPerDay) && Objects.equals(combinedServiceIndicator, that.combinedServiceIndicator); } @Override public int hashCode() { return Objects.hash(access, recurringIndicator, validUntil, frequencyPerDay, combinedServiceIndicator); } }
2,965
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
CardAccountsTransactionsResponse200.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/CardAccountsTransactionsResponse200.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.Generated; import java.util.List; import java.util.Map; import java.util.Objects; @Generated("xs2a-adapter-codegen") public class CardAccountsTransactionsResponse200 { private AccountReference cardAccount; private Boolean debitAccounting; private CardAccountReport cardTransactions; private List<Balance> balances; @JsonProperty("_links") private Map<String, HrefType> links; public AccountReference getCardAccount() { return cardAccount; } public void setCardAccount(AccountReference cardAccount) { this.cardAccount = cardAccount; } public Boolean getDebitAccounting() { return debitAccounting; } public void setDebitAccounting(Boolean debitAccounting) { this.debitAccounting = debitAccounting; } public CardAccountReport getCardTransactions() { return cardTransactions; } public void setCardTransactions(CardAccountReport cardTransactions) { this.cardTransactions = cardTransactions; } public List<Balance> getBalances() { return balances; } public void setBalances(List<Balance> balances) { this.balances = balances; } public Map<String, HrefType> getLinks() { return links; } public void setLinks(Map<String, HrefType> links) { this.links = links; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CardAccountsTransactionsResponse200 that = (CardAccountsTransactionsResponse200) o; return Objects.equals(cardAccount, that.cardAccount) && Objects.equals(debitAccounting, that.debitAccounting) && Objects.equals(cardTransactions, that.cardTransactions) && Objects.equals(balances, that.balances) && Objects.equals(links, that.links); } @Override public int hashCode() { return Objects.hash(cardAccount, debitAccounting, cardTransactions, balances, links); } }
3,059
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AccountAccess.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/AccountAccess.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import javax.annotation.Generated; import java.util.List; import java.util.Objects; @Generated("xs2a-adapter-codegen") public class AccountAccess { private List<AccountReference> accounts; private List<AccountReference> balances; private List<AccountReference> transactions; private AdditionalInformationAccess additionalInformation; private AvailableAccounts availableAccounts; private AvailableAccountsWithBalance availableAccountsWithBalance; private AllPsd2 allPsd2; private List<String> restrictedTo; public List<AccountReference> getAccounts() { return accounts; } public void setAccounts(List<AccountReference> accounts) { this.accounts = accounts; } public List<AccountReference> getBalances() { return balances; } public void setBalances(List<AccountReference> balances) { this.balances = balances; } public List<AccountReference> getTransactions() { return transactions; } public void setTransactions(List<AccountReference> transactions) { this.transactions = transactions; } public AdditionalInformationAccess getAdditionalInformation() { return additionalInformation; } public void setAdditionalInformation(AdditionalInformationAccess additionalInformation) { this.additionalInformation = additionalInformation; } public AvailableAccounts getAvailableAccounts() { return availableAccounts; } public void setAvailableAccounts(AvailableAccounts availableAccounts) { this.availableAccounts = availableAccounts; } public AvailableAccountsWithBalance getAvailableAccountsWithBalance() { return availableAccountsWithBalance; } public void setAvailableAccountsWithBalance( AvailableAccountsWithBalance availableAccountsWithBalance) { this.availableAccountsWithBalance = availableAccountsWithBalance; } public AllPsd2 getAllPsd2() { return allPsd2; } public void setAllPsd2(AllPsd2 allPsd2) { this.allPsd2 = allPsd2; } public List<String> getRestrictedTo() { return restrictedTo; } public void setRestrictedTo(List<String> restrictedTo) { this.restrictedTo = restrictedTo; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AccountAccess that = (AccountAccess) o; return Objects.equals(accounts, that.accounts) && Objects.equals(balances, that.balances) && Objects.equals(transactions, that.transactions) && Objects.equals(additionalInformation, that.additionalInformation) && Objects.equals(availableAccounts, that.availableAccounts) && Objects.equals(availableAccountsWithBalance, that.availableAccountsWithBalance) && Objects.equals(allPsd2, that.allPsd2) && Objects.equals(restrictedTo, that.restrictedTo); } @Override public int hashCode() { return Objects.hash(accounts, balances, transactions, additionalInformation, availableAccounts, availableAccountsWithBalance, allPsd2, restrictedTo); } public enum AvailableAccounts { ALLACCOUNTS("allAccounts"), ALLACCOUNTSWITHOWNERNAME("allAccountsWithOwnerName"); private String value; AvailableAccounts(String value) { this.value = value; } @JsonCreator public static AvailableAccounts fromValue(String value) { for (AvailableAccounts e : AvailableAccounts.values()) { if (e.value.equals(value)) { return e; } } return null; } @Override @JsonValue public String toString() { return value; } } public enum AvailableAccountsWithBalance { ALLACCOUNTS("allAccounts"), ALLACCOUNTSWITHOWNERNAME("allAccountsWithOwnerName"); private String value; AvailableAccountsWithBalance(String value) { this.value = value; } @JsonCreator public static AvailableAccountsWithBalance fromValue(String value) { for (AvailableAccountsWithBalance e : AvailableAccountsWithBalance.values()) { if (e.value.equals(value)) { return e; } } return null; } @Override @JsonValue public String toString() { return value; } } public enum AllPsd2 { ALLACCOUNTS("allAccounts"), ALLACCOUNTSWITHOWNERNAME("allAccountsWithOwnerName"); private String value; AllPsd2(String value) { this.value = value; } @JsonCreator public static AllPsd2 fromValue(String value) { for (AllPsd2 e : AllPsd2.values()) { if (e.value.equals(value)) { return e; } } return null; } @Override @JsonValue public String toString() { return value; } } }
6,323
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
DayOfExecution.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/DayOfExecution.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import javax.annotation.Generated; @Generated("xs2a-adapter-codegen") public enum DayOfExecution { _1("1"), _2("2"), _3("3"), _4("4"), _5("5"), _6("6"), _7("7"), _8("8"), _9("9"), _10("10"), _11("11"), _12("12"), _13("13"), _14("14"), _15("15"), _16("16"), _17("17"), _18("18"), _19("19"), _20("20"), _21("21"), _22("22"), _23("23"), _24("24"), _25("25"), _26("26"), _27("27"), _28("28"), _29("29"), _30("30"), _31("31"); private String value; DayOfExecution(String value) { this.value = value; } @JsonCreator public static DayOfExecution fromValue(String value) { for (DayOfExecution e : DayOfExecution.values()) { if (e.value.equals(value)) { return e; } } return null; } @Override @JsonValue public String toString() { return value; } }
1,998
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AuthenticationObject.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/AuthenticationObject.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import javax.annotation.Generated; import java.util.Objects; @Generated("xs2a-adapter-codegen") public class AuthenticationObject { private String authenticationType; private String authenticationVersion; private String authenticationMethodId; private String name; private String explanation; public String getAuthenticationType() { return authenticationType; } public void setAuthenticationType(String authenticationType) { this.authenticationType = authenticationType; } public String getAuthenticationVersion() { return authenticationVersion; } public void setAuthenticationVersion(String authenticationVersion) { this.authenticationVersion = authenticationVersion; } public String getAuthenticationMethodId() { return authenticationMethodId; } public void setAuthenticationMethodId(String authenticationMethodId) { this.authenticationMethodId = authenticationMethodId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getExplanation() { return explanation; } public void setExplanation(String explanation) { this.explanation = explanation; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AuthenticationObject that = (AuthenticationObject) o; return Objects.equals(authenticationType, that.authenticationType) && Objects.equals(authenticationVersion, that.authenticationVersion) && Objects.equals(authenticationMethodId, that.authenticationMethodId) && Objects.equals(name, that.name) && Objects.equals(explanation, that.explanation); } @Override public int hashCode() { return Objects.hash(authenticationType, authenticationVersion, authenticationMethodId, name, explanation); } }
2,964
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AccountStatus.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/AccountStatus.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import javax.annotation.Generated; @Generated("xs2a-adapter-codegen") public enum AccountStatus { ENABLED("enabled"), DELETED("deleted"), BLOCKED("blocked"); private String value; AccountStatus(String value) { this.value = value; } @JsonCreator public static AccountStatus fromValue(String value) { for (AccountStatus e : AccountStatus.values()) { if (e.value.equals(value)) { return e; } } return null; } @Override @JsonValue public String toString() { return value; } }
1,590
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AccountList.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/AccountList.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import javax.annotation.Generated; import java.util.List; import java.util.Objects; @Generated("xs2a-adapter-codegen") public class AccountList { private List<AccountDetails> accounts; public List<AccountDetails> getAccounts() { return accounts; } public void setAccounts(List<AccountDetails> accounts) { this.accounts = accounts; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AccountList that = (AccountList) o; return Objects.equals(accounts, that.accounts); } @Override public int hashCode() { return Objects.hash(accounts); } }
1,598
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
PaymentInitiationWithStatusResponse.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/PaymentInitiationWithStatusResponse.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import javax.annotation.Generated; import java.time.LocalDate; import java.util.List; import java.util.Objects; @Generated("xs2a-adapter-codegen") public class PaymentInitiationWithStatusResponse { private String endToEndIdentification; private String instructionIdentification; private String debtorName; private AccountReference debtorAccount; private String ultimateDebtor; private Amount instructedAmount; private AccountReference creditorAccount; private String creditorAgent; private String creditorName; private Address creditorAddress; private String creditorId; private String ultimateCreditor; private PurposeCode purposeCode; private ChargeBearer chargeBearer; private String remittanceInformationUnstructured; private String remittanceInformationStructured; private List<String> remittanceInformationStructuredArray; private LocalDate requestedExecutionDate; private TransactionStatus transactionStatus; private List<TppMessageGeneric> tppMessage; public String getEndToEndIdentification() { return endToEndIdentification; } public void setEndToEndIdentification(String endToEndIdentification) { this.endToEndIdentification = endToEndIdentification; } public String getInstructionIdentification() { return instructionIdentification; } public void setInstructionIdentification(String instructionIdentification) { this.instructionIdentification = instructionIdentification; } public String getDebtorName() { return debtorName; } public void setDebtorName(String debtorName) { this.debtorName = debtorName; } public AccountReference getDebtorAccount() { return debtorAccount; } public void setDebtorAccount(AccountReference debtorAccount) { this.debtorAccount = debtorAccount; } public String getUltimateDebtor() { return ultimateDebtor; } public void setUltimateDebtor(String ultimateDebtor) { this.ultimateDebtor = ultimateDebtor; } public Amount getInstructedAmount() { return instructedAmount; } public void setInstructedAmount(Amount instructedAmount) { this.instructedAmount = instructedAmount; } public AccountReference getCreditorAccount() { return creditorAccount; } public void setCreditorAccount(AccountReference creditorAccount) { this.creditorAccount = creditorAccount; } public String getCreditorAgent() { return creditorAgent; } public void setCreditorAgent(String creditorAgent) { this.creditorAgent = creditorAgent; } public String getCreditorName() { return creditorName; } public void setCreditorName(String creditorName) { this.creditorName = creditorName; } public Address getCreditorAddress() { return creditorAddress; } public void setCreditorAddress(Address creditorAddress) { this.creditorAddress = creditorAddress; } public String getCreditorId() { return creditorId; } public void setCreditorId(String creditorId) { this.creditorId = creditorId; } public String getUltimateCreditor() { return ultimateCreditor; } public void setUltimateCreditor(String ultimateCreditor) { this.ultimateCreditor = ultimateCreditor; } public PurposeCode getPurposeCode() { return purposeCode; } public void setPurposeCode(PurposeCode purposeCode) { this.purposeCode = purposeCode; } public ChargeBearer getChargeBearer() { return chargeBearer; } public void setChargeBearer(ChargeBearer chargeBearer) { this.chargeBearer = chargeBearer; } public String getRemittanceInformationUnstructured() { return remittanceInformationUnstructured; } public void setRemittanceInformationUnstructured(String remittanceInformationUnstructured) { this.remittanceInformationUnstructured = remittanceInformationUnstructured; } public String getRemittanceInformationStructured() { return remittanceInformationStructured; } public void setRemittanceInformationStructured(String remittanceInformationStructured) { this.remittanceInformationStructured = remittanceInformationStructured; } public List<String> getRemittanceInformationStructuredArray() { return remittanceInformationStructuredArray; } public void setRemittanceInformationStructuredArray( List<String> remittanceInformationStructuredArray) { this.remittanceInformationStructuredArray = remittanceInformationStructuredArray; } public LocalDate getRequestedExecutionDate() { return requestedExecutionDate; } public void setRequestedExecutionDate(LocalDate requestedExecutionDate) { this.requestedExecutionDate = requestedExecutionDate; } public TransactionStatus getTransactionStatus() { return transactionStatus; } public void setTransactionStatus(TransactionStatus transactionStatus) { this.transactionStatus = transactionStatus; } public List<TppMessageGeneric> getTppMessage() { return tppMessage; } public void setTppMessage(List<TppMessageGeneric> tppMessage) { this.tppMessage = tppMessage; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PaymentInitiationWithStatusResponse that = (PaymentInitiationWithStatusResponse) o; return Objects.equals(endToEndIdentification, that.endToEndIdentification) && Objects.equals(instructionIdentification, that.instructionIdentification) && Objects.equals(debtorName, that.debtorName) && Objects.equals(debtorAccount, that.debtorAccount) && Objects.equals(ultimateDebtor, that.ultimateDebtor) && Objects.equals(instructedAmount, that.instructedAmount) && Objects.equals(creditorAccount, that.creditorAccount) && Objects.equals(creditorAgent, that.creditorAgent) && Objects.equals(creditorName, that.creditorName) && Objects.equals(creditorAddress, that.creditorAddress) && Objects.equals(creditorId, that.creditorId) && Objects.equals(ultimateCreditor, that.ultimateCreditor) && Objects.equals(purposeCode, that.purposeCode) && Objects.equals(chargeBearer, that.chargeBearer) && Objects.equals(remittanceInformationUnstructured, that.remittanceInformationUnstructured) && Objects.equals(remittanceInformationStructured, that.remittanceInformationStructured) && Objects.equals(remittanceInformationStructuredArray, that.remittanceInformationStructuredArray) && Objects.equals(requestedExecutionDate, that.requestedExecutionDate) && Objects.equals(transactionStatus, that.transactionStatus) && Objects.equals(tppMessage, that.tppMessage); } @Override public int hashCode() { return Objects.hash(endToEndIdentification, instructionIdentification, debtorName, debtorAccount, ultimateDebtor, instructedAmount, creditorAccount, creditorAgent, creditorName, creditorAddress, creditorId, ultimateCreditor, purposeCode, chargeBearer, remittanceInformationUnstructured, remittanceInformationStructured, remittanceInformationStructuredArray, requestedExecutionDate, transactionStatus, tppMessage); } }
8,761
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
PsuData.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/PsuData.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import javax.annotation.Generated; import java.util.Objects; @Generated("xs2a-adapter-codegen") public class PsuData { private String password; private String encryptedPassword; private String additionalPassword; private String additionalEncryptedPassword; public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getEncryptedPassword() { return encryptedPassword; } public void setEncryptedPassword(String encryptedPassword) { this.encryptedPassword = encryptedPassword; } public String getAdditionalPassword() { return additionalPassword; } public void setAdditionalPassword(String additionalPassword) { this.additionalPassword = additionalPassword; } public String getAdditionalEncryptedPassword() { return additionalEncryptedPassword; } public void setAdditionalEncryptedPassword(String additionalEncryptedPassword) { this.additionalEncryptedPassword = additionalEncryptedPassword; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PsuData that = (PsuData) o; return Objects.equals(password, that.password) && Objects.equals(encryptedPassword, that.encryptedPassword) && Objects.equals(additionalPassword, that.additionalPassword) && Objects.equals(additionalEncryptedPassword, that.additionalEncryptedPassword); } @Override public int hashCode() { return Objects.hash(password, encryptedPassword, additionalPassword, additionalEncryptedPassword); } }
2,684
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
PaymentInitiationStatusResponse202Json.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/PaymentInitiationStatusResponse202Json.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.Generated; import java.util.List; import java.util.Map; import java.util.Objects; @Generated("xs2a-adapter-codegen") public class PaymentInitiationStatusResponse202Json { private TransactionStatus transactionStatus; private Boolean fundsAvailable; private String psuMessage; @JsonProperty("_links") private Map<String, HrefType> links; private List<TppMessageInitiationStatusResponse200> tppMessage; public TransactionStatus getTransactionStatus() { return transactionStatus; } public void setTransactionStatus(TransactionStatus transactionStatus) { this.transactionStatus = transactionStatus; } public Boolean getFundsAvailable() { return fundsAvailable; } public void setFundsAvailable(Boolean fundsAvailable) { this.fundsAvailable = fundsAvailable; } public String getPsuMessage() { return psuMessage; } public void setPsuMessage(String psuMessage) { this.psuMessage = psuMessage; } public Map<String, HrefType> getLinks() { return links; } public void setLinks(Map<String, HrefType> links) { this.links = links; } public List<TppMessageInitiationStatusResponse200> getTppMessage() { return tppMessage; } public void setTppMessage(List<TppMessageInitiationStatusResponse200> tppMessage) { this.tppMessage = tppMessage; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PaymentInitiationStatusResponse202Json that = (PaymentInitiationStatusResponse202Json) o; return Objects.equals(transactionStatus, that.transactionStatus) && Objects.equals(fundsAvailable, that.fundsAvailable) && Objects.equals(psuMessage, that.psuMessage) && Objects.equals(links, that.links) && Objects.equals(tppMessage, that.tppMessage); } @Override public int hashCode() { return Objects.hash(transactionStatus, fundsAvailable, psuMessage, links, tppMessage); } }
3,138
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
ConsentStatusResponse200.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/ConsentStatusResponse200.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import javax.annotation.Generated; import java.util.Objects; @Generated("xs2a-adapter-codegen") public class ConsentStatusResponse200 { private ConsentStatus consentStatus; private String psuMessage; public ConsentStatus getConsentStatus() { return consentStatus; } public void setConsentStatus(ConsentStatus consentStatus) { this.consentStatus = consentStatus; } public String getPsuMessage() { return psuMessage; } public void setPsuMessage(String psuMessage) { this.psuMessage = psuMessage; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ConsentStatusResponse200 that = (ConsentStatusResponse200) o; return Objects.equals(consentStatus, that.consentStatus) && Objects.equals(psuMessage, that.psuMessage); } @Override public int hashCode() { return Objects.hash(consentStatus, psuMessage); } }
1,924
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
AuthorisationConfirmationResponse.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/AuthorisationConfirmationResponse.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.Generated; import java.util.Map; import java.util.Objects; @Generated("xs2a-adapter-codegen") public class AuthorisationConfirmationResponse { private ScaStatusAuthorisationConfirmation scaStatus; @JsonProperty("_links") private Map<String, HrefType> links; private String psuMessage; public ScaStatusAuthorisationConfirmation getScaStatus() { return scaStatus; } public void setScaStatus(ScaStatusAuthorisationConfirmation scaStatus) { this.scaStatus = scaStatus; } public Map<String, HrefType> getLinks() { return links; } public void setLinks(Map<String, HrefType> links) { this.links = links; } public String getPsuMessage() { return psuMessage; } public void setPsuMessage(String psuMessage) { this.psuMessage = psuMessage; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AuthorisationConfirmationResponse that = (AuthorisationConfirmationResponse) o; return Objects.equals(scaStatus, that.scaStatus) && Objects.equals(links, that.links) && Objects.equals(psuMessage, that.psuMessage); } @Override public int hashCode() { return Objects.hash(scaStatus, links, psuMessage); } }
2,355
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
CardTransaction.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/CardTransaction.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import javax.annotation.Generated; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.List; import java.util.Objects; @Generated("xs2a-adapter-codegen") public class CardTransaction { private String cardTransactionId; private String terminalId; private LocalDate transactionDate; private OffsetDateTime acceptorTransactionDateTime; private LocalDate bookingDate; private Amount transactionAmount; private List<ReportExchangeRate> currencyExchange; private Amount originalAmount; private Amount markupFee; private String markupFeePercentage; private String cardAcceptorId; private Address cardAcceptorAddress; private String cardAcceptorPhone; private String merchantCategoryCode; private String maskedPAN; private String transactionDetails; private Boolean invoiced; private String proprietaryBankTransactionCode; public String getCardTransactionId() { return cardTransactionId; } public void setCardTransactionId(String cardTransactionId) { this.cardTransactionId = cardTransactionId; } public String getTerminalId() { return terminalId; } public void setTerminalId(String terminalId) { this.terminalId = terminalId; } public LocalDate getTransactionDate() { return transactionDate; } public void setTransactionDate(LocalDate transactionDate) { this.transactionDate = transactionDate; } public OffsetDateTime getAcceptorTransactionDateTime() { return acceptorTransactionDateTime; } public void setAcceptorTransactionDateTime(OffsetDateTime acceptorTransactionDateTime) { this.acceptorTransactionDateTime = acceptorTransactionDateTime; } public LocalDate getBookingDate() { return bookingDate; } public void setBookingDate(LocalDate bookingDate) { this.bookingDate = bookingDate; } public Amount getTransactionAmount() { return transactionAmount; } public void setTransactionAmount(Amount transactionAmount) { this.transactionAmount = transactionAmount; } public List<ReportExchangeRate> getCurrencyExchange() { return currencyExchange; } public void setCurrencyExchange(List<ReportExchangeRate> currencyExchange) { this.currencyExchange = currencyExchange; } public Amount getOriginalAmount() { return originalAmount; } public void setOriginalAmount(Amount originalAmount) { this.originalAmount = originalAmount; } public Amount getMarkupFee() { return markupFee; } public void setMarkupFee(Amount markupFee) { this.markupFee = markupFee; } public String getMarkupFeePercentage() { return markupFeePercentage; } public void setMarkupFeePercentage(String markupFeePercentage) { this.markupFeePercentage = markupFeePercentage; } public String getCardAcceptorId() { return cardAcceptorId; } public void setCardAcceptorId(String cardAcceptorId) { this.cardAcceptorId = cardAcceptorId; } public Address getCardAcceptorAddress() { return cardAcceptorAddress; } public void setCardAcceptorAddress(Address cardAcceptorAddress) { this.cardAcceptorAddress = cardAcceptorAddress; } public String getCardAcceptorPhone() { return cardAcceptorPhone; } public void setCardAcceptorPhone(String cardAcceptorPhone) { this.cardAcceptorPhone = cardAcceptorPhone; } public String getMerchantCategoryCode() { return merchantCategoryCode; } public void setMerchantCategoryCode(String merchantCategoryCode) { this.merchantCategoryCode = merchantCategoryCode; } public String getMaskedPAN() { return maskedPAN; } public void setMaskedPAN(String maskedPAN) { this.maskedPAN = maskedPAN; } public String getTransactionDetails() { return transactionDetails; } public void setTransactionDetails(String transactionDetails) { this.transactionDetails = transactionDetails; } public Boolean getInvoiced() { return invoiced; } public void setInvoiced(Boolean invoiced) { this.invoiced = invoiced; } public String getProprietaryBankTransactionCode() { return proprietaryBankTransactionCode; } public void setProprietaryBankTransactionCode(String proprietaryBankTransactionCode) { this.proprietaryBankTransactionCode = proprietaryBankTransactionCode; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CardTransaction that = (CardTransaction) o; return Objects.equals(cardTransactionId, that.cardTransactionId) && Objects.equals(terminalId, that.terminalId) && Objects.equals(transactionDate, that.transactionDate) && Objects.equals(acceptorTransactionDateTime, that.acceptorTransactionDateTime) && Objects.equals(bookingDate, that.bookingDate) && Objects.equals(transactionAmount, that.transactionAmount) && Objects.equals(currencyExchange, that.currencyExchange) && Objects.equals(originalAmount, that.originalAmount) && Objects.equals(markupFee, that.markupFee) && Objects.equals(markupFeePercentage, that.markupFeePercentage) && Objects.equals(cardAcceptorId, that.cardAcceptorId) && Objects.equals(cardAcceptorAddress, that.cardAcceptorAddress) && Objects.equals(cardAcceptorPhone, that.cardAcceptorPhone) && Objects.equals(merchantCategoryCode, that.merchantCategoryCode) && Objects.equals(maskedPAN, that.maskedPAN) && Objects.equals(transactionDetails, that.transactionDetails) && Objects.equals(invoiced, that.invoiced) && Objects.equals(proprietaryBankTransactionCode, that.proprietaryBankTransactionCode); } @Override public int hashCode() { return Objects.hash(cardTransactionId, terminalId, transactionDate, acceptorTransactionDateTime, bookingDate, transactionAmount, currencyExchange, originalAmount, markupFee, markupFeePercentage, cardAcceptorId, cardAcceptorAddress, cardAcceptorPhone, merchantCategoryCode, maskedPAN, transactionDetails, invoiced, proprietaryBankTransactionCode); } }
7,628
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
TppMessageInitiationStatusResponse200.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/TppMessageInitiationStatusResponse200.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import javax.annotation.Generated; import java.util.Objects; @Generated("xs2a-adapter-codegen") public class TppMessageInitiationStatusResponse200 { private TppMessageCategory category; private MessageCode200InitiationStatus code; private String path; private String text; public TppMessageCategory getCategory() { return category; } public void setCategory(TppMessageCategory category) { this.category = category; } public MessageCode200InitiationStatus getCode() { return code; } public void setCode(MessageCode200InitiationStatus code) { this.code = code; } public String getPath() { return path; } public void setPath(String path) { this.path = path; } public String getText() { return text; } public void setText(String text) { this.text = text; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TppMessageInitiationStatusResponse200 that = (TppMessageInitiationStatusResponse200) o; return Objects.equals(category, that.category) && Objects.equals(code, that.code) && Objects.equals(path, that.path) && Objects.equals(text, that.text); } @Override public int hashCode() { return Objects.hash(category, code, path, text); } }
2,382
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
PeriodicPaymentInitiationWithStatusResponse.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/PeriodicPaymentInitiationWithStatusResponse.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import javax.annotation.Generated; import java.time.LocalDate; import java.util.List; import java.util.Objects; @Generated("xs2a-adapter-codegen") public class PeriodicPaymentInitiationWithStatusResponse { private String endToEndIdentification; private String instructionIdentification; private String debtorName; private AccountReference debtorAccount; private String ultimateDebtor; private Amount instructedAmount; private AccountReference creditorAccount; private String creditorAgent; private String creditorName; private Address creditorAddress; private String ultimateCreditor; private PurposeCode purposeCode; private String remittanceInformationUnstructured; private String remittanceInformationStructured; private LocalDate startDate; private LocalDate endDate; private ExecutionRule executionRule; private FrequencyCode frequency; private DayOfExecution dayOfExecution; private TransactionStatus transactionStatus; private List<TppMessageGeneric> tppMessage; public String getEndToEndIdentification() { return endToEndIdentification; } public void setEndToEndIdentification(String endToEndIdentification) { this.endToEndIdentification = endToEndIdentification; } public String getInstructionIdentification() { return instructionIdentification; } public void setInstructionIdentification(String instructionIdentification) { this.instructionIdentification = instructionIdentification; } public String getDebtorName() { return debtorName; } public void setDebtorName(String debtorName) { this.debtorName = debtorName; } public AccountReference getDebtorAccount() { return debtorAccount; } public void setDebtorAccount(AccountReference debtorAccount) { this.debtorAccount = debtorAccount; } public String getUltimateDebtor() { return ultimateDebtor; } public void setUltimateDebtor(String ultimateDebtor) { this.ultimateDebtor = ultimateDebtor; } public Amount getInstructedAmount() { return instructedAmount; } public void setInstructedAmount(Amount instructedAmount) { this.instructedAmount = instructedAmount; } public AccountReference getCreditorAccount() { return creditorAccount; } public void setCreditorAccount(AccountReference creditorAccount) { this.creditorAccount = creditorAccount; } public String getCreditorAgent() { return creditorAgent; } public void setCreditorAgent(String creditorAgent) { this.creditorAgent = creditorAgent; } public String getCreditorName() { return creditorName; } public void setCreditorName(String creditorName) { this.creditorName = creditorName; } public Address getCreditorAddress() { return creditorAddress; } public void setCreditorAddress(Address creditorAddress) { this.creditorAddress = creditorAddress; } public String getUltimateCreditor() { return ultimateCreditor; } public void setUltimateCreditor(String ultimateCreditor) { this.ultimateCreditor = ultimateCreditor; } public PurposeCode getPurposeCode() { return purposeCode; } public void setPurposeCode(PurposeCode purposeCode) { this.purposeCode = purposeCode; } public String getRemittanceInformationUnstructured() { return remittanceInformationUnstructured; } public void setRemittanceInformationUnstructured(String remittanceInformationUnstructured) { this.remittanceInformationUnstructured = remittanceInformationUnstructured; } public String getRemittanceInformationStructured() { return remittanceInformationStructured; } public void setRemittanceInformationStructured(String remittanceInformationStructured) { this.remittanceInformationStructured = remittanceInformationStructured; } public LocalDate getStartDate() { return startDate; } public void setStartDate(LocalDate startDate) { this.startDate = startDate; } public LocalDate getEndDate() { return endDate; } public void setEndDate(LocalDate endDate) { this.endDate = endDate; } public ExecutionRule getExecutionRule() { return executionRule; } public void setExecutionRule(ExecutionRule executionRule) { this.executionRule = executionRule; } public FrequencyCode getFrequency() { return frequency; } public void setFrequency(FrequencyCode frequency) { this.frequency = frequency; } public DayOfExecution getDayOfExecution() { return dayOfExecution; } public void setDayOfExecution(DayOfExecution dayOfExecution) { this.dayOfExecution = dayOfExecution; } public TransactionStatus getTransactionStatus() { return transactionStatus; } public void setTransactionStatus(TransactionStatus transactionStatus) { this.transactionStatus = transactionStatus; } public List<TppMessageGeneric> getTppMessage() { return tppMessage; } public void setTppMessage(List<TppMessageGeneric> tppMessage) { this.tppMessage = tppMessage; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PeriodicPaymentInitiationWithStatusResponse that = (PeriodicPaymentInitiationWithStatusResponse) o; return Objects.equals(endToEndIdentification, that.endToEndIdentification) && Objects.equals(instructionIdentification, that.instructionIdentification) && Objects.equals(debtorName, that.debtorName) && Objects.equals(debtorAccount, that.debtorAccount) && Objects.equals(ultimateDebtor, that.ultimateDebtor) && Objects.equals(instructedAmount, that.instructedAmount) && Objects.equals(creditorAccount, that.creditorAccount) && Objects.equals(creditorAgent, that.creditorAgent) && Objects.equals(creditorName, that.creditorName) && Objects.equals(creditorAddress, that.creditorAddress) && Objects.equals(ultimateCreditor, that.ultimateCreditor) && Objects.equals(purposeCode, that.purposeCode) && Objects.equals(remittanceInformationUnstructured, that.remittanceInformationUnstructured) && Objects.equals(remittanceInformationStructured, that.remittanceInformationStructured) && Objects.equals(startDate, that.startDate) && Objects.equals(endDate, that.endDate) && Objects.equals(executionRule, that.executionRule) && Objects.equals(frequency, that.frequency) && Objects.equals(dayOfExecution, that.dayOfExecution) && Objects.equals(transactionStatus, that.transactionStatus) && Objects.equals(tppMessage, that.tppMessage); } @Override public int hashCode() { return Objects.hash(endToEndIdentification, instructionIdentification, debtorName, debtorAccount, ultimateDebtor, instructedAmount, creditorAccount, creditorAgent, creditorName, creditorAddress, ultimateCreditor, purposeCode, remittanceInformationUnstructured, remittanceInformationStructured, startDate, endDate, executionRule, frequency, dayOfExecution, transactionStatus, tppMessage); } }
8,716
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
ChallengeData.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/ChallengeData.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import javax.annotation.Generated; import java.util.List; import java.util.Objects; @Generated("xs2a-adapter-codegen") public class ChallengeData { private byte[] image; private List<String> data; private String imageLink; private Integer otpMaxLength; private OtpFormat otpFormat; private String additionalInformation; public byte[] getImage() { return image; } public void setImage(byte[] image) { this.image = image; } public List<String> getData() { return data; } public void setData(List<String> data) { this.data = data; } public String getImageLink() { return imageLink; } public void setImageLink(String imageLink) { this.imageLink = imageLink; } public Integer getOtpMaxLength() { return otpMaxLength; } public void setOtpMaxLength(Integer otpMaxLength) { this.otpMaxLength = otpMaxLength; } public OtpFormat getOtpFormat() { return otpFormat; } public void setOtpFormat(OtpFormat otpFormat) { this.otpFormat = otpFormat; } public String getAdditionalInformation() { return additionalInformation; } public void setAdditionalInformation(String additionalInformation) { this.additionalInformation = additionalInformation; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ChallengeData that = (ChallengeData) o; return Objects.equals(image, that.image) && Objects.equals(data, that.data) && Objects.equals(imageLink, that.imageLink) && Objects.equals(otpMaxLength, that.otpMaxLength) && Objects.equals(otpFormat, that.otpFormat) && Objects.equals(additionalInformation, that.additionalInformation); } @Override public int hashCode() { return Objects.hash(image, data, imageLink, otpMaxLength, otpFormat, additionalInformation); } public enum OtpFormat { CHARACTERS("characters"), INTEGER("integer"); private String value; OtpFormat(String value) { this.value = value; } @JsonCreator public static OtpFormat fromValue(String value) { for (OtpFormat e : OtpFormat.values()) { if (e.value.equals(value)) { return e; } } return null; } @Override @JsonValue public String toString() { return value; } } }
3,712
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
Balance.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/Balance.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import javax.annotation.Generated; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Objects; @Generated("xs2a-adapter-codegen") public class Balance { private Amount balanceAmount; private BalanceType balanceType; private Boolean creditLimitIncluded; private OffsetDateTime lastChangeDateTime; private LocalDate referenceDate; private String lastCommittedTransaction; public Amount getBalanceAmount() { return balanceAmount; } public void setBalanceAmount(Amount balanceAmount) { this.balanceAmount = balanceAmount; } public BalanceType getBalanceType() { return balanceType; } public void setBalanceType(BalanceType balanceType) { this.balanceType = balanceType; } public Boolean getCreditLimitIncluded() { return creditLimitIncluded; } public void setCreditLimitIncluded(Boolean creditLimitIncluded) { this.creditLimitIncluded = creditLimitIncluded; } public OffsetDateTime getLastChangeDateTime() { return lastChangeDateTime; } public void setLastChangeDateTime(OffsetDateTime lastChangeDateTime) { this.lastChangeDateTime = lastChangeDateTime; } public LocalDate getReferenceDate() { return referenceDate; } public void setReferenceDate(LocalDate referenceDate) { this.referenceDate = referenceDate; } public String getLastCommittedTransaction() { return lastCommittedTransaction; } public void setLastCommittedTransaction(String lastCommittedTransaction) { this.lastCommittedTransaction = lastCommittedTransaction; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Balance that = (Balance) o; return Objects.equals(balanceAmount, that.balanceAmount) && Objects.equals(balanceType, that.balanceType) && Objects.equals(creditLimitIncluded, that.creditLimitIncluded) && Objects.equals(lastChangeDateTime, that.lastChangeDateTime) && Objects.equals(referenceDate, that.referenceDate) && Objects.equals(lastCommittedTransaction, that.lastCommittedTransaction); } @Override public int hashCode() { return Objects.hash(balanceAmount, balanceType, creditLimitIncluded, lastChangeDateTime, referenceDate, lastCommittedTransaction); } }
3,438
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
CardAccountList.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/CardAccountList.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import javax.annotation.Generated; import java.util.List; import java.util.Objects; @Generated("xs2a-adapter-codegen") public class CardAccountList { private List<CardAccountDetails> cardAccounts; public List<CardAccountDetails> getCardAccounts() { return cardAccounts; } public void setCardAccounts(List<CardAccountDetails> cardAccounts) { this.cardAccounts = cardAccounts; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CardAccountList that = (CardAccountList) o; return Objects.equals(cardAccounts, that.cardAccounts); } @Override public int hashCode() { return Objects.hash(cardAccounts); } }
1,662
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
PaymentInitiationJson.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/PaymentInitiationJson.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import javax.annotation.Generated; import java.time.LocalDate; import java.util.List; import java.util.Objects; @Generated("xs2a-adapter-codegen") public class PaymentInitiationJson { private String endToEndIdentification; private String instructionIdentification; private String debtorName; private AccountReference debtorAccount; private String ultimateDebtor; private Amount instructedAmount; private AccountReference creditorAccount; private String creditorAgent; private String creditorAgentName; private String creditorName; private Address creditorAddress; private String creditorId; private String ultimateCreditor; private PurposeCode purposeCode; private ChargeBearer chargeBearer; private String remittanceInformationUnstructured; private String remittanceInformationStructured; private List<String> remittanceInformationStructuredArray; private LocalDate requestedExecutionDate; public String getEndToEndIdentification() { return endToEndIdentification; } public void setEndToEndIdentification(String endToEndIdentification) { this.endToEndIdentification = endToEndIdentification; } public String getInstructionIdentification() { return instructionIdentification; } public void setInstructionIdentification(String instructionIdentification) { this.instructionIdentification = instructionIdentification; } public String getDebtorName() { return debtorName; } public void setDebtorName(String debtorName) { this.debtorName = debtorName; } public AccountReference getDebtorAccount() { return debtorAccount; } public void setDebtorAccount(AccountReference debtorAccount) { this.debtorAccount = debtorAccount; } public String getUltimateDebtor() { return ultimateDebtor; } public void setUltimateDebtor(String ultimateDebtor) { this.ultimateDebtor = ultimateDebtor; } public Amount getInstructedAmount() { return instructedAmount; } public void setInstructedAmount(Amount instructedAmount) { this.instructedAmount = instructedAmount; } public AccountReference getCreditorAccount() { return creditorAccount; } public void setCreditorAccount(AccountReference creditorAccount) { this.creditorAccount = creditorAccount; } public String getCreditorAgent() { return creditorAgent; } public void setCreditorAgent(String creditorAgent) { this.creditorAgent = creditorAgent; } public String getCreditorAgentName() { return creditorAgentName; } public void setCreditorAgentName(String creditorAgentName) { this.creditorAgentName = creditorAgentName; } public String getCreditorName() { return creditorName; } public void setCreditorName(String creditorName) { this.creditorName = creditorName; } public Address getCreditorAddress() { return creditorAddress; } public void setCreditorAddress(Address creditorAddress) { this.creditorAddress = creditorAddress; } public String getCreditorId() { return creditorId; } public void setCreditorId(String creditorId) { this.creditorId = creditorId; } public String getUltimateCreditor() { return ultimateCreditor; } public void setUltimateCreditor(String ultimateCreditor) { this.ultimateCreditor = ultimateCreditor; } public PurposeCode getPurposeCode() { return purposeCode; } public void setPurposeCode(PurposeCode purposeCode) { this.purposeCode = purposeCode; } public ChargeBearer getChargeBearer() { return chargeBearer; } public void setChargeBearer(ChargeBearer chargeBearer) { this.chargeBearer = chargeBearer; } public String getRemittanceInformationUnstructured() { return remittanceInformationUnstructured; } public void setRemittanceInformationUnstructured(String remittanceInformationUnstructured) { this.remittanceInformationUnstructured = remittanceInformationUnstructured; } public String getRemittanceInformationStructured() { return remittanceInformationStructured; } public void setRemittanceInformationStructured(String remittanceInformationStructured) { this.remittanceInformationStructured = remittanceInformationStructured; } public List<String> getRemittanceInformationStructuredArray() { return remittanceInformationStructuredArray; } public void setRemittanceInformationStructuredArray( List<String> remittanceInformationStructuredArray) { this.remittanceInformationStructuredArray = remittanceInformationStructuredArray; } public LocalDate getRequestedExecutionDate() { return requestedExecutionDate; } public void setRequestedExecutionDate(LocalDate requestedExecutionDate) { this.requestedExecutionDate = requestedExecutionDate; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PaymentInitiationJson that = (PaymentInitiationJson) o; return Objects.equals(endToEndIdentification, that.endToEndIdentification) && Objects.equals(instructionIdentification, that.instructionIdentification) && Objects.equals(debtorName, that.debtorName) && Objects.equals(debtorAccount, that.debtorAccount) && Objects.equals(ultimateDebtor, that.ultimateDebtor) && Objects.equals(instructedAmount, that.instructedAmount) && Objects.equals(creditorAccount, that.creditorAccount) && Objects.equals(creditorAgent, that.creditorAgent) && Objects.equals(creditorAgentName, that.creditorAgentName) && Objects.equals(creditorName, that.creditorName) && Objects.equals(creditorAddress, that.creditorAddress) && Objects.equals(creditorId, that.creditorId) && Objects.equals(ultimateCreditor, that.ultimateCreditor) && Objects.equals(purposeCode, that.purposeCode) && Objects.equals(chargeBearer, that.chargeBearer) && Objects.equals(remittanceInformationUnstructured, that.remittanceInformationUnstructured) && Objects.equals(remittanceInformationStructured, that.remittanceInformationStructured) && Objects.equals(remittanceInformationStructuredArray, that.remittanceInformationStructuredArray) && Objects.equals(requestedExecutionDate, that.requestedExecutionDate); } @Override public int hashCode() { return Objects.hash(endToEndIdentification, instructionIdentification, debtorName, debtorAccount, ultimateDebtor, instructedAmount, creditorAccount, creditorAgent, creditorAgentName, creditorName, creditorAddress, creditorId, ultimateCreditor, purposeCode, chargeBearer, remittanceInformationUnstructured, remittanceInformationStructured, remittanceInformationStructuredArray, requestedExecutionDate); } }
8,354
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z
ScaStatusAuthorisationConfirmation.java
/FileExtraction/Java_unseen/adorsys_xs2a-adapter/xs2a-adapter-generated-api/src/main/java/de/adorsys/xs2a/adapter/api/model/ScaStatusAuthorisationConfirmation.java
/* * Copyright 2018-2022 adorsys GmbH & Co KG * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. This program is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. * * This project is also available under a separate commercial license. You can * contact us at [email protected]. */ package de.adorsys.xs2a.adapter.api.model; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import javax.annotation.Generated; @Generated("xs2a-adapter-codegen") public enum ScaStatusAuthorisationConfirmation { FINALISED("finalised"), FAILED("failed"); private String value; ScaStatusAuthorisationConfirmation(String value) { this.value = value; } @JsonCreator public static ScaStatusAuthorisationConfirmation fromValue(String value) { for (ScaStatusAuthorisationConfirmation e : ScaStatusAuthorisationConfirmation.values()) { if (e.value.equals(value)) { return e; } } return null; } @Override @JsonValue public String toString() { return value; } }
1,672
Java
.java
adorsys/xs2a-adapter
37
25
5
2019-04-01T09:31:44Z
2024-03-09T08:27:14Z