fetch method
Future<Response<RazorpayOrder> >
fetch({
- required String orderId,
- void callback(
- RazorpayApiException?,
- Response<
RazorpayOrder> ?
Fetches an order given Order ID
@param orderId - The unique identifier of the order
Implementation
Future<Response<RazorpayOrder>> fetch({
required String orderId,
void Function(RazorpayApiException?, Response<RazorpayOrder>?)? callback,
}) async {
if (orderId.isEmpty) {
throw ArgumentError('`order_id` is mandatory');
}
return api.get<RazorpayOrder>(
{'url': '/orders/$orderId'},
fromJsonFactory: RazorpayOrder.fromJson,
callback: callback,
);
}