示例#1
0
        /// <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);
        }
示例#2
0
        /// <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);
        }
示例#3
0
        /// <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);
        }