Codex/token storage component#18
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request introduces a new opt-in PayabliSDKPaymentMethod component for saving card/ACH details as Payabli stored payment methods via POST /api/TokenStorage/add, and wires it through the SDK’s build/release tooling plus Flutter/MAUI and sample apps.
Changes:
- Adds
PayabliSDKPaymentMethodSwift package product with TokenStorage HTTP client, SwiftUI UI (inline + sheet), diagnostics redaction, and ObjC bridge. - Updates build/release scripts and root docs to include the new distributable module.
- Updates Flutter + MAUI bridges and example apps to exercise payment method flows; removes the old Core theme surface (
PayabliTheme) and updatesPayabliComponent.configuresignature.
Reviewed changes
Copilot reviewed 69 out of 83 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/PayabliSDKCoreTests/PayabliThemeTests.swift | Removes theme-related unit tests (theme feature removed). |
| Sources/PayabliSDKTapToPay/PayabliTTP.swift | Adds an explicit ObjC name for PayabliTTP; trims trailing whitespace. |
| Sources/PayabliSDKPaymentMethod/TokenStorageClient.swift | Adds TokenStorage /api/TokenStorage/add client with diagnostics hooks and response decoding. |
| Sources/PayabliSDKPaymentMethod/Resources/PayabliBrandAssets.xcassets/brand-visa.imageset/Contents.json | Adds Visa brand image asset metadata. |
| Sources/PayabliSDKPaymentMethod/Resources/PayabliBrandAssets.xcassets/brand-mastercard.imageset/Contents.json | Adds Mastercard brand image asset metadata. |
| Sources/PayabliSDKPaymentMethod/Resources/PayabliBrandAssets.xcassets/brand-discover.imageset/Contents.json | Adds Discover brand image asset metadata. |
| Sources/PayabliSDKPaymentMethod/Resources/PayabliBrandAssets.xcassets/brand-amex.imageset/Contents.json | Adds Amex brand image asset metadata. |
| Sources/PayabliSDKPaymentMethod/README.md | Adds maintainer-facing module README and maintenance checklist. |
| Sources/PayabliSDKPaymentMethod/PayabliSDKPaymentMethod.swift | Adds module namespace + version accessor; defines access-token provider typealias. |
| Sources/PayabliSDKPaymentMethod/PayabliPaymentMethodViewModel.swift | Adds form state + validation orchestration + submit flow + field-clearing logic. |
| Sources/PayabliSDKPaymentMethod/PayabliPaymentMethodUIKitTextField.swift | Adds UIKit-backed text field for finer control of sanitization/focus in SwiftUI. |
| Sources/PayabliSDKPaymentMethod/PayabliPaymentMethodStyle.swift | Adds SwiftUI styling environment + style DTOs for the component. |
| Sources/PayabliSDKPaymentMethod/PayabliPaymentMethodSheet.swift | Adds SDK-provided bottom-sheet presentation wrapper for the form. |
| Sources/PayabliSDKPaymentMethod/PayabliPaymentMethodInputLimits.swift | Adds shared constants for input length limits. |
| Sources/PayabliSDKPaymentMethod/PayabliPaymentMethodDiagnostics.swift | Adds request/response/failure diagnostics with redaction. |
| Sources/PayabliSDKPaymentMethod/PayabliPaymentMethod+ObjC.swift | Adds ObjC-friendly wrapper types for MAUI/ObjC hosts. |
| Sources/PayabliSDKPaymentMethod/PayabliPaymentMethod.swift | Adds the public component facade implementing PayabliComponent. |
| Sources/PayabliSDKCore/Public/PayabliTheme.swift | Removes the Core theme type and hex color parsing extension. |
| Sources/PayabliSDKCore/Public/PayabliConfig.swift | Updates config documentation to remove theme mention. |
| Sources/PayabliSDKCore/Networking/PayabliRequest.swift | Makes PayabliResponse explicitly constructible via a public init. |
| Sources/PayabliSDKCore/Models/PayabliComponent.swift | Changes component configuration API from configure(config:theme:) to configure(config:). |
| Scripts/render_public_manifests.sh | Adds PaymentMethod checksum variable to public manifest rendering. |
| Scripts/build_release_frameworks.sh | Adds PaymentMethod XCFramework build; improves xcpretty optionality. |
| README.md | Updates root README to mention the new PaymentMethod module/product. |
| Package.swift | Adds PayabliSDKPaymentMethod product/target and its test target. |
| Example/PayabliMAUIDemo/README.md | Updates MAUI demo docs to include payment method. |
| Example/PayabliMAUIDemo/Platforms/iOS/Program.cs | Adds MAUI iOS Program entry point. |
| Example/PayabliMAUIDemo/Platforms/iOS/Info.plist | Adds MAUI iOS Info.plist. |
| Example/PayabliMAUIDemo/Platforms/iOS/AppDelegate.cs | Adds MAUI iOS AppDelegate. |
| Example/PayabliMAUIDemo/PayabliMauiDemo.csproj | Updates demo target framework and binding reference conditions. |
| Example/PayabliMAUIDemo/MauiProgram.cs | Adds MAUI app builder wiring. |
| Example/PayabliMAUIDemo/MainPage.xaml.cs | Adds payment method calls via PayabliPaymentMethodObjC. |
| Example/PayabliMAUIDemo/MainPage.xaml | Adds UI fields/buttons for card + ACH payment method submission. |
| Example/PayabliMAUIDemo/App.xaml.cs | Adds MAUI app window setup. |
| Example/PayabliMAUIDemo/App.xaml | Adds MAUI app XAML. |
| Example/PayabliFlutterDemo/README.md | Updates Flutter demo docs to include payment method tab/flows. |
| Example/PayabliFlutterDemo/pubspec.yaml | Updates demo description. |
| Example/PayabliFlutterDemo/pubspec.lock | Adds/updates lockfile for current Flutter/Dart deps used by demo. |
| Example/PayabliFlutterDemo/lib/main.dart | Adds payment method tab + calls into Flutter bridge. |
| Example/PayabliDemo/Secrets.swift.sample | Extends sample secrets to include payment-method token retrieval and diagnostics flags. |
| Example/PayabliDemo/README.md | Updates SwiftUI demo docs to include payment method and QA mock modes. |
| Example/PayabliDemo/PaymentMethodQAView.swift | Adds payment method QA UI (inline + sheet) with diagnostics display. |
| Example/PayabliDemo/PaymentMethodQAMockTransport.swift | Adds local mock transport returning success/failure TokenStorage payloads. |
| Example/PayabliDemo/PaymentMethodQAConfiguration.swift | Adds QA environment config for the payment method sample. |
| Example/PayabliDemo/PaymentMethodQAApp.swift | Adds a payment-method-focused QA sample app entry point + diagnostics plumbing. |
| Example/PayabliDemo/PaymentMethodAddedView.swift | Adds a simple success destination view for payment method flow. |
| Example/PayabliDemo/PayabliDemoApp.swift | Adds PayabliPaymentMethod environment object to the main demo app. |
| Example/PayabliDemo/PayabliDemo.xcodeproj/project.pbxproj | Adds Xcode project wiring for the demo app and payment method module. |
| Example/PayabliDemo/LocalTokenServer/server.mjs | Adds local Node token server for payment method access token issuance/exchange. |
| Example/PayabliDemo/LocalTokenServer/README.md | Documents local token server usage and contract. |
| Example/PayabliDemo/LocalTokenServer/.gitignore | Ignores local token server .env and logs. |
| Example/PayabliDemo/LocalTokenServer/.env.example | Adds environment template for the local token server. |
| Example/PayabliDemo/Info.plist | Adds ATS local networking exception for local token server usage. |
| Example/PayabliDemo/HomeView.swift | Adds a payment method tab using PayabliPaymentMethodView. |
| Documentation/Plans/2026-05-06-architecture-refactor.md | Updates plan doc to remove reference to deleted theme tests. |
| Documentation/PaymentMethodOverview.md | Adds comprehensive PaymentMethod feature reference documentation. |
| Documentation/PaymentMethodIntegrationGuide.md | Adds integration guide for SwiftUI, Flutter, and MAUI payment method flows. |
| Bridges/README.md | Updates bridge docs to include payment method support. |
| Bridges/MAUI/PayabliEnums.cs | Adds missing enum declarations required by generated bindings. |
| Bridges/MAUI/PayabliBinding.cs | Extends binding definitions to include payment method ObjC surface. |
| Bridges/MAUI/Payabli.MAUI.csproj | Updates binding project to net10 and adds PaymentMethod XCFramework reference. |
| Bridges/Flutter/pubspec.yaml | Adds Flutter plugin pubspec for bridge package. |
| Bridges/Flutter/PayabliSDKPlugin.swift | Extends iOS Flutter plugin to configure + call payment method APIs. |
| Bridges/Flutter/payabli_sdk.dart | Changes top-level Dart entrypoint to re-export lib/payabli_sdk.dart. |
| Bridges/Flutter/lib/payabli_sdk.dart | Adds Dart API for TapToPay + PaymentMethod over MethodChannel/EventChannel. |
| .swiftformat | Excludes ThirdParty from formatting. |
| .gitignore | Ignores Flutter local tooling artifacts and normalizes docs/ entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Addressed the agent review feedback in
Verification run: xcodebuild test -scheme PayabliSDK-Package \
-destination platform=iOS Simulator,id=FDAA5045-F37E-42C6-8B2C-2D74012ADFEC \
-derivedDataPath /Users/johnny/Projects_V2/sdk-ios/build/PackageDerived \
-only-testing:PayabliSDKPaymentMethodTests \
-only-testing:PayabliSDKCoreTests/PayabliComponentCompatibilityTestsResult: 31 focused tests passed, plus |
|
Addressed the latest agent review comments in
Verification run: xcodebuild test -scheme PayabliSDK-Package \
-destination 'platform=iOS Simulator,id=FDAA5045-F37E-42C6-8B2C-2D74012ADFEC' \
-derivedDataPath /Users/johnny/Projects_V2/sdk-ios/build/PackageDerived \
-only-testing:PayabliSDKPaymentMethodTests \
-only-testing:PayabliSDKCoreTests/PayabliComponentCompatibilityTestsResult: 31 focused tests passed, and |
No description provided.