Skip to content

Codex/token storage component#18

Merged
thejohnnybot merged 18 commits into
mainfrom
codex/token-storage-component
May 28, 2026
Merged

Codex/token storage component#18
thejohnnybot merged 18 commits into
mainfrom
codex/token-storage-component

Conversation

@thejohnnybot
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 28, 2026 03:02
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PayabliSDKPaymentMethod Swift 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 updates PayabliComponent.configure signature.

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.

Comment thread Sources/PayabliSDKPaymentMethod/PayabliPaymentMethodTypes.swift Outdated
Comment thread Sources/PayabliSDKPaymentMethod/PayabliPaymentMethodTypes.swift
Comment thread Sources/PayabliSDKPaymentMethod/PayabliPaymentMethodViewModel.swift
Comment thread Sources/PayabliSDKPaymentMethod/PayabliPaymentMethodViewModel.swift
Comment thread Sources/PayabliSDKCore/Models/PayabliComponent.swift Outdated
Comment thread Example/PayabliDemo/Secrets.swift.sample
Comment thread Bridges/Flutter/PayabliSDKPlugin.swift Outdated
@thejohnnybot
Copy link
Copy Markdown
Contributor Author

Addressed the agent review feedback in 9afb5dd:

  • Made card CVV required consistently across the Swift API, ObjC/MAUI bridge, Flutter bridge, sample usage, and docs.
  • Tightened expiration validation so 6-digit inputs are rejected and the implementation matches the documented MMYY / MM/YY formats.
  • Clarified sensitive-field retention behavior and added coverage that failed submissions keep editable fields while clearing card CVV.
  • Restored the legacy PayabliTheme type and added a configure(config:theme:) compatibility shim so existing integrations have a migration path to configure(config:) and component-specific styling.
  • Replaced the sample entryPoint value with a placeholder in Secrets.swift.sample.
  • Fixed the Flutter bridge catch path by casting Error to NSError before building the Flutter error.

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/PayabliComponentCompatibilityTests

Result: 31 focused tests passed, plus dart format and git diff --check were clean.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 70 out of 84 changed files in this pull request and generated 3 comments.

Comment thread Sources/PayabliSDKCore/Models/PayabliComponent.swift
Comment thread Example/PayabliMAUIDemo/MainPage.xaml.cs
Comment thread Sources/PayabliSDKPaymentMethod/PayabliPaymentMethodSheet.swift
@thejohnnybot
Copy link
Copy Markdown
Contributor Author

Addressed the latest agent review comments in 0c171f5:

  • Removed the recursive PayabliComponent default shim. The new default path now delegates configure(config:) to the legacy configure(config:theme:), while the legacy default fails clearly if a conformer implements neither method. PayabliPaymentMethod now implements the legacy overload explicitly and routes it to the current configure(config:).
  • Added/kept focused coverage for the configure compatibility behavior, including the SDK component legacy overload.
  • Coalesced CardZipEntry.Text to an empty string in the MAUI sample before passing it to the non-nullable billingZip binding parameter.
  • Updated sheet detent sizing to use the actual GeometryReader container height minus safe-area insets instead of UIScreen.main.bounds.height, so split view / multi-window presentations use the real sheet space.
  • The earlier open view-model failure thread is covered by the existing failure-path tests: card failures retain editable fields and clear CVV; ACH failures retain editable fields.

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/PayabliComponentCompatibilityTests

Result: 31 focused tests passed, and git diff --check is clean.

@thejohnnybot thejohnnybot merged commit 21cf260 into main May 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants