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