@Test void resolvePaymentWorkflow() { ResponseEntity<PaymentAuthorizeResponse> result = service.resolvePaymentWorkflow(getPaymentWorkflow()); assertThat(result).isEqualToComparingFieldByFieldRecursively(ResponseEntity.ok(getPaymentAuthorizeResponse())); }
public ResponseEntity<PaymentAuthorizeResponse> resolvePaymentWorkflow(PaymentWorkflow workflow) { ScaStatusTO scaStatusTO = workflow.scaStatus(); if (EnumSet.of(PSUIDENTIFIED, FINALISED, EXEMPTED, PSUAUTHENTICATED, SCAMETHODSELECTED).contains(scaStatusTO)) { responseUtils.setCookies(response, workflow.getConsentReference(), workflow.bearerToken().getAccess_token(), workflow.bearerToken().getAccessTokenObject()); return ResponseEntity.ok(workflow.getAuthResponse()); } responseUtils.removeCookies(response); return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build(); }
XISControllerService { public ResponseEntity<PaymentAuthorizeResponse> resolvePaymentWorkflow(PaymentWorkflow workflow) { ScaStatusTO scaStatusTO = workflow.scaStatus(); if (EnumSet.of(PSUIDENTIFIED, FINALISED, EXEMPTED, PSUAUTHENTICATED, SCAMETHODSELECTED).contains(scaStatusTO)) { responseUtils.setCookies(response, workflow.getConsentReference(), workflow.bearerToken().getAccess_token(), workflow.bearerToken().getAccessTokenObject()); return ResponseEntity.ok(workflow.getAuthResponse()); } responseUtils.removeCookies(response); return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build(); } }
XISControllerService { public ResponseEntity<PaymentAuthorizeResponse> resolvePaymentWorkflow(PaymentWorkflow workflow) { ScaStatusTO scaStatusTO = workflow.scaStatus(); if (EnumSet.of(PSUIDENTIFIED, FINALISED, EXEMPTED, PSUAUTHENTICATED, SCAMETHODSELECTED).contains(scaStatusTO)) { responseUtils.setCookies(response, workflow.getConsentReference(), workflow.bearerToken().getAccess_token(), workflow.bearerToken().getAccessTokenObject()); return ResponseEntity.ok(workflow.getAuthResponse()); } responseUtils.removeCookies(response); return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build(); }  }
XISControllerService { public ResponseEntity<PaymentAuthorizeResponse> resolvePaymentWorkflow(PaymentWorkflow workflow) { ScaStatusTO scaStatusTO = workflow.scaStatus(); if (EnumSet.of(PSUIDENTIFIED, FINALISED, EXEMPTED, PSUAUTHENTICATED, SCAMETHODSELECTED).contains(scaStatusTO)) { responseUtils.setCookies(response, workflow.getConsentReference(), workflow.bearerToken().getAccess_token(), workflow.bearerToken().getAccessTokenObject()); return ResponseEntity.ok(workflow.getAuthResponse()); } responseUtils.removeCookies(response); return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build(); }  ResponseEntity<AuthorizeResponse> auth(String redirectId, ConsentType consentType, String encryptedConsentId, HttpServletResponse response); ResponseEntity<SCALoginResponseTO> performLoginForConsent(String login, String pin, String operationId, String authId, OpTypeTO operationType); ResponseEntity<PaymentAuthorizeResponse> resolvePaymentWorkflow(PaymentWorkflow workflow); }
XISControllerService { public ResponseEntity<PaymentAuthorizeResponse> resolvePaymentWorkflow(PaymentWorkflow workflow) { ScaStatusTO scaStatusTO = workflow.scaStatus(); if (EnumSet.of(PSUIDENTIFIED, FINALISED, EXEMPTED, PSUAUTHENTICATED, SCAMETHODSELECTED).contains(scaStatusTO)) { responseUtils.setCookies(response, workflow.getConsentReference(), workflow.bearerToken().getAccess_token(), workflow.bearerToken().getAccessTokenObject()); return ResponseEntity.ok(workflow.getAuthResponse()); } responseUtils.removeCookies(response); return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build(); }  ResponseEntity<AuthorizeResponse> auth(String redirectId, ConsentType consentType, String encryptedConsentId, HttpServletResponse response); ResponseEntity<SCALoginResponseTO> performLoginForConsent(String login, String pin, String operationId, String authId, OpTypeTO operationType); ResponseEntity<PaymentAuthorizeResponse> resolvePaymentWorkflow(PaymentWorkflow workflow);  }