toJson method

Map<String, dynamic> toJson()

Converts the PEBankAccount object to a JSON map.

This method is useful for serializing the object for API communication.

Example:

PEBankAccount bankAccount = PEBankAccount(token: "abc123", accountData: accountData);
Map<String, dynamic> jsonData = bankAccount.toJson();

Implementation

Map<String, dynamic> toJson() {
  return {
    'token': token,
    'account_data': accountData.toJson(),
  };
}