public BankAccount Save(BankAccount bankAccount) { var url = string.Format("BankAccount/Save?apikey={0}&companyid={1}", _apiKey, _companyId); var request = new RestRequest(url, Method.POST) { JsonSerializer = new JsonSerializer() }; request.RequestFormat = DataFormat.Json; request.AddBody(bankAccount); var response = _client.Execute<BankAccount>(request); StatusDescription = response.StatusDescription; StatusCode = response.StatusCode; return response.Data; }
public void SaveBankAccount() { var bankAccount = new BankAccount { AccountNumber = "123456789", Name = "New Bank Account", Active = true, Balance = 1000, BankName = "Bank Inc.", BranchName = "Branch Y", BranchNumber = "9988", DefaultPaymentMethodId = Enums.PaymentMethod.Cash }; var newBankAccount = bankAccountRequest.Save(bankAccount); }