package com.razorpay;



import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;
import org.json.JSONObject;

import java.io.IOException;
import java.util.List;


public class PaymentClient {

    /**
     * Make constructor package protected
     */
    PaymentClient() {
    }

    public Payment fetch(String id) throws IOException, RazorpayException {
        Response response = ApiUtils.getRequest(String.format("/payments/%s", id), null);
        return  Utils.processResponse(response);
    }

    public List<Payment> fetchAll(JSONObject options) throws IOException, RazorpayException {
        Response response = ApiUtils.getRequest("/payments", options);
        return Utils.processCollectionResponse(response);
    }

    public List<Payment> fetchAll() throws IOException, RazorpayException {
        return fetchAll(null);
    }
}

@@ -852,11 +852,1396 @@
 );%0A    %7D
+%0A%0A    public Payment capture(String id, String amount) throws IOException, RazorpayException %7B%0A        JSONObject options = new JSONObject();%0A        options.put(%22amount%22, amount);%0A        Response response = ApiUtils.postRequest(String.format(%22/payments/%25s/capture%22, id), options);%0A        return Utils.processResponse(response);%0A    %7D%0A%0A    public Refund refund(String id, JSONObject options) throws IOException, RazorpayException %7B%0A        Response response = ApiUtils.postRequest(String.format(%22/payments/%25s/refund%22, id), options);%0A        return Utils.processResponse(response);%0A    %7D%0A%0A    public Refund refund(String id) throws IOException, RazorpayException %7B%0A        return refund(id, null);%0A    %7D%0A%0A    public Refund fetchRefund(String id, String refundId) throws IOException, RazorpayException %7B%0A        Response response = ApiUtils.getRequest(String.format(%22/payments/%25s/refunds/%25s%22, id, refundId), null);%0A        return Utils.processResponse(response);%0A    %7D%0A%0A    public List%3CRefund%3E fetchAllRefunds(String id, JSONObject options) throws IOException, RazorpayException %7B%0A        Response response = ApiUtils.getRequest(String.format(%22/payments/%25s/refunds%22, id), options);%0A        return Utils.processCollectionResponse(response);%0A    %7D%0A%0A    public List%3CRefund%3E fetchAllRefunds(String id) throws IOException, RazorpayException %7B%0A        return fetchAllRefunds(id, null);%0A    %7D
 %0A%7D%0A

Add refund and capture methods to PaymentClient