Package com.coinbase.api.exception

Examples of com.coinbase.api.exception.CoinbaseException


    public RecurringPayment getRecurringPayment(String id) throws CoinbaseException, IOException {
        URL recurringPaymentUrl;
        try {
            recurringPaymentUrl = new URL(_baseUrl, "recurring_payments/" + id);
        } catch (MalformedURLException ex) {
            throw new CoinbaseException("Invalid payment id");
        }

        return get(recurringPaymentUrl, RecurringPaymentResponse.class).getRecurringPayment();
    }
View Full Code Here


    public RecurringPayment getSubscriber(String id) throws CoinbaseException, IOException {
        URL subscriberUrl;
        try {
            subscriberUrl = new URL(_baseUrl, "subscribers/" + id);
        } catch (MalformedURLException ex) {
            throw new CoinbaseException("Invalid subscriber id");
        }

        return get(subscriberUrl, RecurringPaymentResponse.class).getRecurringPayment();
    }
View Full Code Here

    public User updateUser(String userId, User userParams) throws CoinbaseException, IOException {
        URL userUrl;
        try {
            userUrl = new URL(_baseUrl, "users/" + userId);
        } catch (MalformedURLException ex) {
            throw new CoinbaseException("Invalid user id");
        }

        Request request = new Request();
        request.setUser(userParams);
View Full Code Here

    public Application getApplication(String id) throws IOException, CoinbaseException {
        URL applicationUrl;
        try {
            applicationUrl = new URL(_baseUrl, "oauth/applications/" + id);
        } catch (MalformedURLException ex) {
            throw new CoinbaseException("Invalid application id");
        }
        return get(applicationUrl, ApplicationResponse.class).getApplication();
    }
View Full Code Here

                _baseUrl,
                "reports/" + reportId +
                (_accountId != null ? "?account_id=" + _accountId : "")
            );
        } catch (MalformedURLException ex) {
            throw new CoinbaseException("Invalid report id");
        }
        return get(reportUrl, ReportResponse.class).getReport();
    }
View Full Code Here

                _baseUrl,
                "reports?page=" + page +
                (_accountId != null ? "&account_id=" + _accountId : "")
            );
        } catch (MalformedURLException ex) {
            throw new CoinbaseException("Invalid account id");
        }
        return get(reportsUrl, ReportsResponse.class);
    }
View Full Code Here

                _baseUrl,
                "account_changes?page=" + page +
                (_accountId != null ? "&account_id=" + _accountId : "")
            );
        } catch (MalformedURLException ex) {
            throw new CoinbaseException("Invalid account id");
        }
        return get(accountChangesUrl, AccountChangesResponse.class);
    }
View Full Code Here

        } catch (IOException e) {
            es = conn.getErrorStream();
            if (es != null) {
                String errorBody = IOUtils.toString(es, "UTF-8");
                if (conn.getContentType().toLowerCase().contains("json")) {
                    CoinbaseException cbEx = new CoinbaseException(errorBody);
                    cbEx.addSuppressed(e);
                    throw cbEx;
                }
            }
            throw e;
        } finally {
View Full Code Here

        return handleErrors(deserialize(doHttp(url, "DELETE", null), responseClass));
    }

    private static Transaction serializeAmount(Transaction transaction) throws CoinbaseException {
        if (transaction.getAmount() == null) {
            throw new CoinbaseException("Amount is a required field");
        }

        // Massage amount
        Money amount = transaction.getAmount();
        transaction.setAmount(null);
View Full Code Here

        return transaction;
    }

    private static Button serializePrice(Button button) throws CoinbaseException {
        if (button.getPrice() == null) {
            throw new CoinbaseException("Price is a required field");
        }

        // Massage amount
        Money price = button.getPrice();
        button.setPrice(null);
View Full Code Here

TOP

Related Classes of com.coinbase.api.exception.CoinbaseException

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.