Ejemplo 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);
        }
Ejemplo n.º 2
0
        public static EftBankAccounts CreatSampleEftBankAccount(Profile profile, Address address)
        {
            long accountNumber = LongRandom(1000, 999999999999);

            return(EftBankAccounts.Builder()
                   .MerchantRefNum(Guid.NewGuid().ToString())
                   .NickName("Sally Barclays Account")
                   .AccountNumber(accountNumber.ToString())
                   .AccountHolderName("XYZ Business")
                   .BillingAddressId(address.Id())
                   .ProfileId(profile.Id())
                   .TransitNumber("00000")
                   .InstitutionId("123")
                   .Build());
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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);
        }