/// <summary> /// update ACHBankAccount /// </summary> /// <param name="ACHBankAccount">ACHBankAccount</param> /// <returns>ACHBankAccount</returns> public ACHBankAccounts update(ACHBankAccounts account) { account.setRequiredFields(new List <string> { CustomerVaultConstants.profileId }); account.checkRequiredFields(); account.setRequiredFields(new List <string> { CustomerVaultConstants.accountHolderName, CustomerVaultConstants.routingNumber, CustomerVaultConstants.billingAddressId, CustomerVaultConstants.accountType, }); 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() + "/achbankaccounts/" + account.id()), body: account ); dynamic response = this.client.processRequest(request); ACHBankAccounts returnVal = new ACHBankAccounts(response); returnVal.profileId(account.profileId()); return(returnVal); }
/// <summary> ///Delete ACHBankAccount /// </summary> /// <param name="ACHBankAccount">ACHBankAccount</param> /// <returns>bool</returns> public bool delete(ACHBankAccounts 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() + "/achbankaccounts/" + account.id()) ); this.client.processRequest(request); return(true); }
/// <summary> /// Get ACHBankAccount /// </summary> /// <param name="ACHBankAccount">ACHBankAccount</param> /// <returns>ACHBankAccount</returns> public ACHBankAccounts get(ACHBankAccounts account) { account.setRequiredFields(new List <string> { CustomerVaultConstants.profileId, CustomerVaultConstants.id }); account.checkRequiredFields(); Request request = new Request( method: RequestType.GET, uri: this.prepareURI("/profiles/" + account.profileId() + "/achbankaccounts/" + account.id()) ); dynamic response = this.client.processRequest(request); ACHBankAccounts returnVal = new ACHBankAccounts(response); returnVal.profileId(account.profileId()); return(returnVal); }