deleteBankAccount method
Future<Response<RazorpayCustomerBankAccount> >
deleteBankAccount({
- required String customerId,
- required String bankAccountId,
- void callback(
- RazorpayApiException?,
- Response<
RazorpayCustomerBankAccount> ?
Delete Bank Account of Customer
@param customerId - The unique identifier of the customer. @param bankAccountId - The bank_id that needs to be deleted.
Implementation
Future<Response<RazorpayCustomerBankAccount>> deleteBankAccount({
// Assuming it returns the deleted object or success status
required String customerId,
required String bankAccountId,
void Function(
RazorpayApiException?,
Response<RazorpayCustomerBankAccount>?,
)? callback,
}) async {
if (customerId.isEmpty) {
throw ArgumentError('customerId is required');
}
if (bankAccountId.isEmpty) {
throw ArgumentError('bankAccountId is required');
}
// API might return empty body, adjust T if necessary
return api.delete<RazorpayCustomerBankAccount>(
{'url': '/customers/$customerId/bank_account/$bankAccountId'},
fromJsonFactory: RazorpayCustomerBankAccount
.fromJson, // Adjust if response is different
callback: callback,
);
}