/// <summary> /// Create Mandates /// </summary> /// <param name="Mandates">Mandates</param> /// <returns>Mandates</returns> public Mandates create(Mandates account, string accountName) { account.setRequiredFields(new List <string> { CustomerVaultConstants.reference, CustomerVaultConstants.profileId, CustomerVaultConstants.bankAccountId }); account.checkRequiredFields(); if (accountName.Equals("SEPA")) { accountName = "/sepabankaccounts/"; } else { accountName = "/bacsbankaccounts/"; } Request request = new Request( method: RequestType.POST, uri: this.prepareURI("/profiles/" + account.profileId() + accountName + account.bankAccountId() + "/mandates"), body: account ); dynamic response = this.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> { CustomerVaultConstants.status }); account.checkRequiredFields(); Request request = new Request( method: RequestType.PUT, uri: this.prepareURI("/profiles/" + account.profileId() + "/mandates/" + account.id()), body: account ); dynamic response = this.client.processRequest(request); Mandates returnVal = new Mandates(response); returnVal.profileId(account.profileId()); return(returnVal); }