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

com.razorpay.VirtualAccountClient Maven / Gradle / Ivy

There is a newer version: 1.4.7
Show newest version
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);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy