@Test void updateAspspConsentData_exception() throws IOException { when(tokenStorageService.toBase64String(any())).thenThrow(IOException.class); assertThrows(AuthorizationException.class, () -> service.updateAspspConsentData(getExpectedWorkflow("RJCT", "RJCT"))); }
@Override public void updateAspspConsentData(PaymentWorkflow paymentWorkflow) { CmsAspspConsentDataBase64 consentData; try { consentData = new CmsAspspConsentDataBase64(paymentWorkflow.paymentId(), tokenStorageService.toBase64String(paymentWorkflow.getScaResponse())); } catch (IOException e) { throw AuthorizationException.builder() .errorCode(CONSENT_DATA_UPDATE_FAILED) .devMessage("Consent data update failed") .build(); } aspspConsentDataClient.updateAspspConsentData(paymentWorkflow.getConsentReference().getEncryptedConsentId(), consentData); }
CommonPaymentServiceImpl implements CommonPaymentService { @Override public void updateAspspConsentData(PaymentWorkflow paymentWorkflow) { CmsAspspConsentDataBase64 consentData; try { consentData = new CmsAspspConsentDataBase64(paymentWorkflow.paymentId(), tokenStorageService.toBase64String(paymentWorkflow.getScaResponse())); } catch (IOException e) { throw AuthorizationException.builder() .errorCode(CONSENT_DATA_UPDATE_FAILED) .devMessage("Consent data update failed") .build(); } aspspConsentDataClient.updateAspspConsentData(paymentWorkflow.getConsentReference().getEncryptedConsentId(), consentData); } }
CommonPaymentServiceImpl implements CommonPaymentService { @Override public void updateAspspConsentData(PaymentWorkflow paymentWorkflow) { CmsAspspConsentDataBase64 consentData; try { consentData = new CmsAspspConsentDataBase64(paymentWorkflow.paymentId(), tokenStorageService.toBase64String(paymentWorkflow.getScaResponse())); } catch (IOException e) { throw AuthorizationException.builder() .errorCode(CONSENT_DATA_UPDATE_FAILED) .devMessage("Consent data update failed") .build(); } aspspConsentDataClient.updateAspspConsentData(paymentWorkflow.getConsentReference().getEncryptedConsentId(), consentData); }  }
CommonPaymentServiceImpl implements CommonPaymentService { @Override public void updateAspspConsentData(PaymentWorkflow paymentWorkflow) { CmsAspspConsentDataBase64 consentData; try { consentData = new CmsAspspConsentDataBase64(paymentWorkflow.paymentId(), tokenStorageService.toBase64String(paymentWorkflow.getScaResponse())); } catch (IOException e) { throw AuthorizationException.builder() .errorCode(CONSENT_DATA_UPDATE_FAILED) .devMessage("Consent data update failed") .build(); } aspspConsentDataClient.updateAspspConsentData(paymentWorkflow.getConsentReference().getEncryptedConsentId(), consentData); }  @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 void updateAspspConsentData(PaymentWorkflow paymentWorkflow) { CmsAspspConsentDataBase64 consentData; try { consentData = new CmsAspspConsentDataBase64(paymentWorkflow.paymentId(), tokenStorageService.toBase64String(paymentWorkflow.getScaResponse())); } catch (IOException e) { throw AuthorizationException.builder() .errorCode(CONSENT_DATA_UPDATE_FAILED) .devMessage("Consent data update failed") .build(); } aspspConsentDataClient.updateAspspConsentData(paymentWorkflow.getConsentReference().getEncryptedConsentId(), consentData); }  @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);  }