Пример #1
0
  public boolean confirmPreAuth(PaymentAuthorizationDTO auth, PaymentDTOEx payment)
      throws PluggableTaskException {

    LOG.debug("Confirming pre-authorization for " + getProcessorName() + " gateway");

    if (!getProcessorName().equals(auth.getProcessor())) {
      /*  let the processor be called and fail, so the caller can do something
      about it: probably re-call this payment task as a new "process()" run */
      LOG.warn(
          "The processor of the pre-auth is not "
              + getProcessorName()
              + ", is "
              + auth.getProcessor());
    }

    CreditCardDTO card = payment.getCreditCard();
    if (card == null) {
      throw new PluggableTaskException(
          "Credit card is required capturing" + " payment: " + payment.getId());
    }

    if (!isApplicable(payment)) {
      LOG.error("This payment can not be captured" + payment);
      return true;
    }

    return doProcess(payment, SvcType.SETTLE, auth).shouldCallOtherProcessors();
  }
Пример #2
0
  public boolean confirmPreAuth(PaymentAuthorizationDTO auth, PaymentDTOEx paymentInfo)
      throws PluggableTaskException {
    LOG.debug("confirmPreAuth" + auth + " payment " + paymentInfo);
    if (!getFakeProcessorName().equals(auth.getProcessor())) {
      LOG.warn(
          "name of processor does not match " + getFakeProcessorName() + " " + auth.getProcessor());
    }

    if (!isPreAuthTransactionId(auth.getTransactionId())) {
      LOG.warn(
          "AuthorizationDTOEx with transaction id: "
              + auth.getTransactionId()
              + " is used as preauth data");
    }

    Result result = doFakeAuthorization(paymentInfo, null);

    LOG.debug("returning " + result);
    return result.shouldCallOtherProcessors();
  }