all method
Future<Response<RazorpayApiResponse<RazorpayPayment> > >
all({
- RazorpayPaymentQuery? params,
- void callback(
- RazorpayApiException?,
- Response<
RazorpayApiResponse< ?RazorpayPayment> >
Get all payments
@param params - Check doc for required params
Implementation
Future<Response<RazorpayApiResponse<RazorpayPayment>>> all({
RazorpayPaymentQuery? params,
void Function(
RazorpayApiException?,
Response<RazorpayApiResponse<RazorpayPayment>>?,
)? callback,
}) async {
var from = params?.from;
var to = params?.to;
final count = params?.count ?? 10;
final skip = params?.skip ?? 0;
if (from != null) {
from = normalizeDate(from);
}
if (to != null) {
to = normalizeDate(to);
}
final queryParams = {
'from': from,
'to': to,
'count': count,
'skip': skip,
if (params?.expand != null) 'expand[]': params!.expand,
};
return api.get<RazorpayApiResponse<RazorpayPayment>>(
{
'url': BASE_URL,
'data': queryParams,
},
callback: callback,
fromJsonFactory: (json) => RazorpayApiResponse<RazorpayPayment>.fromJson(
json,
(itemJson) =>
RazorpayPayment.fromJson(itemJson! as Map<String, dynamic>),
),
);
}