@Override
 protected void validateForm(final ActionContext context) {
   if (shouldValidateTransactionPassword(context, resolveTransfer(context))) {
     final ScheduledPaymentForm form = context.getForm();
     if (StringUtils.isEmpty(form.getTransactionPassword())) {
       throw new ValidationException(
           "_transactionPassword", "login.transactionPassword", new RequiredError());
     }
   }
 }
  @Override
  protected ActionForward handleSubmit(final ActionContext context) throws Exception {
    Transfer transfer = resolveTransfer(context);

    // Validate the transaction password if needed
    if (shouldValidateTransactionPassword(context, transfer)) {
      final ScheduledPaymentForm form = context.getForm();
      context.checkTransactionPassword(form.getTransactionPassword());
    }

    // Perform the actual payment
    try {
      transfer = scheduledPaymentService.processTransfer(transfer);
    } catch (final CreditsException e) {
      return context.sendError(actionHelper.resolveErrorKey(e), actionHelper.resolveParameters(e));
    } catch (final UnexpectedEntityException e) {
      return context.sendError("payment.error.invalidTransferType");
    }
    return ActionHelper.redirectWithParam(
        context.getRequest(),
        context.getSuccessForward(),
        "paymentId",
        transfer.getScheduledPayment().getId());
  }