/// <summary> /// update EFTBankAccount /// </summary> /// <param name="EFTBankAccount">EFTBankAccount</param> /// <returns>EFTBankAccount</returns> public EFTBankAccounts update(EFTBankAccounts account) { account.setRequiredFields(new List <string> { CustomerVaultConstants.profileId }); account.checkRequiredFields(); account.setRequiredFields(new List <string> { CustomerVaultConstants.transitNumber, CustomerVaultConstants.institutionId, CustomerVaultConstants.accountHolderName, CustomerVaultConstants.billingAddressId }); account.checkRequiredFields(); account.setOptionalFields(new List <string> { CustomerVaultConstants.nickName, CustomerVaultConstants.merchantRefNum, CustomerVaultConstants.accountNumber }); Request request = new Request( method: RequestType.PUT, uri: this.prepareURI("/profiles/" + account.profileId() + "/eftbankaccounts/" + account.id()), body: account ); dynamic response = this.client.processRequest(request); EFTBankAccounts returnVal = new EFTBankAccounts(response); returnVal.profileId(account.profileId()); return(returnVal); }
/// <summary> ///Delete EFTBankAccount /// </summary> /// <param name="EFTBankAccount">EFTBankAccount</param> /// <returns>bool</returns> public bool delete(EFTBankAccounts account) { account.setRequiredFields(new List <string> { CustomerVaultConstants.profileId, CustomerVaultConstants.id }); account.checkRequiredFields(); Request request = new Request( method: RequestType.DELETE, uri: this.prepareURI("/profiles/" + account.profileId() + "/eftbankaccounts/" + account.id()) ); this.client.processRequest(request); return(true); }
/// <summary> /// Get EFTBankAccount /// </summary> /// <param name="EFTBankAccount">EFTBankAccount</param> /// <returns>EFTBankAccount</returns> public EFTBankAccounts get(EFTBankAccounts account) { account.setRequiredFields(new List <string> { CustomerVaultConstants.billingAddressId, CustomerVaultConstants.id }); account.checkRequiredFields(); Request request = new Request( method: RequestType.GET, uri: this.prepareURI("/profiles/" + account.profileId() + "/eftbankaccounts/" + account.id()) ); dynamic response = this.client.processRequest(request); EFTBankAccounts returnVal = new EFTBankAccounts(response); returnVal.profileId(account.profileId()); return(returnVal); }