Search in sources :

Example 1 with OBWriteInternationalConsent4

use of uk.org.openbanking.datamodel.payment.OBWriteInternationalConsent4 in project openbanking-aspsp by OpenBankingToolkit.

the class InternationalPaymentConsentsApiController method createInternationalPaymentConsents.

public ResponseEntity<OBWriteInternationalConsentResponse4> createInternationalPaymentConsents(OBWriteInternationalConsent4 obWriteInternationalConsent4, String authorization, String xIdempotencyKey, String xJwsSignature, DateTime xFapiAuthDate, String xFapiCustomerIpAddress, String xFapiInteractionId, String xCustomerUserAgent, HttpServletRequest request, Principal principal) throws OBErrorResponseException {
    return rsEndpointWrapperService.paymentEndpoint().authorization(authorization).xFapiFinancialId(rsEndpointWrapperService.rsConfiguration.financialId).principal(principal).obVersion(getOBVersion(request.getRequestURI())).filters(f -> {
        f.verifyIdempotencyKeyLength(xIdempotencyKey);
        f.verifyJwsDetachedSignature(xJwsSignature, request);
        f.validateRisk(obWriteInternationalConsent4.getRisk());
    }).execute((String tppId) -> {
        exchangeRateVerifier.verify(obWriteInternationalConsent4.getData().getInitiation().getExchangeRateInformation());
        HttpHeaders additionalHttpHeaders = new HttpHeaders();
        additionalHttpHeaders.add("x-ob-client-id", tppId);
        return rsStoreGateway.toRsStore(request, additionalHttpHeaders, Collections.emptyMap(), OBWriteInternationalConsentResponse4.class, obWriteInternationalConsent4);
    });
}
Also used : OBWriteFundsConfirmationResponse1(uk.org.openbanking.datamodel.payment.OBWriteFundsConfirmationResponse1) RsStoreGateway(com.forgerock.openbanking.common.services.store.RsStoreGateway) HttpHeaders(org.springframework.http.HttpHeaders) OBErrorResponseException(com.forgerock.openbanking.exceptions.OBErrorResponseException) DateTime(org.joda.time.DateTime) InternationalPaymentService(com.forgerock.openbanking.common.services.store.payment.InternationalPaymentService) Controller(org.springframework.stereotype.Controller) ExchangeRateVerifier(com.forgerock.openbanking.aspsp.rs.api.payment.verifier.ExchangeRateVerifier) FRInternationalConsent(com.forgerock.openbanking.common.model.openbanking.persistence.payment.FRInternationalConsent) OBWriteInternationalConsentResponse4(uk.org.openbanking.datamodel.payment.OBWriteInternationalConsentResponse4) HttpServletRequest(javax.servlet.http.HttpServletRequest) Principal(java.security.Principal) ServletServerHttpRequest(org.springframework.http.server.ServletServerHttpRequest) ApiVersionUtils.getOBVersion(com.forgerock.openbanking.common.utils.ApiVersionUtils.getOBVersion) RSEndpointWrapperService(com.forgerock.openbanking.aspsp.rs.wrappper.RSEndpointWrapperService) ResponseEntity(org.springframework.http.ResponseEntity) Collections(java.util.Collections) OBWriteInternationalConsent4(uk.org.openbanking.datamodel.payment.OBWriteInternationalConsent4) HttpHeaders(org.springframework.http.HttpHeaders)

Aggregations

ExchangeRateVerifier (com.forgerock.openbanking.aspsp.rs.api.payment.verifier.ExchangeRateVerifier)1 RSEndpointWrapperService (com.forgerock.openbanking.aspsp.rs.wrappper.RSEndpointWrapperService)1 FRInternationalConsent (com.forgerock.openbanking.common.model.openbanking.persistence.payment.FRInternationalConsent)1 RsStoreGateway (com.forgerock.openbanking.common.services.store.RsStoreGateway)1 InternationalPaymentService (com.forgerock.openbanking.common.services.store.payment.InternationalPaymentService)1 ApiVersionUtils.getOBVersion (com.forgerock.openbanking.common.utils.ApiVersionUtils.getOBVersion)1 OBErrorResponseException (com.forgerock.openbanking.exceptions.OBErrorResponseException)1 Principal (java.security.Principal)1 Collections (java.util.Collections)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 DateTime (org.joda.time.DateTime)1 HttpHeaders (org.springframework.http.HttpHeaders)1 ResponseEntity (org.springframework.http.ResponseEntity)1 ServletServerHttpRequest (org.springframework.http.server.ServletServerHttpRequest)1 Controller (org.springframework.stereotype.Controller)1 OBWriteFundsConfirmationResponse1 (uk.org.openbanking.datamodel.payment.OBWriteFundsConfirmationResponse1)1 OBWriteInternationalConsent4 (uk.org.openbanking.datamodel.payment.OBWriteInternationalConsent4)1 OBWriteInternationalConsentResponse4 (uk.org.openbanking.datamodel.payment.OBWriteInternationalConsentResponse4)1