Ejemplo n.º 1
0
        public TransactionResponse PayWithCheck(int peopleId, decimal amt, string routing, string acct,
                                                string description, int tranid, string email, string first, string middle, string last, string suffix,
                                                string addr, string addr2, string city, string state, string country, string zip, string phone)
        {
            var type = AchType(peopleId);
            var ach  = new Ach
            {
                NameOnAccount  = $"{first} {last}",
                AccountNumber  = acct,
                RoutingNumber  = routing,
                Type           = type,
                BillingAddress = new BillingAddress
                {
                    FirstName = first,
                    LastName  = last,
                    Address1  = addr,
                    Address2  = addr2,
                    City      = city,
                    State     = state,
                    Country   = country,
                    Zip       = zip,
                    Email     = email,
                    Phone     = phone
                }
            };
            var achSaleRequest = new AchSaleRequest(
                _userName,
                _password,
                ach,
                amt,
                tranid.ToString(CultureInfo.InvariantCulture),
                description,
                peopleId.ToString(CultureInfo.InvariantCulture));

            var response = achSaleRequest.Execute();

            if (type == "savings")
            {
                var s = JsonConvert.SerializeObject(ach, Formatting.Indented).Replace("\r\n", "\n");
                var c = db.Content("AchSavingsLog", "-", ContentTypeCode.TypeText);
                c.Body = $"--------------------------\n{DateTime.Now:g}\ntranid={response.TransactionId}\n\n{s}\n{c.Body}";
                db.SubmitChanges();
            }

            return(new TransactionResponse
            {
                Approved = response.ResponseStatus == ResponseStatus.Approved,
                AuthCode = response.AuthCode,
                Message = response.ResponseText,
                TransactionId = response.TransactionId
            });
        }
Ejemplo n.º 2
0
        public TransactionResponse PayWithCheck(int peopleId, decimal amt, string routing, string acct,
                                                string description, int tranid, string email, string first, string middle, string last, string suffix,
                                                string addr, string addr2, string city, string state, string country, string zip, string phone)
        {
            var achSaleRequest = new AchSaleRequest(
                _userName,
                _password,
                new Ach
            {
                NameOnAccount  = $"{first} {last}",
                AccountNumber  = acct,
                RoutingNumber  = routing,
                BillingAddress = new BillingAddress
                {
                    FirstName = first,
                    LastName  = last,
                    Address1  = addr,
                    Address2  = addr2,
                    City      = city,
                    State     = state,
                    Country   = country,
                    Zip       = zip,
                    Email     = email,
                    Phone     = phone
                }
            },
                amt,
                tranid.ToString(CultureInfo.InvariantCulture),
                description,
                peopleId.ToString(CultureInfo.InvariantCulture));

            var response = achSaleRequest.Execute();

            return(new TransactionResponse
            {
                Approved = response.ResponseStatus == ResponseStatus.Approved,
                AuthCode = response.AuthCode,
                Message = response.ResponseText,
                TransactionId = response.TransactionId
            });
        }
Ejemplo n.º 3
0
        public TransactionResponse PayWithCheck(int peopleId, decimal amt, string routing, string acct, string description, int tranid, string email, string first, string middle, string last, string suffix, string addr, string addr2, string city, string state, string country, string zip, string phone)
        {
            var achSaleRequest = new AchSaleRequest(_id,
                                                    _key,
                                                    _originatorId,
                                                    new Ach
            {
                FirstName      = first,
                MiddleInitial  = middle.Truncate(1) ?? "",
                LastName       = last,
                Suffix         = suffix,
                AccountNumber  = acct,
                RoutingNumber  = routing,
                BillingAddress = new BillingAddress
                {
                    Address1 = addr,
                    City     = city,
                    State    = state,
                    Country  = country,
                    Zip      = zip,
                    Email    = email,
                    Phone    = phone
                }
            },
                                                    amt,
                                                    tranid.ToString(CultureInfo.InvariantCulture));

            var response = achSaleRequest.Execute();

            return(new TransactionResponse
            {
                Approved = response.ApprovalIndicator == ApprovalIndicator.Approved,
                AuthCode = response.Code,
                Message = response.Message,
                TransactionId = response.Reference
            });
        }