@Test(expected = WorldpayModelTransformationException.class) public void shouldRaiseExceptionWhenServiceRequestIsNull() throws Exception { testObj.transform(null); }
@Override public PaymentService transform(final ServiceRequest request) throws WorldpayModelTransformationException { if (request == null) { throw new WorldpayModelTransformationException("Request provided to update token is invalid."); } final UpdateTokenServiceRequest updateTokenRequest = (UpdateTokenServiceRequest) request; final PaymentService paymentService = new PaymentService(); paymentService.setMerchantCode(updateTokenRequest.getMerchantInfo().getMerchantCode()); paymentService.setVersion(configurationService.getConfiguration().getString(WORLDPAY_CONFIG_VERSION)); final PaymentTokenUpdate updateToken = (PaymentTokenUpdate) updateTokenRequest.getUpdateTokenRequest().transformToInternalModel(); final Modify modify = new Modify(); modify.getOrderModificationOrBatchModificationOrAccountBatchModificationOrFuturePayAgreementModificationOrPaymentTokenUpdateOrPaymentTokenDelete().add(updateToken); paymentService.getSubmitOrModifyOrInquiryOrReplyOrNotifyOrVerify().add(modify); return paymentService; }
UpdateTokenRequestTransformer implements ServiceRequestTransformer { @Override public PaymentService transform(final ServiceRequest request) throws WorldpayModelTransformationException { if (request == null) { throw new WorldpayModelTransformationException("Request provided to update token is invalid."); } final UpdateTokenServiceRequest updateTokenRequest = (UpdateTokenServiceRequest) request; final PaymentService paymentService = new PaymentService(); paymentService.setMerchantCode(updateTokenRequest.getMerchantInfo().getMerchantCode()); paymentService.setVersion(configurationService.getConfiguration().getString(WORLDPAY_CONFIG_VERSION)); final PaymentTokenUpdate updateToken = (PaymentTokenUpdate) updateTokenRequest.getUpdateTokenRequest().transformToInternalModel(); final Modify modify = new Modify(); modify.getOrderModificationOrBatchModificationOrAccountBatchModificationOrFuturePayAgreementModificationOrPaymentTokenUpdateOrPaymentTokenDelete().add(updateToken); paymentService.getSubmitOrModifyOrInquiryOrReplyOrNotifyOrVerify().add(modify); return paymentService; } }
UpdateTokenRequestTransformer implements ServiceRequestTransformer { @Override public PaymentService transform(final ServiceRequest request) throws WorldpayModelTransformationException { if (request == null) { throw new WorldpayModelTransformationException("Request provided to update token is invalid."); } final UpdateTokenServiceRequest updateTokenRequest = (UpdateTokenServiceRequest) request; final PaymentService paymentService = new PaymentService(); paymentService.setMerchantCode(updateTokenRequest.getMerchantInfo().getMerchantCode()); paymentService.setVersion(configurationService.getConfiguration().getString(WORLDPAY_CONFIG_VERSION)); final PaymentTokenUpdate updateToken = (PaymentTokenUpdate) updateTokenRequest.getUpdateTokenRequest().transformToInternalModel(); final Modify modify = new Modify(); modify.getOrderModificationOrBatchModificationOrAccountBatchModificationOrFuturePayAgreementModificationOrPaymentTokenUpdateOrPaymentTokenDelete().add(updateToken); paymentService.getSubmitOrModifyOrInquiryOrReplyOrNotifyOrVerify().add(modify); return paymentService; }  }
UpdateTokenRequestTransformer implements ServiceRequestTransformer { @Override public PaymentService transform(final ServiceRequest request) throws WorldpayModelTransformationException { if (request == null) { throw new WorldpayModelTransformationException("Request provided to update token is invalid."); } final UpdateTokenServiceRequest updateTokenRequest = (UpdateTokenServiceRequest) request; final PaymentService paymentService = new PaymentService(); paymentService.setMerchantCode(updateTokenRequest.getMerchantInfo().getMerchantCode()); paymentService.setVersion(configurationService.getConfiguration().getString(WORLDPAY_CONFIG_VERSION)); final PaymentTokenUpdate updateToken = (PaymentTokenUpdate) updateTokenRequest.getUpdateTokenRequest().transformToInternalModel(); final Modify modify = new Modify(); modify.getOrderModificationOrBatchModificationOrAccountBatchModificationOrFuturePayAgreementModificationOrPaymentTokenUpdateOrPaymentTokenDelete().add(updateToken); paymentService.getSubmitOrModifyOrInquiryOrReplyOrNotifyOrVerify().add(modify); return paymentService; }  @Override PaymentService transform(final ServiceRequest request); @Required void setConfigurationService(final ConfigurationService configurationService); }
UpdateTokenRequestTransformer implements ServiceRequestTransformer { @Override public PaymentService transform(final ServiceRequest request) throws WorldpayModelTransformationException { if (request == null) { throw new WorldpayModelTransformationException("Request provided to update token is invalid."); } final UpdateTokenServiceRequest updateTokenRequest = (UpdateTokenServiceRequest) request; final PaymentService paymentService = new PaymentService(); paymentService.setMerchantCode(updateTokenRequest.getMerchantInfo().getMerchantCode()); paymentService.setVersion(configurationService.getConfiguration().getString(WORLDPAY_CONFIG_VERSION)); final PaymentTokenUpdate updateToken = (PaymentTokenUpdate) updateTokenRequest.getUpdateTokenRequest().transformToInternalModel(); final Modify modify = new Modify(); modify.getOrderModificationOrBatchModificationOrAccountBatchModificationOrFuturePayAgreementModificationOrPaymentTokenUpdateOrPaymentTokenDelete().add(updateToken); paymentService.getSubmitOrModifyOrInquiryOrReplyOrNotifyOrVerify().add(modify); return paymentService; }  @Override PaymentService transform(final ServiceRequest request); @Required void setConfigurationService(final ConfigurationService configurationService);  }