# upaymentskwt/uinterface-ios architecture

> Architecture diagram of the GitHub repository upaymentskwt/uinterface-ios, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/upaymentskwt/uinterface-ios
- Repository: https://github.com/upaymentskwt/uinterface-ios

## Overview

uInterfaceSDK is an iOS payment-integration SDK distributed as a prebuilt XCFramework, accompanied here by a sample app. The sample configures the SDK at launch, gathers payment and customer details, and invokes payment, invoice, refund, and card APIs; it also demonstrates customer-token handling. The SDK implementation is not present in the tree, so its internal processing and backend calls cannot be traced. The graph separates documented payment stages from the sample app’s visible API calls and utilities.

Main entry points: [`UInterfaceIOS/ViewController.swift`](https://github.com/upaymentskwt/uinterface-ios/blob/main/UInterfaceIOS/ViewController.swift) (Payment demo), [`UInterfaceSDK_Framework/uInterfaceSDK.xcframework`](https://github.com/upaymentskwt/uinterface-ios/tree/main/UInterfaceSDK_Framework/uInterfaceSDK.xcframework) (Payment API), [`UInterfaceIOS/AppDelegate.swift`](https://github.com/upaymentskwt/uinterface-ios/blob/main/UInterfaceIOS/AppDelegate.swift) (App startup), [`UInterfaceIOS/Utilities/JSONUtilities.swift`](https://github.com/upaymentskwt/uinterface-ios/blob/main/UInterfaceIOS/Utilities/JSONUtilities.swift) (JSON utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sample["Sample iOS app"]
  node_appstart["App startup<br/>[AppDelegate.swift]"]
  node_paymentui["Payment demo"]
  node_json["JSON utilities"]
  node_alerts["Alert presentation"]
end

subgraph group_payment["Payment workflow"]
  node_productorder["Product and order"]
  node_gateway["Gateway and tokens"]
  node_paymentrequest["Payment request"]
end

subgraph group_account["Customer and cards"]
  node_customer["Customer details"]
  node_customerkey["Customer token"]
  node_localprefs[("Local preferences")]
end

subgraph group_sdk["SDK integration"]
  node_paymentapi["Payment API"]
  node_invoice["Invoice API"]
  node_refund["Refund APIs"]
  node_cardapi["Card APIs"]
end

node_user(("App user"))
node_paymentbackend{{"Payment backend"}}

node_user -.->|"uses"| node_paymentui
node_appstart -->|"sets environment"| node_paymentapi
node_paymentui -->|"builds details"| node_productorder
node_paymentui -->|"builds details"| node_gateway
node_paymentui -->|"creates request"| node_paymentrequest
node_paymentui -->|"creates payment"| node_paymentapi
node_paymentui -->|"creates invoice"| node_invoice
node_paymentui -->|"manages refunds"| node_refund
node_paymentui -->|"manages cards"| node_cardapi
node_paymentui -->|"builds details"| node_customer
node_paymentui -->|"retrieves token"| node_customerkey
node_customerkey -->|"reads and writes"| node_localprefs
node_paymentui -->|"converts JSON"| node_json
node_paymentui -->|"presents alerts"| node_alerts
node_paymentapi -.->|"processes payments"| node_paymentbackend
node_invoice -.->|"submits invoice"| node_paymentbackend
node_refund -.->|"requests refunds"| node_paymentbackend
node_cardapi -.->|"manages card data"| node_paymentbackend

click node_appstart "https://github.com/upaymentskwt/uinterface-ios/blob/main/UInterfaceIOS/AppDelegate.swift"
click node_paymentui "https://github.com/upaymentskwt/uinterface-ios/blob/main/UInterfaceIOS/ViewController.swift"
click node_json "https://github.com/upaymentskwt/uinterface-ios/blob/main/UInterfaceIOS/Utilities/JSONUtilities.swift"
click node_alerts "https://github.com/upaymentskwt/uinterface-ios/blob/main/UInterfaceIOS/Extensions/UIViewController%2BAlerts.swift"
click node_productorder "https://github.com/upaymentskwt/uinterface-ios/tree/main/UInterfaceSDK_Framework/uInterfaceSDK.xcframework"
click node_gateway "https://github.com/upaymentskwt/uinterface-ios/tree/main/UInterfaceSDK_Framework/uInterfaceSDK.xcframework"
click node_paymentrequest "https://github.com/upaymentskwt/uinterface-ios/tree/main/UInterfaceSDK_Framework/uInterfaceSDK.xcframework"
click node_paymentapi "https://github.com/upaymentskwt/uinterface-ios/tree/main/UInterfaceSDK_Framework/uInterfaceSDK.xcframework"
click node_invoice "https://github.com/upaymentskwt/uinterface-ios/tree/main/UInterfaceSDK_Framework/uInterfaceSDK.xcframework"
click node_refund "https://github.com/upaymentskwt/uinterface-ios/tree/main/UInterfaceSDK_Framework/uInterfaceSDK.xcframework"
click node_cardapi "https://github.com/upaymentskwt/uinterface-ios/tree/main/UInterfaceSDK_Framework/uInterfaceSDK.xcframework"
click node_customer "https://github.com/upaymentskwt/uinterface-ios/tree/main/UInterfaceSDK_Framework/uInterfaceSDK.xcframework"
click node_customerkey "https://github.com/upaymentskwt/uinterface-ios/blob/main/UInterfaceIOS/ViewController.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_appstart,node_paymentui,node_json,node_alerts,node_user toneBlue
class node_productorder,node_gateway,node_paymentrequest toneAmber
class node_customer,node_customerkey,node_localprefs toneMint
class node_paymentapi,node_invoice,node_refund,node_cardapi toneRose
class node_paymentbackend toneIndigo
```

## Components

### Sample iOS app

- [App startup](https://github.com/upaymentskwt/uinterface-ios/blob/main/UInterfaceIOS/AppDelegate.swift): `UInterfaceIOS/AppDelegate.swift`
- [Payment demo](https://github.com/upaymentskwt/uinterface-ios/blob/main/UInterfaceIOS/ViewController.swift): `UInterfaceIOS/ViewController.swift`
- [JSON utilities](https://github.com/upaymentskwt/uinterface-ios/blob/main/UInterfaceIOS/Utilities/JSONUtilities.swift): `UInterfaceIOS/Utilities/JSONUtilities.swift`
- [Alert presentation](https://github.com/upaymentskwt/uinterface-ios/blob/main/UInterfaceIOS/Extensions/UIViewController%2BAlerts.swift): `UInterfaceIOS/Extensions/UIViewController+Alerts.swift`

### Payment workflow

- [Product and order](https://github.com/upaymentskwt/uinterface-ios/tree/main/UInterfaceSDK_Framework/uInterfaceSDK.xcframework): `UInterfaceSDK_Framework/uInterfaceSDK.xcframework`
- [Gateway and tokens](https://github.com/upaymentskwt/uinterface-ios/tree/main/UInterfaceSDK_Framework/uInterfaceSDK.xcframework): `UInterfaceSDK_Framework/uInterfaceSDK.xcframework`
- [Payment request](https://github.com/upaymentskwt/uinterface-ios/tree/main/UInterfaceSDK_Framework/uInterfaceSDK.xcframework): `UInterfaceSDK_Framework/uInterfaceSDK.xcframework`

### Customer and cards

- [Customer details](https://github.com/upaymentskwt/uinterface-ios/tree/main/UInterfaceSDK_Framework/uInterfaceSDK.xcframework): `UInterfaceSDK_Framework/uInterfaceSDK.xcframework`
- [Customer token](https://github.com/upaymentskwt/uinterface-ios/blob/main/UInterfaceIOS/ViewController.swift): `UInterfaceIOS/ViewController.swift`
- **Local preferences**

### SDK integration

- [Payment API](https://github.com/upaymentskwt/uinterface-ios/tree/main/UInterfaceSDK_Framework/uInterfaceSDK.xcframework): `UInterfaceSDK_Framework/uInterfaceSDK.xcframework`
- [Invoice API](https://github.com/upaymentskwt/uinterface-ios/tree/main/UInterfaceSDK_Framework/uInterfaceSDK.xcframework): `UInterfaceSDK_Framework/uInterfaceSDK.xcframework`
- [Refund APIs](https://github.com/upaymentskwt/uinterface-ios/tree/main/UInterfaceSDK_Framework/uInterfaceSDK.xcframework): `UInterfaceSDK_Framework/uInterfaceSDK.xcframework`
- [Card APIs](https://github.com/upaymentskwt/uinterface-ios/tree/main/UInterfaceSDK_Framework/uInterfaceSDK.xcframework): `UInterfaceSDK_Framework/uInterfaceSDK.xcframework`

### Other components

- **App user**
- **Payment backend**

## Connections

- App user → Payment demo: uses
- App startup → Payment API: sets environment (evidence: `UInterfaceIOS/AppDelegate.swift`)
- Payment demo → Product and order: builds details (evidence: `UInterfaceIOS/ViewController.swift`)
- Payment demo → Gateway and tokens: builds details (evidence: `UInterfaceIOS/ViewController.swift`)
- Payment demo → Payment request: creates request (evidence: `UInterfaceIOS/ViewController.swift`)
- Payment demo → Payment API: creates payment (evidence: `UInterfaceIOS/ViewController.swift`)
- Payment demo → Invoice API: creates invoice (evidence: `UInterfaceIOS/ViewController.swift`)
- Payment demo → Refund APIs: manages refunds (evidence: `UInterfaceIOS/ViewController.swift`)
- Payment demo → Card APIs: manages cards (evidence: `UInterfaceIOS/ViewController.swift`)
- Payment demo → Customer details: builds details (evidence: `UInterfaceIOS/ViewController.swift`)
- Payment demo → Customer token: retrieves token (evidence: `UInterfaceIOS/ViewController.swift`)
- Customer token → Local preferences: reads and writes (evidence: `UInterfaceIOS/ViewController.swift`)
- Payment demo → JSON utilities: converts JSON (evidence: `UInterfaceIOS/ViewController.swift`)
- Payment demo → Alert presentation: presents alerts (evidence: `UInterfaceIOS/Extensions/UIViewController+Alerts.swift`)
- Payment API → Payment backend: processes payments
- Invoice API → Payment backend: submits invoice
- Refund APIs → Payment backend: requests refunds
- Card APIs → Payment backend: manages card data
