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

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

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

import jp.webpay.model.Token;
import jp.webpay.request.CardRequest;
import lombok.NonNull;

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

    public Token create(@NonNull CardRequest request) {
        return Token.fromJsonResponse(client, client.post("/tokens", request.toForm()));
    }

    public Token retrieve(@NonNull String id) {
        assertId(id);
        return Token.fromJsonResponse(client, client.get("/tokens/" + id));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy