delete method
Future<Response<RazorpayWebhookDeleteResponse> >
delete({
- required String webhookId,
- required String accountId,
- void callback(
- RazorpayApiException?,
- Response<
RazorpayWebhookDeleteResponse> ?
Delete a webhook (Only Partner context supported in JS?)
@param webhookId - The unique identifier of the webhook. @param accountId - The unique identifier of the partner account.
Implementation
Future<Response<RazorpayWebhookDeleteResponse>> delete({
// JS returns [], use specific model
required String webhookId,
required String accountId, // Required for partner context
void Function(
RazorpayApiException?,
Response<RazorpayWebhookDeleteResponse>?,
)? callback,
}) async {
if (webhookId.isEmpty) {
throw ArgumentError('webhookId is required');
}
if (accountId.isEmpty) {
throw ArgumentError(
'accountId is required for deleting webhooks in partner context',
);
}
return api.delete<RazorpayWebhookDeleteResponse>(
{
'version': 'v2',
'url': '$BASE_URL/$accountId$WEBHOOKS_BASE/$webhookId',
},
fromJsonFactory: RazorpayWebhookDeleteResponse.fromJson,
callback: callback,
);
}