/// <summary> /// Create Mandates /// </summary> /// <param name="Mandates">Mandates</param> /// <returns>Mandates</returns> public Mandates Create(Mandates account, string accountName) { account.SetRequiredFields(new List <string> { GlobalConstants.Reference, GlobalConstants.ProfileId, GlobalConstants.BankAccountId }); account.CheckRequiredFields(); if (accountName.Equals("SEPA")) { accountName = "/sepabankaccounts/"; } else { accountName = "/bacsbankaccounts/"; } Request request = new Request( method: RequestType.Post, uri: PrepareUri("/profiles/" + account.ProfileId() + accountName + account.BankAccountId() + "/mandates"), body: account ); dynamic response = _client.ProcessRequest(request); Mandates returnVal = new Mandates(response); returnVal.ProfileId(account.ProfileId()); return(returnVal); }
/// <summary> /// update Mandates /// </summary> /// <param name="Mandates">Mandates</param> /// <returns>Mandates</returns> public Mandates Update(Mandates account) { account.SetRequiredFields(new List <string> { GlobalConstants.Status }); account.CheckRequiredFields(); Request request = new Request( method: RequestType.Put, uri: PrepareUri("/profiles/" + account.ProfileId() + "/mandates/" + account.Id()), body: account ); dynamic response = _client.ProcessRequest(request); Mandates returnVal = new Mandates(response); returnVal.ProfileId(account.ProfileId()); return(returnVal); }