---
title: Generate customer session-transfer posts
summary: Builds browser-post payloads that hand a customer off to US Bank's hosted make-payment, manage-payment, or set-up-recurring-payment pages using a SAIF session-transfer wrapper service.
status: draft
owner: SAIF
last_reviewed: 2026-07-30
library: SAIF.Business.EPay.USBank
reference_type: package
operation_id: OP-EPAY-05
trigger: Caller invokes RemotePostFiller.FillMakePaymentRemotePost, FillManagePaymentRemotePost, or FillSetUpRecurringPaymentRemotePost
---

# Generate customer session-transfer posts

These three `RemotePostFiller` methods each populate a `RemotePost` object that a caller uses to redirect a customer's browser to a specific US Bank hosted page (make a payment, manage payments, or set up a recurring payment). All three follow the same pattern: call a SAIF-hosted session-transfer wrapper web service to obtain an opaque session string, then fill the `RemotePost` with the session-transfer URL, the session string, and the biller identifiers.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-EPAY-05 |
| **Trigger** | Caller invokes `RemotePostFiller.FillMakePaymentRemotePost`, `FillManagePaymentRemotePost`, or `FillSetUpRecurringPaymentRemotePost` |
| **Inputs** | Amount (make/set-up), product code (make/set-up), saved-balance ID (make payment only), due date (set-up only), `IPolicyInfoProvider`, `IUSBankUser`, `IUserInfoProvider` (make/set-up), `IPageInfoProvider` (make/set-up) |
| **Outputs** | The `inRemotePost` parameter populated in place with `URL`, `session`, `billerId`, and `billerGroupId` inputs |
| **Primary components** | `RemotePostFiller.FillMakePaymentRemotePost`, `RemotePostFiller.FillManagePaymentRemotePost`, `RemotePostFiller.FillSetUpRecurringPaymentRemotePost`, `RemotePostFiller.GetReturnURL`, `RemotePostFiller.ConfigurePolicyName` |
| **Entry point** | `Business\SAIF.Business.EPay.USBank\RemotePostFiller.vb` |

## Steps

1. **Resolve the session-transfer wrapper client.** Each method instantiates `wsUSBankSessionTransferServices1.Service1` and sets its URL from the `usBankEPayInterfaceServiceUrl` configuration setting.
2. **Resolve the biller ID.** `m_USBankCodes.GetBillerId(inPolicyInfo.IsVoluntaryPolicy)` returns the voluntary or assigned-risk biller ID depending on the policy's actual market.
3. **Make payment — normalize the return URL.** `GetReturnURL` takes the page's absolute request URI, rewrites `http://` to `https://` (throwing if the URL starts with neither scheme), strips any existing query string, and appends `?__SAIFPID=<ViewID>` ([BR-014](../business-rules.md#br-014-return-urls-are-rewritten-to-secure-saif-view-links)).
4. **Make payment — request the session string.** `GetMakePaymentSessionStringWithSavedBalanceID` is called with the biller group ID, biller ID, resolved product code, amount, US Bank user sequence number, password, the user's last/first name/email/phone, the normalized return URL, the policy number, the policy name (truncated to 80 characters with an ellipsis via `ConfigurePolicyName`), and the saved-balance ID.
   - On any exception: wrap and re-throw as `ApplicationException("Error generating session string: ...")`.
5. **Manage payment — request the session string.** `GetManagePaymentSessionString` is called with only the biller group ID, biller ID, US Bank user sequence number, and password — no return URL or policy context is needed for the manage-payment flow.
   - On any exception: wrap and re-throw as `ApplicationException`.
6. **Set-up recurring payment — normalize the return URL.** Same `GetReturnURL` normalization as step 3 ([BR-014](../business-rules.md#br-014-return-urls-are-rewritten-to-secure-saif-view-links)).
7. **Set-up recurring payment — request the session string.** `GetSetUpRecurringPaymentSessionString` is called with the biller group ID, biller ID, product code, amount, due date, US Bank user sequence number, password, name/email/phone, the normalized return URL, policy number, and truncated policy name.
   - On any exception: wrap and re-throw as `ApplicationException`.
8. **Populate the `RemotePost`.** For all three flows, once the session string is obtained: set `inRemotePost.URL` to `USBankCodes.SESSION_TRANSFER_URL`, and add `session`, `billerId`, and `billerGroupId` as post inputs.

## Process flow

The following diagram visualizes the shared pattern across the three customer-facing flows.

```mermaid
flowchart TD
	Start{Which customer flow?}
	Start -->|Make payment| MURL[Normalize return URL]
	MURL --> MReq[Call GetMakePaymentSessionStringWithSavedBalanceID]
	Start -->|Manage payment| PReq[Call GetManagePaymentSessionString]
	Start -->|Set up recurring| SURL[Normalize return URL]
	SURL --> SReq[Call GetSetUpRecurringPaymentSessionString]
	MReq --> Err{Call failed?}
	PReq --> Err
	SReq --> Err
	Err -->|Yes| Fail([Throw ApplicationException])
	Err -->|No| Fill[Set RemotePost.URL to session<br>transfer URL; add session,<br>billerId, billerGroupId inputs]
	Fill --> Done([RemotePost ready for browser redirect])
```

## Failure and edge-case behavior

- `GetReturnURL` throws if the page's absolute URI does not start with `http://` or `https://`, which stops make-payment and set-up-recurring-payment redirect construction before any session-string call is made ([BR-014](../business-rules.md#br-014-return-urls-are-rewritten-to-secure-saif-view-links)).
- The manage-payment flow requires no page context at all, so it cannot fail on return-URL validation the way the other two flows can.
- Any exception from the session-transfer wrapper service (network failure, wrapper-side error) is uniformly wrapped as an `ApplicationException`, discarding the original exception type but preserving its message via `ex.Message` and `InnerException`.
- Policy names longer than 80 characters are truncated with a trailing ellipsis before being sent as a product parameter, so very long names are not fully visible on the US Bank hosted page.

> **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

- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources

- `Business\SAIF.Business.EPay.USBank\RemotePostFiller.vb`
- `Business\SAIF.Business.EPay.USBank\USBankCodes.vb`
