示例#1
0
        private void UpdateAchVault(Person person, PaymentInfo paymentInfo)
        {
            var vaultId = paymentInfo.TbnBankVaultId.GetValueOrDefault();

            var updateAchVaultRequest = new UpdateAchVaultRequest(
                _userName,
                _password,
                vaultId.ToString(CultureInfo.InvariantCulture),
                $"{paymentInfo.FirstName ?? person.FirstName} {paymentInfo.LastName ?? person.LastName}",
                new BillingAddress
            {
                FirstName = paymentInfo.FirstName ?? person.FirstName,
                LastName  = paymentInfo.LastName ?? person.LastName,
                Address1  = paymentInfo.Address ?? person.PrimaryAddress,
                City      = paymentInfo.City ?? person.PrimaryCity,
                State     = paymentInfo.State ?? person.PrimaryState,
                Zip       = paymentInfo.Zip ?? person.PrimaryZip,
                Email     = person.EmailAddress,
                Phone     = paymentInfo.Phone ?? person.HomePhone ?? person.CellPhone
            });

            var response = updateAchVaultRequest.Execute();

            if (response.ResponseStatus != ResponseStatus.Approved)
            {
                throw new Exception(
                          $"TransNational failed to update the ach account for people id: {person.PeopleId}, responseCode: {response.ResponseCode}, responseText: {response.ResponseText}");
            }
        }
        private void UpdateAchVault(Person person, PaymentInfo paymentInfo, string accountNumber, string routingNumber)
        {
            var vaultId = paymentInfo.TbnBankVaultId.GetValueOrDefault();

            var updateAchVaultRequest = new UpdateAchVaultRequest(
                _userName,
                _password,
                vaultId.ToString(CultureInfo.InvariantCulture),
                new Ach
            {
                NameOnAccount  = "{0} {1}".Fmt(paymentInfo.FirstName ?? person.FirstName, paymentInfo.LastName ?? person.LastName),
                AccountNumber  = accountNumber,
                RoutingNumber  = routingNumber,
                BillingAddress = new BillingAddress
                {
                    FirstName = paymentInfo.FirstName ?? person.FirstName,
                    LastName  = paymentInfo.LastName ?? person.LastName,
                    Address1  = paymentInfo.Address ?? person.PrimaryAddress,
                    City      = paymentInfo.City ?? person.PrimaryCity,
                    State     = paymentInfo.State ?? person.PrimaryState,
                    Zip       = paymentInfo.Zip ?? person.PrimaryZip,
                    Email     = person.EmailAddress,
                    Phone     = paymentInfo.Phone ?? person.HomePhone ?? person.CellPhone
                }
            });

            var response = updateAchVaultRequest.Execute();

            if (response.ResponseStatus != ResponseStatus.Approved)
            {
                throw new Exception(
                          "TransNational failed to update the ach account for people id: {0}, responseCode: {1}, responseText: {2}".Fmt(person.PeopleId, response.ResponseCode, response.ResponseText));
            }
        }
示例#3
0
        private void UpdateAchVault(Guid vaultGuid, Person person, string accountNumber, string routingNumber)
        {
            var updateAchVaultRequest = new UpdateAchVaultRequest(_id, _key, vaultGuid, accountNumber, routingNumber);

            var response = updateAchVaultRequest.Execute();

            if (!response.Success)
            {
                throw new Exception(
                          $"Sage failed to update the ach account for people id: {person.PeopleId}, message: {response.Message}");
            }
        }