Exemplo n.º 1
0
        /// <summary>
        /// update EFTBankAccount
        /// </summary>
        /// <param name="EFTBankAccount">EFTBankAccount</param>
        /// <returns>EFTBankAccount</returns>
        public EftBankAccounts Update(EftBankAccounts account)
        {
            account.SetRequiredFields(new List <string> {
                GlobalConstants.ProfileId
            });
            account.CheckRequiredFields();
            account.SetRequiredFields(new List <string> {
                GlobalConstants.TransitNumber,
                GlobalConstants.InstitutionId,
                GlobalConstants.AccountHolderName,
                GlobalConstants.BillingAddressId
            });
            account.CheckRequiredFields();
            account.SetOptionalFields(new List <string> {
                GlobalConstants.NickName,
                GlobalConstants.MerchantRefNum,
                GlobalConstants.AccountNumber
            });

            Request request = new Request(
                method: RequestType.Put,
                uri: PrepareUri("/profiles/" + account.ProfileId() + "/eftbankaccounts/" + account.Id()),
                body: account
                );
            dynamic response = _client.ProcessRequest(request);

            EftBankAccounts returnVal = new EftBankAccounts(response);

            returnVal.ProfileId(account.ProfileId());
            return(returnVal);
        }
Exemplo n.º 2
0
        /// <summary>
        ///Delete EFTBankAccount
        /// </summary>
        /// <param name="EFTBankAccount">EFTBankAccount</param>
        /// <returns>bool</returns>
        public bool Delete(EftBankAccounts account)
        {
            account.SetRequiredFields(new List <string> {
                GlobalConstants.ProfileId,
                GlobalConstants.Id
            });
            account.CheckRequiredFields();

            Request request = new Request(
                method: RequestType.Delete,
                uri: PrepareUri("/profiles/" + account.ProfileId() + "/eftbankaccounts/" + account.Id())
                );

            _client.ProcessRequest(request);
            return(true);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Get EFTBankAccount
        /// </summary>
        /// <param name="EFTBankAccount">EFTBankAccount</param>
        /// <returns>EFTBankAccount</returns>
        public EftBankAccounts Get(EftBankAccounts account)
        {
            account.SetRequiredFields(new List <string> {
                GlobalConstants.BillingAddressId,
                GlobalConstants.Id
            });
            account.CheckRequiredFields();
            Request request = new Request(
                method: RequestType.Get,
                uri: PrepareUri("/profiles/" + account.ProfileId() + "/eftbankaccounts/" + account.Id())
                );

            dynamic response = _client.ProcessRequest(request);

            EftBankAccounts returnVal = new EftBankAccounts(response);

            returnVal.ProfileId(account.ProfileId());
            return(returnVal);
        }