@Test public void testPaymentOperation() throws WirecardPaymenException { Payment payment = new Payment(); payment.setSuccessRedirectUrl(redirectUrl); payment.setRequestId(requestId); idealDebitBicPaymentProcessor.processPayment(payment, data); assertEquals("Iban does not match", iban, payment.getBankAccount().getIban()); assertEquals("Bic does not match", bic, payment.getBankAccount().getBic()); assertEquals("SuccessUrl does not match", expected, payment.getSuccessRedirectUrl()); }
@Override public void processPayment(Payment payment, PaymentOperationData data) throws WirecardPaymenException { BankAccount bankAccount = objectFactory.createBankAccount(); bankAccount.setBic(data.getBic()); bankAccount.setIban(data.getIban()); payment.setBankAccount(bankAccount); payment.setOrderNumber(null); if (StringUtils.isNotEmpty(payment.getRequestId())) { StringBuilder successURL = new StringBuilder(payment.getSuccessRedirectUrl()); successURL.append("?status=success&request_id=").append(payment.getRequestId()); payment.setSuccessRedirectUrl(successURL.toString()); } }
IdealDebitBicPaymentProcessor implements PaymentProcessor { @Override public void processPayment(Payment payment, PaymentOperationData data) throws WirecardPaymenException { BankAccount bankAccount = objectFactory.createBankAccount(); bankAccount.setBic(data.getBic()); bankAccount.setIban(data.getIban()); payment.setBankAccount(bankAccount); payment.setOrderNumber(null); if (StringUtils.isNotEmpty(payment.getRequestId())) { StringBuilder successURL = new StringBuilder(payment.getSuccessRedirectUrl()); successURL.append("?status=success&request_id=").append(payment.getRequestId()); payment.setSuccessRedirectUrl(successURL.toString()); } } }
IdealDebitBicPaymentProcessor implements PaymentProcessor { @Override public void processPayment(Payment payment, PaymentOperationData data) throws WirecardPaymenException { BankAccount bankAccount = objectFactory.createBankAccount(); bankAccount.setBic(data.getBic()); bankAccount.setIban(data.getIban()); payment.setBankAccount(bankAccount); payment.setOrderNumber(null); if (StringUtils.isNotEmpty(payment.getRequestId())) { StringBuilder successURL = new StringBuilder(payment.getSuccessRedirectUrl()); successURL.append("?status=success&request_id=").append(payment.getRequestId()); payment.setSuccessRedirectUrl(successURL.toString()); } }  }
IdealDebitBicPaymentProcessor implements PaymentProcessor { @Override public void processPayment(Payment payment, PaymentOperationData data) throws WirecardPaymenException { BankAccount bankAccount = objectFactory.createBankAccount(); bankAccount.setBic(data.getBic()); bankAccount.setIban(data.getIban()); payment.setBankAccount(bankAccount); payment.setOrderNumber(null); if (StringUtils.isNotEmpty(payment.getRequestId())) { StringBuilder successURL = new StringBuilder(payment.getSuccessRedirectUrl()); successURL.append("?status=success&request_id=").append(payment.getRequestId()); payment.setSuccessRedirectUrl(successURL.toString()); } }  @Override void processPayment(Payment payment, PaymentOperationData data); ObjectFactory getObjectFactory(); @Required void setObjectFactory(ObjectFactory objectFactory); }
IdealDebitBicPaymentProcessor implements PaymentProcessor { @Override public void processPayment(Payment payment, PaymentOperationData data) throws WirecardPaymenException { BankAccount bankAccount = objectFactory.createBankAccount(); bankAccount.setBic(data.getBic()); bankAccount.setIban(data.getIban()); payment.setBankAccount(bankAccount); payment.setOrderNumber(null); if (StringUtils.isNotEmpty(payment.getRequestId())) { StringBuilder successURL = new StringBuilder(payment.getSuccessRedirectUrl()); successURL.append("?status=success&request_id=").append(payment.getRequestId()); payment.setSuccessRedirectUrl(successURL.toString()); } }  @Override void processPayment(Payment payment, PaymentOperationData data); ObjectFactory getObjectFactory(); @Required void setObjectFactory(ObjectFactory objectFactory);  }