fetchOndemandSettlementById method
Future<Response<RazorpayInstantSettlement> >
fetchOndemandSettlementById({
- required String settlementId,
- List<
String> ? expand, - void callback(
- RazorpayApiException?,
- Response<
RazorpayInstantSettlement> ?
Fetch on-demand settlement by ID
@param settlementId - The unique identifier of the settlement. @param params - Expand options.
Implementation
Future<Response<RazorpayInstantSettlement>> fetchOndemandSettlementById({
required String settlementId,
List<String>? expand, // Use List<String>
void Function(RazorpayApiException?, Response<RazorpayInstantSettlement>?)?
callback,
}) async {
if (settlementId.isEmpty) {
throw ArgumentError('settlementId is mandatory');
}
final queryParams = {
if (expand != null) 'expand[]': expand,
};
return api.get<RazorpayInstantSettlement>(
{
'url': '$BASE_URL/ondemand/$settlementId',
'data': queryParams.isNotEmpty ? queryParams : null,
},
fromJsonFactory: RazorpayInstantSettlement.fromJson,
callback: callback,
);
}