fetch method
Future<Response<RazorpayInvoice> >
fetch({
- required String invoiceId,
- void callback(
- RazorpayApiException?,
- Response<
RazorpayInvoice> ?
Fetches invoice entity with given id
@param invoiceId - The unique identifier of the invoice
Implementation
Future<Response<RazorpayInvoice>> fetch({
required String invoiceId,
void Function(RazorpayApiException?, Response<RazorpayInvoice>?)? callback,
}) async {
if (invoiceId.isEmpty) {
throw ArgumentError(MISSING_ID_ERROR);
}
final url = '$BASE_URL/$invoiceId';
return api.get<RazorpayInvoice>(
{'url': url},
fromJsonFactory: RazorpayInvoice.fromJson,
callback: callback,
);
}