fetch method
Future<Response<RazorpayItem> >
fetch({
- required String itemId,
- void callback(
- RazorpayApiException?,
- Response<
RazorpayItem> ?
Fetch an item given Item ID
@param itemId - The unique identifier of the item.
Implementation
Future<Response<RazorpayItem>> fetch({
required String itemId,
void Function(RazorpayApiException?, Response<RazorpayItem>?)? callback,
}) async {
if (itemId.isEmpty) {
throw ArgumentError('`item_id` is mandatory');
}
return api.get<RazorpayItem>(
{'url': '/items/$itemId'},
fromJsonFactory: RazorpayItem.fromJson,
callback: callback,
);
}