@Test void initiatePayment() { when(paymentRestClient.initiatePayment(any(), any())).thenReturn(ResponseEntity.ok(getSelectMethodResponse(TransactionStatus.ACCP.name()))); PaymentWorkflow result = service.initiatePayment(getExpectedWorkflow(RCVD.name(), null), PSU_ID); assertThat(result).isEqualToComparingFieldByFieldRecursively(getExpectedWorkflow(TransactionStatus.ACCP.name(), TransactionStatus.ACCP.name())); }
@Override public PaymentWorkflow initiatePayment(PaymentWorkflow paymentWorkflow, String psuId) { authInterceptor.setAccessToken(paymentWorkflow.bearerToken().getAccess_token()); SCAPaymentResponseTO paymentResponseTO = paymentRestClient.initiatePayment(paymentWorkflow.paymentType(), paymentWorkflow.getAuthResponse().getPayment()).getBody(); paymentWorkflow.processSCAResponse(paymentResponseTO); paymentWorkflow.setPaymentStatus(paymentResponseTO.getTransactionStatus().name()); doUpdateAuthData(psuId, paymentWorkflow); return paymentWorkflow; }
CommonPaymentServiceImpl implements CommonPaymentService { @Override public PaymentWorkflow initiatePayment(PaymentWorkflow paymentWorkflow, String psuId) { authInterceptor.setAccessToken(paymentWorkflow.bearerToken().getAccess_token()); SCAPaymentResponseTO paymentResponseTO = paymentRestClient.initiatePayment(paymentWorkflow.paymentType(), paymentWorkflow.getAuthResponse().getPayment()).getBody(); paymentWorkflow.processSCAResponse(paymentResponseTO); paymentWorkflow.setPaymentStatus(paymentResponseTO.getTransactionStatus().name()); doUpdateAuthData(psuId, paymentWorkflow); return paymentWorkflow; } }
CommonPaymentServiceImpl implements CommonPaymentService { @Override public PaymentWorkflow initiatePayment(PaymentWorkflow paymentWorkflow, String psuId) { authInterceptor.setAccessToken(paymentWorkflow.bearerToken().getAccess_token()); SCAPaymentResponseTO paymentResponseTO = paymentRestClient.initiatePayment(paymentWorkflow.paymentType(), paymentWorkflow.getAuthResponse().getPayment()).getBody(); paymentWorkflow.processSCAResponse(paymentResponseTO); paymentWorkflow.setPaymentStatus(paymentResponseTO.getTransactionStatus().name()); doUpdateAuthData(psuId, paymentWorkflow); return paymentWorkflow; }  }
CommonPaymentServiceImpl implements CommonPaymentService { @Override public PaymentWorkflow initiatePayment(PaymentWorkflow paymentWorkflow, String psuId) { authInterceptor.setAccessToken(paymentWorkflow.bearerToken().getAccess_token()); SCAPaymentResponseTO paymentResponseTO = paymentRestClient.initiatePayment(paymentWorkflow.paymentType(), paymentWorkflow.getAuthResponse().getPayment()).getBody(); paymentWorkflow.processSCAResponse(paymentResponseTO); paymentWorkflow.setPaymentStatus(paymentResponseTO.getTransactionStatus().name()); doUpdateAuthData(psuId, paymentWorkflow); return paymentWorkflow; }  @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 initiatePayment(PaymentWorkflow paymentWorkflow, String psuId) { authInterceptor.setAccessToken(paymentWorkflow.bearerToken().getAccess_token()); SCAPaymentResponseTO paymentResponseTO = paymentRestClient.initiatePayment(paymentWorkflow.paymentType(), paymentWorkflow.getAuthResponse().getPayment()).getBody(); paymentWorkflow.processSCAResponse(paymentResponseTO); paymentWorkflow.setPaymentStatus(paymentResponseTO.getTransactionStatus().name()); doUpdateAuthData(psuId, paymentWorkflow); return paymentWorkflow; }  @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);  }