Package com.brienwheeler.svc.authorize_net

Examples of com.brienwheeler.svc.authorize_net.AuthorizeNetException


    try {
      CloseableHttpResponse httpResponse = httpClient.execute(httpPost);
      String response = EntityUtils.toString(httpResponse.getEntity());
      int start  = response.indexOf(ELEMENT_TOKEN_OPEN);
      if (start == -1)
        throw new AuthorizeNetException("error fetching hosted profile page token for " + userId + ", response: " + response);
      int end  = response.indexOf(ELEMENT_TOKEN_CLOSE);
      if (end == -1)
        throw new AuthorizeNetException("error fetching hosted profile page token for " + userId + ", response: " + response);
      return response.substring(start + ELEMENT_TOKEN_OPEN.length(), end);
       
    }
    catch (ClientProtocolException e) {
      throw new AuthorizeNetException(e.getMessage(), e);
    }
    catch (IOException e) {
      throw new AuthorizeNetException(e.getMessage(), e);
    }
  }
View Full Code Here


      case RRC_4_253:
        log.info("successfully authorized (but held for review) payment of " + amountToAuthorize + " for " + userId + ": " + responseReasonCode);
        return responseMap.get(ResponseField.TRANSACTION_ID);
      default :
        log.info("authorization failed in amount of " + amountToAuthorize + " for " + userId + ": " + responseReasonCode);
        throw new AuthorizeNetException(responseReasonCode.getReasonText());
    }
  }
View Full Code Here

    if (responseReasonCode == ResponseReasonCode.RRC_1_1) {
      log.info("successfully settled payment of " + amountToSettle + " for " + userId);
      return responseMap.get(ResponseField.TRANSACTION_ID);
    }
    else
      throw new AuthorizeNetException(responseReasonCode.getReasonText());
  }
View Full Code Here

        catch (InvocationTargetException e) { /* fall through */ }
        catch (IllegalAccessException e) { /* fall through */ }
        catch (InstantiationException e) { /* fall through */ }
        log.warn("Exception class " + exceptionClass.getSimpleName() + " failed reflection instantiation");
        // we know we want an exception but failed to instantiate it.  Throw ANE as default
        throw new AuthorizeNetException(responseReasonCode.getReasonText());
      }

      // umbrella processing for DECLINED
      if (responseCode == ResponseCode.DECLINED) {
        log.info(logOperation + " failed in amount of " + amount + " for " + userId + ": " + responseReasonCode);
        throw new PaymentDeclinedException(responseReasonCode.getReasonText());
      }
    }
   
    // map all other failures (where no DirectResponseMap or RRC may not be in exceptionMap) into ANE
    if (!result.isOk()) {
      String message = createErrorMessage(result);
      log.warn(logOperation + " failed for " + userId + ": " + message);
      throw new AuthorizeNetException(message);
    }
   
    return result;
  }
View Full Code Here

TOP

Related Classes of com.brienwheeler.svc.authorize_net.AuthorizeNetException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.