class PaymentController implements PaymentApi {

    @Override
    public ResponseEntity getPaymentInitiationStatus(String paymentService, String paymentProduct,
                                                     String paymentId, UUID xRequestId, String digest,
                                                     String signature, byte[] tppSignatureCertificate,
                                                     String psuIpAddress, String psuIpPort,
                                                     String psuAccept, String psuAcceptCharset, String psuAcceptEncoding,
                                                     String psuAcceptLanguage, String psuUserAgent, String psuHttpMethod,
                                                     UUID psuDeviceId, String psuGeoLocation) {

        ResponseObject<GetPaymentStatusResponse> serviceResponse = xs2aPaymentService.getPaymentStatusById(getPaymentType(paymentService), paymentProduct, paymentId);

        if (serviceResponse.hasError()) {
            return responseErrorMapper.generateErrorResponse(serviceResponse.getError());
        }

        if (serviceResponse.getBody().isResponseContentTypeJson()) {
            return responseMapper.ok(serviceResponse, paymentModelMapperPsd2::mapToStatusResponseJson);
        } else {
            return responseMapper.ok(serviceResponse, paymentModelMapperPsd2::mapToStatusResponseRaw);
        }
    }

}