Architecture
System Context
The Payments Service runs as 16 AWS Lambda functions. It exposes a REST API behind API Gateway and participates in the broader FloatMe platform as both an event producer (Kinesis) and consumer (DynamoDB Streams, SQS, EventBridge).
Inbound Traffic
| Source | Description |
|---|---|
|
IAM-authenticated requests from internal FloatMe services. All callers sign requests with AWS Signature V4. |
|
Webhook callbacks from JPM for payment status changes. Handled by the |
|
Work queue for JPM webhook events. Consumed by |
|
Daily ACH status polling jobs enqueued by |
|
Usio transaction sync jobs. Consumed by |
|
Usio token refresh jobs. Consumed by |
|
Prenote submission jobs. Consumed by |
|
Blocklist removal events triggered when a user updates their bank account. Consumed by |
|
One-off debit card repair jobs. Consumed by |
|
Change events from the payments table. Consumed by |
|
Payment lifecycle events consumed by |
EventBridge (schedule) |
CloudWatch rules trigger |
Outbound Traffic
| Destination | Description |
|---|---|
JPM (mTLS + JWS) |
ACH payment submission, prenote submission, and ACH status polling from |
Usio |
Pinless debit/credit token charges, ACH payment submission, and transaction data syncing. |
|
Payment lifecycle events published by |
Plaid |
Bank account and routing number retrieval for ACH setup. |
Slack |
Daily and hourly Usio merchant account balance reports sent by |
Lambda Functions
| Function | Trigger | Responsibility |
|---|---|---|
|
API Gateway (IAM) |
Primary REST API. Handles payment submission, debit card management, bank account operations, refunds, prenote requests, fraud checks, and blocklist management. See API Specification. |
|
API Gateway ( |
Receives JPM payment status webhook callbacks. Validates the request and enqueues the event to SQS for async processing. |
|
SQS ( |
Dequeues JPM webhook events and updates the corresponding payment record status in DynamoDB. |
|
EventBridge (daily, 15:30 UTC) |
Queries DynamoDB for payments in |
|
SQS ( |
Polls JPM and Usio APIs for the current status of an ACH payment. Marks cleared or returned payments and triggers downstream status updates. |
|
EventBridge (every 30 min, prod only) |
Enqueues Usio transaction sync jobs by date range and merchant account to the |
|
SQS ( |
Fetches transactions from the Usio API for a given date range and merchant account. Stores results in DynamoDB. |
|
EventBridge (daily, 15:00 UTC) |
Queries DynamoDB for debit cards that need Usio token refreshes and enqueues refresh jobs. |
|
SQS ( |
Refreshes Usio pinless debit/credit tokens and updates both the new |
|
SQS ( |
Submits ACH prenotes to JPM or Usio in batch. See Prenotes. |
|
DynamoDB Streams ( |
Transforms DynamoDB stream change records from the payments table into structured Kinesis events on the |
|
Kinesis ( |
Consumes payment events from the Kinesis stream. On specific ACH return codes (R02, R03, R04, R16 and JPM equivalents), auto-blocklists the user. See Blocklist. |
|
SQS ( |
Removes a user from the blocklist when they update their bank account. |
|
EventBridge (daily, 13:00 UTC) |
Syncs JPM transaction data to DynamoDB. |
|
EventBridge (daily 13:00 UTC + hourly, prod only) |
Reports Usio merchant account balances to Slack. |
|
SQS ( |
Repairs debit card records in bulk. Triggered manually by enqueuing jobs via |
Data Storage
DynamoDB
Storage spans two regions. The prod-payments single table lives in the primary region and holds payment records, v2 debit card records, and v2 bank account records. The named legacy tables — pinless-default-card (legacy debit card tokens), bank-accounts (KMS-encrypted ACH credentials), bank-account-history (bank account change log), and usio-debit-refunds (refund records) — live in us-east-1. Debit card and bank account writes currently target both the single table and the legacy tables as part of an ongoing migration.
See DynamoDB Tables for the full schema, key structure, and access pattern reference.
Event Flow
The kinesis-feeder Lambda transforms DynamoDB stream change records from prod-payments into structured events on the prod-payments Kinesis stream. Downstream consumers (float-service, subscription-service, blocklist-handler) react to payment status changes without polling.
See Event Flows for the full publish/consume topology, event types, and payload structure. See Payment Syncing for the ACH polling and JPM webhook flows that drive those status changes.
External Service Integrations
| Service | Integration |
|---|---|
JPM (JP Morgan Chase) |
ACH payment processor for subscription payments. The API Lambda submits payments, |
Usio |
Pinless debit/credit and ACH processor for float and subscription payments. The API Lambda submits payments; |
Plaid |
Bank account and routing number retrieval. Invoked during the bank account setup flow. |
AWS KMS |
Bank account and routing numbers are KMS-encrypted before storage. Decrypted at payment submission time. |
AWS Secrets Manager |
JPM mTLS certificates and Usio API credentials are stored in Secrets Manager and loaded once per Lambda cold start. |
User Service |
User profile data queried during payment and fraud check flows. |
GrowthBook |
Feature flags controlling payment routing behavior. Fetched at Lambda startup. |
Related Pages
-
Infrastructure — Lambda configuration details, queue and stream inventory, Terraform structure
-
JPM Integration — mTLS auth, ACH flow, webhook statuses
-
Usio Integration — Merchant accounts, pinless, ACH, sync
-
Payment Flow — End-to-end payment submission and status lifecycle
-
Payment Syncing — JPM webhooks, check-ach, Usio sync flows
-
DynamoDB Tables — Full DynamoDB schema
-
API Specification — Full OpenAPI spec