Search in sources :

Example 1 with SupportedServicesPIS

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

the class ASPSPProcessor method processSupportedServicesPis.

/**
 * @param implementerOptionMap - ImplementerOption map for the ASPSP
 * @return SupportedServicesPIS
 */
private static SupportedServicesPIS processSupportedServicesPis(Map<String, ImplementerOption> implementerOptionMap) {
    SupportedServicesPIS supportedServicesPIS = new SupportedServicesPIS();
    supportedServicesPIS.setSinglePayments(isIoTrue(implementerOptionMap, "IO2"));
    supportedServicesPIS.setBulkPayments(isIoTrue(implementerOptionMap, "IO3"));
    supportedServicesPIS.setPeriodicPayments(isIoTrue(implementerOptionMap, "IO4"));
    supportedServicesPIS.setFutureDatedPayments(getIoValueByKey(implementerOptionMap, "IO21", "available"));
    return supportedServicesPIS;
}
Also used : SupportedServicesPIS(net.petafuel.styx.api.v1.sad.entity.SupportedServicesPIS)

Example 2 with SupportedServicesPIS

use of net.petafuel.styx.api.v1.sad.entity.SupportedServicesPIS 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

SupportedServicesPIS (net.petafuel.styx.api.v1.sad.entity.SupportedServicesPIS)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 SupportedServicesCOF (net.petafuel.styx.api.v1.sad.entity.SupportedServicesCOF)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