Search in sources :

Example 1 with SupportedServicesCOF

use of net.petafuel.styx.api.v1.sad.entity.SupportedServicesCOF in project styx by petafuel.

the class ASPSPProcessor method processSupportedServicesCof.

/**
 * @return SupportedServicesCOF
 */
private static SupportedServicesCOF processSupportedServicesCof() {
    SupportedServicesCOF supportedServicesCOF = new SupportedServicesCOF();
    supportedServicesCOF.setFundsConfirmation(true);
    return supportedServicesCOF;
}
Also used : SupportedServicesCOF(net.petafuel.styx.api.v1.sad.entity.SupportedServicesCOF)

Example 2 with SupportedServicesCOF

use of net.petafuel.styx.api.v1.sad.entity.SupportedServicesCOF in project styx by petafuel.

the class ASPSPProcessor method process.

/**
 * @param bic - BIC provided by the client
 * @return ASPSPResponse | null
 */
public static ASPSPResponse process(String bic) {
    try {
        Aspsp aspsp = getAspspByBic(bic);
        if (Objects.nonNull(aspsp)) {
            ASPSPResponse aspspResponse = new ASPSPResponse();
            Map<String, ImplementerOption> implementerOptions = aspsp.getConfig().getImplementerOptions();
            SupportedServicesPIS supportedServicesPIS = processSupportedServicesPis(implementerOptions);
            SupportedServicesAIS supportedServicesAIS = processSupportedServicesAis(implementerOptions);
            SupportedServicesCOF supportedServicesCOF = processSupportedServicesCof();
            SupportedServices supportedServices = new SupportedServices(supportedServicesPIS, supportedServicesAIS, supportedServicesCOF);
            aspspResponse.setName(aspsp.getName());
            aspspResponse.setActive(aspsp.isActive());
            aspspResponse.setScaApproaches(processScaApproaches(implementerOptions));
            aspspResponse.setSupportedServices(supportedServices);
            aspspResponse.setPrestepRequired(processPrestepRequired(implementerOptions));
            aspspResponse.setMulticurrencyAccountsSupported(proccessMulticurrencyAccountsSupported(implementerOptions));
            return aspspResponse;
        } else {
            return null;
        }
    } catch (BankNotFoundException | BankLookupFailedException bankNotFoundException) {
        LOG.error("Bank not found for bic={} in SAD", bic);
        return null;
    }
}
Also used : Aspsp(net.petafuel.styx.core.banklookup.sad.entities.Aspsp) ASPSPResponse(net.petafuel.styx.api.v1.sad.entity.ASPSPResponse) SupportedServicesAIS(net.petafuel.styx.api.v1.sad.entity.SupportedServicesAIS) SupportedServicesPIS(net.petafuel.styx.api.v1.sad.entity.SupportedServicesPIS) SupportedServicesCOF(net.petafuel.styx.api.v1.sad.entity.SupportedServicesCOF) SupportedServices(net.petafuel.styx.api.v1.sad.entity.SupportedServices) BankLookupFailedException(net.petafuel.styx.core.banklookup.exceptions.BankLookupFailedException) ImplementerOption(net.petafuel.styx.core.banklookup.sad.entities.ImplementerOption) BankNotFoundException(net.petafuel.styx.core.banklookup.exceptions.BankNotFoundException)

Aggregations

SupportedServicesCOF (net.petafuel.styx.api.v1.sad.entity.SupportedServicesCOF)2 ASPSPResponse (net.petafuel.styx.api.v1.sad.entity.ASPSPResponse)1 SupportedServices (net.petafuel.styx.api.v1.sad.entity.SupportedServices)1 SupportedServicesAIS (net.petafuel.styx.api.v1.sad.entity.SupportedServicesAIS)1 SupportedServicesPIS (net.petafuel.styx.api.v1.sad.entity.SupportedServicesPIS)1 BankLookupFailedException (net.petafuel.styx.core.banklookup.exceptions.BankLookupFailedException)1 BankNotFoundException (net.petafuel.styx.core.banklookup.exceptions.BankNotFoundException)1 Aspsp (net.petafuel.styx.core.banklookup.sad.entities.Aspsp)1 ImplementerOption (net.petafuel.styx.core.banklookup.sad.entities.ImplementerOption)1