fetch method

Future<Response<RazorpaySettlement>> fetch({
  1. required String settlementId,
  2. void callback(
    1. RazorpayApiException?,
    2. Response<RazorpaySettlement>?
    )?,
})

Fetches a standard settlement given Settlement ID

@param settlementId - The unique identifier of the settlement.

Implementation

Future<Response<RazorpaySettlement>> fetch({
  required String settlementId,
  void Function(RazorpayApiException?, Response<RazorpaySettlement>?)?
      callback,
}) async {
  if (settlementId.isEmpty) {
    throw ArgumentError('settlementId is mandatory');
  }
  return api.get<RazorpaySettlement>(
    {'url': '$BASE_URL/$settlementId'},
    fromJsonFactory: RazorpaySettlement.fromJson,
    callback: callback,
  );
}