-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathAddonClient.java
More file actions
41 lines (33 loc) · 1.14 KB
/
AddonClient.java
File metadata and controls
41 lines (33 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.razorpay;
import java.util.List;
import org.json.JSONObject;
public class AddonClient extends ApiClient {
AddonClient(String auth) {
super(auth);
}
// To create an Addon, use the createAddon method of SubscriptionClient
public Addon fetch(String id) throws RazorpayException {
return get(String.format(Constants.ADDON_GET, id), null);
}
/**
* It is wrapper of fetchAll with parameter here sending null defines fetchAll
* with a default values without filteration
* @throws RazorpayException RazorpayException
* @return List of AddOns
*/
public List<Addon> fetchAll() throws RazorpayException {
return fetchAll(null);
}
/**
* This method get list of Addons filtered by parameters @request
* @throws RazorpayException RazorpayException
* @param request JSONObject request
* @return List of AddOns
*/
public List<Addon> fetchAll(JSONObject request) throws RazorpayException {
return getCollection(Constants.ADDON_LIST, request);
}
public List<Addon> delete(String id) throws RazorpayException {
return delete(String.format(Constants.ADDON_DELETE, id), null);
}
}