class PisCommonPaymentController implements PisCommonPaymentApi {

    @Override
    public ResponseEntity<CreateAuthorisationResponse> createAuthorisation(String paymentId, CreateAuthorisationRequest request) {
        CmsResponse<CreateAuthorisationResponse> response = authorisationServiceEncrypted.createAuthorisation(new PisAuthorisationParentHolder(paymentId), request);

        if (response.hasError()) {
            return new ResponseEntity<>(HttpStatus.NOT_FOUND);
        }

        return new ResponseEntity<>(response.getPayload(), HttpStatus.CREATED);
    }

}