@Test public void canPerformShouldReturnFalseWhenPaymentTransactionsIsForACreditCardAndNoCaptureExists() { when(worldpayPaymentTransactionServiceMock.filterPaymentTransactionEntriesOfType(paymentTransactionModelMock, CAPTURE)).thenReturn(null); final boolean result = testObj.canPerform(actionContextMock); assertFalse(result); }
@Override public boolean canPerform(final ActionContext<OrderModel> actionContext) { OrderModel order = actionContext.getData(); return order != null && isReturnable(order) && isRefundable(order); }
WorldpayCreateReturnRequestAction extends AbstractComponentWidgetAdapterAware implements CockpitAction<OrderModel, OrderModel> { @Override public boolean canPerform(final ActionContext<OrderModel> actionContext) { OrderModel order = actionContext.getData(); return order != null && isReturnable(order) && isRefundable(order); } }
WorldpayCreateReturnRequestAction extends AbstractComponentWidgetAdapterAware implements CockpitAction<OrderModel, OrderModel> { @Override public boolean canPerform(final ActionContext<OrderModel> actionContext) { OrderModel order = actionContext.getData(); return order != null && isReturnable(order) && isRefundable(order); }  }
WorldpayCreateReturnRequestAction extends AbstractComponentWidgetAdapterAware implements CockpitAction<OrderModel, OrderModel> { @Override public boolean canPerform(final ActionContext<OrderModel> actionContext) { OrderModel order = actionContext.getData(); return order != null && isReturnable(order) && isRefundable(order); }  @Override boolean canPerform(final ActionContext<OrderModel> actionContext); @Override String getConfirmationMessage(ActionContext<OrderModel> actionContext); @Override boolean needsConfirmation(ActionContext<OrderModel> actionContext); @Override ActionResult<OrderModel> perform(ActionContext<OrderModel> actionContext); }
WorldpayCreateReturnRequestAction extends AbstractComponentWidgetAdapterAware implements CockpitAction<OrderModel, OrderModel> { @Override public boolean canPerform(final ActionContext<OrderModel> actionContext) { OrderModel order = actionContext.getData(); return order != null && isReturnable(order) && isRefundable(order); }  @Override boolean canPerform(final ActionContext<OrderModel> actionContext); @Override String getConfirmationMessage(ActionContext<OrderModel> actionContext); @Override boolean needsConfirmation(ActionContext<OrderModel> actionContext); @Override ActionResult<OrderModel> perform(ActionContext<OrderModel> actionContext);  }