Package com.stripe.exception

Examples of com.stripe.exception.APIConnectionException


    return conn;
  }

  private static void throwInvalidCertificateException() throws APIConnectionException {
    throw new APIConnectionException("Invalid server certificate. You tried to connect to a server that has a revoked SSL certificate, which means we cannot securely send data to that server. Please email support@stripe.com if you need help connecting to the correct API server.");
  }
View Full Code Here


        break;
      case DELETE:
        conn = createDeleteConnection(url, query, apiKey);
        break;
      default:
        throw new APIConnectionException(
            String.format(
                "Unrecognized HTTP method %s. "
                    + "This indicates a bug in the Stripe bindings. Please contact "
                    + "support@stripe.com for assistance.",
                method));
      }
      // trigger the request
      int rCode = conn.getResponseCode();
      String rBody;
      Map<String, List<String>> headers;

      if (rCode >= 200 && rCode < 300) {
        rBody = getResponseBody(conn.getInputStream());
      } else {
        rBody = getResponseBody(conn.getErrorStream());
      }
      headers = conn.getHeaderFields();
      return new StripeResponse(rCode, rBody, headers);

    } catch (IOException e) {
      throw new APIConnectionException(
          String.format(
              "IOException during API request to Stripe (%s): %s "
                  + "Please check your internet connection and try again. If this problem persists,"
                  + "you should check Stripe's service status at https://twitter.com/stripestatus,"
                  + " or let us know at support@stripe.com.",
View Full Code Here

TOP

Related Classes of com.stripe.exception.APIConnectionException

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.