com.razorpay.VirtualAccountClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of razorpay-java Show documentation
Show all versions of razorpay-java Show documentation
Official java bindings for the Razorpay API
package com.razorpay;
import java.util.List;
import org.json.JSONObject;
public class VirtualAccountClient extends ApiClient {
VirtualAccountClient(String auth) {
super(auth);
}
public VirtualAccount create(JSONObject request) throws RazorpayException {
return post(Constants.VIRTUAL_ACCOUNT_CREATE, request);
}
public VirtualAccount fetch(String id) throws RazorpayException {
return get(String.format(Constants.VIRTUAL_ACCOUNT_GET, id), null);
}
public List fetchAll() throws RazorpayException {
return fetchAll(null);
}
public List fetchAll(JSONObject request) throws RazorpayException {
return getCollection(Constants.VIRTUAL_ACCOUNT_LIST, request);
}
public VirtualAccount edit(String id, JSONObject request) throws RazorpayException {
return patch(String.format(Constants.VIRTUAL_ACCOUNT_EDIT, id), request);
}
public VirtualAccount close(String id) throws RazorpayException {
JSONObject request = new JSONObject();
request.put("status", "closed");
return patch(String.format(Constants.VIRTUAL_ACCOUNT_EDIT, id), request);
}
public List fetchPayments(String id) throws RazorpayException {
return fetchPayments(id, null);
}
public List fetchPayments(String id, JSONObject request) throws RazorpayException {
return getCollection(String.format(Constants.VIRTUAL_ACCOUNT_PAYMENTS, id), request);
}
}