deleteAllowedPayer method
Future<Response<DeleteAllowedPayerResponse> >
deleteAllowedPayer({
- required String virtualAccountId,
- required String allowedPayerId,
- void callback(
- RazorpayApiException?,
- Response<
DeleteAllowedPayerResponse> ?
Delete an Allowed Payer Account (TPV)
@param virtualAccountId - The unique identifier of the virtual account @param allowedPayerId - The ID of the allowed payer entry to delete.
Implementation
Future<Response<DeleteAllowedPayerResponse>> deleteAllowedPayer({
// Use specific empty model
required String virtualAccountId,
required String allowedPayerId,
void Function(RazorpayApiException?, Response<DeleteAllowedPayerResponse>?)?
callback,
}) async {
if (virtualAccountId.isEmpty) {
throw ArgumentError(ID_REQUIRED_MSG);
}
if (allowedPayerId.isEmpty) {
throw ArgumentError('allowedPayerId is mandatory');
}
// JS API returns null, map to empty response model
return api.delete<DeleteAllowedPayerResponse>(
{'url': '$BASE_URL/$virtualAccountId/allowed_payers/$allowedPayerId'},
fromJsonFactory: DeleteAllowedPayerResponse.fromJson,
callback: callback,
);
}