/** * Returns a {@link Problem} document if the order failed. */ @CheckForNull public Problem getError() { return getJSON().get("error").map(v -> v.asProblem(getLocation())).orElse(null); }
/** * Returns a {@link Problem} document if the order failed. */ @CheckForNull public Problem getError() { return getJSON().get("error").map(v -> v.asProblem(getLocation())).orElse(null); }
/** * Cancels a recurrent order. * * @since 2.3 */ public void cancelRecurrent() throws AcmeException { if (!getSession().getMetadata().isStarEnabled()) { throw new AcmeException("CA does not support short-term automatic renewals"); } LOG.debug("cancel"); try (Connection conn = getSession().connect()) { JSONBuilder claims = new JSONBuilder(); claims.put("status", "canceled"); conn.sendSignedRequest(getLocation(), claims, getLogin()); JSON json = conn.readJsonResponse(); if (json != null) { setJSON(json); } } }
/** * Cancels a recurrent order. * * @since 2.3 */ public void cancelRecurrent() throws AcmeException { if (!getSession().getMetadata().isStarEnabled()) { throw new AcmeException("CA does not support short-term automatic renewals"); } LOG.debug("cancel"); try (Connection conn = getSession().connect()) { JSONBuilder claims = new JSONBuilder(); claims.put("status", "canceled"); conn.sendSignedRequest(getLocation(), claims, getLogin()); JSON json = conn.readJsonResponse(); if (json != null) { setJSON(json); } } }