Add a bank account¶
Add-a-bank-account submits a single ACH account (checking or savings, business or consumer) to US Bank so it can be referenced by a US Bank user ID in later payment or recurring-authorization calls. There is no local database persistence in this operation — the account itself lives only at US Bank, keyed by the account key returned in the response.
| Field | Value |
|---|---|
| Operation ID | OP-EPAY-02 |
| Trigger | Caller invokes USBankAPIs.AddBankAccount(inBankAccount, inUSBankUser, inIsPolicyVoluntary) |
| Inputs | IBankAccount (encrypted account number, encrypted routing number, nickname, business/consumer flag, checking/savings flag); IUSBankUser (US Bank user sequence number); policy voluntary/assigned-risk flag |
| Outputs | AddBankAccountResults carrying a success flag and, on success, the US Bank-assigned account key |
| Primary components | USBankAPIs.AddBankAccount, USBankAPIs.GetFilledUSBankBankAccountInfo, USBankAPIs.GetFilledAddBankAccountRequest |
| Entry point | Business\SAIF.Business.EPay.USBank\USBankAPIs.vb |
Steps¶
- Classify the account category.
GetFilledUSBankBankAccountInfosetsaccountCategoryto Business or Consumer based oninBankAccount.IsBusiness/IsConsumer(BR-012). - If neither flag is true: throw
ApplicationException("Bank account must be business or consumer"). - Decrypt and normalize the account number.
SAIF.Security.clsSecureEncrypt.DecryptStringdecrypts the stored account number, and spaces are stripped from the result. - Classify the account type.
accountTypeis set to Checking or Savings based oninBankAccount.IsChecking/IsSavings(BR-012). - If neither flag is true: throw
ApplicationException("Bank account must be checking or savings"). - Decrypt the routing number. The bank routing number is decrypted the same way as the account number.
- Normalize the nickname. The nickname has invalid characters stripped (
RemoveInvalidUSBankAccountNickNameCharacters) and is truncated to 20 characters (BR-011). - Build the add-account request.
GetFilledAddBankAccountRequestwraps the normalized bank account, resolves the biller credential from the voluntary/assigned-risk flag, and sets the request'suserIDto the US Bank user's sequence number as a string. - Call the SOAP client.
AddBankAccountis invoked on theepayWebServiceServiceclient obtained through the SAIF-certificate-authenticatedGetWebService()helper. - On a transport-level failure (exception): wrap and re-throw as an
ApplicationException. - Interpret the response code. If the response code is non-zero:
- If the code is
75or5025(duplicate account): returnAddBankAccountResults(False, String.Empty)— a handled, non-exceptional outcome (BR-013). - Otherwise: concatenate all response messages and throw an
ApplicationException. - Return the success result. If the response code is zero, return
AddBankAccountResults(True, AddBAResponse.accountKey).
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([AddBankAccount bankAccount, usBankUser, isVoluntary]) --> Category{Business or consumer?}
Category -->|Neither| ErrCat([Throw: must be business or consumer])
Category -->|One set| Decrypt[Decrypt account number and routing number]
Decrypt --> Type{Checking or savings?}
Type -->|Neither| ErrType([Throw: must be checking or savings])
Type -->|One set| Nick[Normalize and shorten nickname]
Nick --> Call[Call AddBankAccount SOAP operation]
Call --> Code{Response code}
Code -->|0| Success([Return Success = True, AccountKey])
Code -->|75 or 5025| Dup([Return Success = False,<br>empty AccountKey])
Code -->|Other non-zero| Fail([Throw ApplicationException<br>with response message])
Failure and edge-case behavior¶
- Missing or ambiguous account category/type throws before any network call is made, so malformed metadata never reaches US Bank (BR-012).
- Duplicate-account response codes (
75,5025) are the only response codes translated into a handled failure result; every other non-zero code is treated as an exceptional failure (BR-013). - The account number and routing number must already be encrypted with the SAIF encryption utility before this operation runs; decryption failure surfaces as whatever exception
clsSecureEncrypt.DecryptStringraises, uncaught by this method.* - There is no local persistence of the returned account key by this operation; callers are responsible for storing it if it needs to be reused.*
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Related documentation¶
Sources¶
Business\SAIF.Business.EPay.USBank\USBankAPIs.vb