addBankAccount method

Future<Response<RazorpayCustomerBankAccount>> addBankAccount({
  1. required String customerId,
  2. required RazorpayCustomerBankAccountRequestBody params,
  3. void callback(
    1. RazorpayApiException?,
    2. Response<RazorpayCustomerBankAccount>?
    )?,
})

Add Bank Account of Customer

@param customerId - The unique identifier of the customer. @param params - Check doc for required params

Implementation

Future<Response<RazorpayCustomerBankAccount>> addBankAccount({
  required String customerId,
  required RazorpayCustomerBankAccountRequestBody params,
  void Function(
    RazorpayApiException?,
    Response<RazorpayCustomerBankAccount>?,
  )? callback,
}) async {
  if (customerId.isEmpty) {
    throw ArgumentError('customerId is required');
  }
  return api.post<RazorpayCustomerBankAccount>(
    {
      'url': '/customers/$customerId/bank_account',
      'data': params.toJson(),
    },
    fromJsonFactory: RazorpayCustomerBankAccount.fromJson,
    callback: callback,
  );
}