public BoardingResponse SendApplication(string invitation, BoardingApplication application = null) { if (application == null) { throw new GatewayException("Application cannot be null."); } // authorize session with the invitation var authSession = Authenticate(Portal, invitation); // validate var content = ValidateApplication(authSession.RequestUrl, application); // use the return URL for the next call try { var response = SendRequest(authSession.RequestUrl, content.Content); return(BuildResponse(response)); } catch (GatewayException) { throw; } catch (Exception exc) { throw new GatewayException(exc.Message, exc); } }
public MultipartForm ValidateApplication(string url, BoardingApplication application) { var content = application.BuildForm(); var validationResponse = SendRequest(HttpMethod.Post, url + "/ValidateFieldValues", content.ToJson(), null, "application/json"); if (validationResponse.StatusCode == HttpStatusCode.OK) { var validationErrors = application.ProcessValidationResult(validationResponse.RawResponse); if (validationErrors.Count > 0) { throw new ValidationException(validationErrors); } else { return(content); } } throw new GatewayException("Unable to validate form for submission."); }
public BoardingResponse SubmitApplication(string invitation, BoardingApplication application, string configName = "default") { var conn = ServicesContainer.Instance.GetBoardingConnector(configName); return(conn.SendApplication(invitation, application)); }
public void NewApplication() { BoardingApplication application = _service.NewApplication(); // DBA Information application.MerchantInfo = new MerchantInfo { MerchantDbaName = "Automated Application", MerchantEmail = "*****@*****.**", MerchantPhone = "1234567890", MerchantEmailFirstName = "Russell", MerchantEmailLastName = "Everett", MerchantPrimaryContactPhone = "1234567890", MerchantStoreNumber = "123", MerchantNumberOfLocations = 1, MerchantStreet = "1 Heartland Way", MerchantCity = "Jeffersonville", MerchantStatesSelect = States.Indiana, MerchantZip = "12345", FederalTaxId = "123456789" }; application.LegalInfoSameAsMerchant = true; // business info application.BusinessInfo = new BusinessInfo { OwnershipTypeSelect = TypeofOwnershipSelect.SoleProprietorship, IsFederalIdSignersSsn = true, DataCompromiseOrComplianceInvestigation = false, EverFiledBankrupt = false, DateBusinessAcquired = new DateTime(2000, 1, 1), DataStorageOrMerchantServicer = false, DateAcceptingCreditCardsStarted = new DateTime(2000, 12, 12) }; // owners var owner = new OwnerOfficer { FirstName = "Russell", LastName = "Everett", Title = "Developer", DateOfBirth = new DateTime(1977, 09, 12), HomePhone = "1234567890", SSN = "123456789", OwnershipTypeSelect = OwnerOfficerSelect.Owner, Street = "1 Heartland Way", City = "Jeffersonville", Zip = "12345", StateSelect = States.Indiana, EquityOwnership = "100", EmailAddress = "*****@*****.**" }; application.OwnerOfficers.Add(owner); // banking information application.BankingInfo = new BankingInfo { BankName = "Wells Fargo", BankCity = "St. Louis", BankStatesSelect = States.Missouri, BankZip = "12345" }; // bank accounts application.BankingInfo.BankAccounts.Add(new BankAccount { AccountNumber = "12345678901234", TransitRouterAbaNumber = "123456789", AccountTypeSelect = BankAccountTypeSelect.Checking, TransferMethodTypeSelect = FundsTransferMethodSelect.DepositsAndFees }); _service.SubmitApplication("D9E5EEB0-7709-4E60-B0CE-0ABABC1EBACE", application); }