All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jp.webpay.api.Account Maven / Gradle / Ivy

There is a newer version: 1.2.1
Show newest version
package jp.webpay.api;

import jp.webpay.exception.ApiConnectionException;
import net.arnx.jsonic.JSON;

import java.util.Map;

public class Account extends Accessor {
    protected Account(WebPayClient client) {
        super(client);
    }

    public jp.webpay.model.Account retrieve() {
        return jp.webpay.model.Account.fromJsonResponse(client, client.get("/account"));
    }

    public boolean deleteData() {
        String json = client.delete("/account/data");

        try {
            Map data = JSON.decode(json);
            return (Boolean)data.get("deleted");
        } catch (net.arnx.jsonic.JSONException ignored) {
            throw ApiConnectionException.jsonException(json);
        } catch (ClassCastException ignored) {
            throw ApiConnectionException.jsonException(json);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy