@Test void selectScaForPayment() throws RedirectUrlIsExpiredException { when(paymentMapper.toAbstractPayment(anyString(), anyString(), anyString())).thenReturn(getPaymentTO(ACCP)); when(referencePolicy.fromRequest(anyString(), anyString(), anyString(), anyBoolean())).thenReturn(getConsentReference()); when(cmsPsuPisService.checkRedirectAndGetPayment(anyString(), anyString())).thenReturn(getCmsPaymentResponse()); when(paymentRestClient.selectMethod(anyString(), anyString(), anyString())).thenReturn(ResponseEntity.ok(getSelectMethodResponse(TransactionStatus.ACCP.name()))); PaymentWorkflow result = service.selectScaForPayment(ENCRYPTED_ID, AUTH_ID, METHOD_ID, COOKIE, false, PSU_ID, new BearerTokenTO()); assertThat(result).isEqualToComparingFieldByFieldRecursively(getExpectedWorkflow(TransactionStatus.ACCP.name(), TransactionStatus.ACCP.name())); }
@Override public PaymentWorkflow selectScaForPayment(String encryptedPaymentId, String authorisationId, String scaMethodId, String consentAndAccessTokenCookieString, boolean isCancellationOperation, String psuId, BearerTokenTO tokenTO) { PaymentWorkflow workflow = identifyPayment(encryptedPaymentId, authorisationId, true, consentAndAccessTokenCookieString, psuId, tokenTO); selectMethodAndUpdateWorkflow(scaMethodId, workflow, isCancellationOperation); doUpdateAuthData(psuId, workflow); return workflow; }
CommonPaymentServiceImpl implements CommonPaymentService { @Override public PaymentWorkflow selectScaForPayment(String encryptedPaymentId, String authorisationId, String scaMethodId, String consentAndAccessTokenCookieString, boolean isCancellationOperation, String psuId, BearerTokenTO tokenTO) { PaymentWorkflow workflow = identifyPayment(encryptedPaymentId, authorisationId, true, consentAndAccessTokenCookieString, psuId, tokenTO); selectMethodAndUpdateWorkflow(scaMethodId, workflow, isCancellationOperation); doUpdateAuthData(psuId, workflow); return workflow; } }
CommonPaymentServiceImpl implements CommonPaymentService { @Override public PaymentWorkflow selectScaForPayment(String encryptedPaymentId, String authorisationId, String scaMethodId, String consentAndAccessTokenCookieString, boolean isCancellationOperation, String psuId, BearerTokenTO tokenTO) { PaymentWorkflow workflow = identifyPayment(encryptedPaymentId, authorisationId, true, consentAndAccessTokenCookieString, psuId, tokenTO); selectMethodAndUpdateWorkflow(scaMethodId, workflow, isCancellationOperation); doUpdateAuthData(psuId, workflow); return workflow; }  }
CommonPaymentServiceImpl implements CommonPaymentService { @Override public PaymentWorkflow selectScaForPayment(String encryptedPaymentId, String authorisationId, String scaMethodId, String consentAndAccessTokenCookieString, boolean isCancellationOperation, String psuId, BearerTokenTO tokenTO) { PaymentWorkflow workflow = identifyPayment(encryptedPaymentId, authorisationId, true, consentAndAccessTokenCookieString, psuId, tokenTO); selectMethodAndUpdateWorkflow(scaMethodId, workflow, isCancellationOperation); doUpdateAuthData(psuId, workflow); return workflow; }  @Override PaymentWorkflow selectScaForPayment(String encryptedPaymentId, String authorisationId, String scaMethodId, String consentAndAccessTokenCookieString, boolean isCancellationOperation, String psuId, BearerTokenTO tokenTO); @Override PaymentWorkflow identifyPayment(String encryptedPaymentId, String authorizationId, boolean strict, String consentCookieString, String psuId, BearerTokenTO bearerToken); @Override void updateAspspConsentData(PaymentWorkflow paymentWorkflow); @Override String resolveRedirectUrl(String encryptedPaymentId, String authorisationId, String consentAndAccessTokenCookieString, boolean isOauth2Integrated, String psuId, BearerTokenTO tokenTO, String authConfirmationCode); @Override PaymentWorkflow initiatePayment(PaymentWorkflow paymentWorkflow, String psuId); @Override PaymentWorkflow initiateCancelPayment(PaymentWorkflow paymentWorkflow, String psuId); @Override PaymentWorkflow authorizePayment(PaymentWorkflow paymentWorkflow, String psuId, String authCode); @Override PaymentWorkflow authorizeCancelPayment(PaymentWorkflow paymentWorkflow, String psuId, String authCode); }
CommonPaymentServiceImpl implements CommonPaymentService { @Override public PaymentWorkflow selectScaForPayment(String encryptedPaymentId, String authorisationId, String scaMethodId, String consentAndAccessTokenCookieString, boolean isCancellationOperation, String psuId, BearerTokenTO tokenTO) { PaymentWorkflow workflow = identifyPayment(encryptedPaymentId, authorisationId, true, consentAndAccessTokenCookieString, psuId, tokenTO); selectMethodAndUpdateWorkflow(scaMethodId, workflow, isCancellationOperation); doUpdateAuthData(psuId, workflow); return workflow; }  @Override PaymentWorkflow selectScaForPayment(String encryptedPaymentId, String authorisationId, String scaMethodId, String consentAndAccessTokenCookieString, boolean isCancellationOperation, String psuId, BearerTokenTO tokenTO); @Override PaymentWorkflow identifyPayment(String encryptedPaymentId, String authorizationId, boolean strict, String consentCookieString, String psuId, BearerTokenTO bearerToken); @Override void updateAspspConsentData(PaymentWorkflow paymentWorkflow); @Override String resolveRedirectUrl(String encryptedPaymentId, String authorisationId, String consentAndAccessTokenCookieString, boolean isOauth2Integrated, String psuId, BearerTokenTO tokenTO, String authConfirmationCode); @Override PaymentWorkflow initiatePayment(PaymentWorkflow paymentWorkflow, String psuId); @Override PaymentWorkflow initiateCancelPayment(PaymentWorkflow paymentWorkflow, String psuId); @Override PaymentWorkflow authorizePayment(PaymentWorkflow paymentWorkflow, String psuId, String authCode); @Override PaymentWorkflow authorizeCancelPayment(PaymentWorkflow paymentWorkflow, String psuId, String authCode);  }