@@ -39,9 +39,22 @@ public Response runVerifyTransaction(int id) {
39
39
* Query previously initiated transactions. You can do a single or bulk query with the endpoint depending on your use case.
40
40
* @return ListResponse
41
41
*/
42
- public ListResponse runGetTransactions () {
42
+ public ListResponse runGetTransactions (Optional <String > from , Optional <String > to , Optional <String > page ,
43
+ Optional <String > customer_email ,Optional <String > status ,Optional <String > tx_ref ,
44
+ Optional <String > customer_fullname , Optional <String > currency ) {
45
+
46
+ List <NameValuePair > nameValuePairs = new ArrayList <>();
47
+ from .ifPresent (String -> nameValuePairs .add (new BasicNameValuePair ("from" , from .get ())));
48
+ to .ifPresent (String -> nameValuePairs .add (new BasicNameValuePair ("to" , to .get ())));
49
+ page .ifPresent (String -> nameValuePairs .add (new BasicNameValuePair ("page" , page .get ())));
50
+ customer_email .ifPresent (String -> nameValuePairs .add (new BasicNameValuePair ("customer_email" , customer_email .get ())));
51
+ status .ifPresent (String -> nameValuePairs .add (new BasicNameValuePair ("status" , status .get ())));
52
+ tx_ref .ifPresent (String -> nameValuePairs .add (new BasicNameValuePair ("tx_ref" , tx_ref .get ())));
53
+ customer_fullname .ifPresent (String -> nameValuePairs .add (new BasicNameValuePair ("customer_fullname" , customer_fullname .get ())));
54
+ currency .ifPresent (String -> nameValuePairs .add (new BasicNameValuePair ("currency" , currency .get ())));
55
+
43
56
return Optional .of (get (getProperty ("VERIFY_TRANSACTION_ENDPOINT" ),
44
- GET_TRANSACTION , null ))
57
+ GET_TRANSACTION , nameValuePairs ))
45
58
.map (ListResponse ::toListResponse ).orElseThrow (() -> new RuntimeException (ERROR ));
46
59
}
47
60
@@ -91,9 +104,18 @@ public ListResponse runViewTimeline(int id) {
91
104
}
92
105
93
106
public class Refunds {
94
- public ListResponse runGet () {
107
+ public ListResponse runGet (Optional <String > from , Optional <String > to , Optional <String > status ,
108
+ Optional <String > currency ,Optional <String > id ) {
109
+
110
+ List <NameValuePair > nameValuePairs = new ArrayList <>();
111
+ from .ifPresent (String -> nameValuePairs .add (new BasicNameValuePair ("from" , from .get ())));
112
+ to .ifPresent (String -> nameValuePairs .add (new BasicNameValuePair ("to" , to .get ())));
113
+ currency .ifPresent (String -> nameValuePairs .add (new BasicNameValuePair ("currency" , currency .get ())));
114
+ id .ifPresent (String -> nameValuePairs .add (new BasicNameValuePair ("id" , id .get ())));
115
+ status .ifPresent (String -> nameValuePairs .add (new BasicNameValuePair ("status" , status .get ())));
116
+
95
117
return Optional .of (get (getProperty ("REFUND_ENDPOINT" ),
96
- REFUND , null ))
118
+ REFUND , nameValuePairs ))
97
119
.map (ListResponse ::toListResponse ).orElseThrow (() -> new RuntimeException (ERROR ));
98
120
}
99
121
0 commit comments