Skip to content

Introduce composed client#247

Merged
kiftio merged 1 commit into
mainfrom
client-pattern
Jun 2, 2026
Merged

Introduce composed client#247
kiftio merged 1 commit into
mainfrom
client-pattern

Conversation

@kiftio
Copy link
Copy Markdown
Contributor

@kiftio kiftio commented Jun 2, 2026

What changes are you making?

Adds a composed checkout communication client on Android and Swift to centralize how merchant clients and kit default handlers are combined.

The default handling policy is now explicit per method:

  • CheckoutProtocol.windowOpen: run the kit default only if the merchant client does not handle it.
  • CheckoutProtocol.error: always run the kit default after the merchant client, so unrecoverable checkout errors still dismiss the kit even when the merchant observes or responds to the message.

Also removes duplicate Android method constants for descriptor-backed methods and uses CheckoutProtocol.*.method instead. ec.ready remains bridge-local because it is not exposed as a public CheckoutProtocol descriptor.

Details

  • Added ComposedCheckoutCommunicationClient on Android and Swift.
  • Added DefaultClientBinding and DefaultClientPolicy.
  • Routed Android EmbeddedCheckoutProtocol and Swift CheckoutWebView through the composed client.
  • Changed default bindings to maps/dictionaries keyed by method.
  • Updated Android CheckoutCommunicationClient docs to clarify that ec.window.open_request is merchant-overridable.
  • Added focused policy tests on both platforms.

Testing

  • dev android test specific ComposedCheckoutCommunicationClientTest
  • dev android test specific EmbeddedCheckoutProtocolTest
  • dev swift test ComposedCheckoutCommunicationClientTests
  • dev swift test CheckoutWebViewTests

Before you merge

Important

  • I've added tests to support my implementation
  • I have read and agree with the Contribution Guidelines
  • I have read and agree with the Code of Conduct
  • I've updated the relevant platform README (platforms/swift/README.md and/or platforms/android/README.md)

Releasing a new Swift version?
  • I have bumped the version in ShopifyCheckoutKit.podspec
  • I have bumped the version in platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift
  • I have updated platforms/swift/CHANGELOG.md
  • I have updated the SwiftPM/CocoaPods version snippets in platforms/swift/README.md (major version only)
Releasing a new Android version?
  • I have bumped the versionName in platforms/android/lib/build.gradle
  • I have updated platforms/android/CHANGELOG.md
  • I have updated the Gradle/Maven version snippets in platforms/android/README.md

Tip

See the Contributing documentation for the full release process per platform.

@kiftio kiftio requested a review from a team as a code owner June 2, 2026 10:13
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 92%
91.59% (316/345) 87.25% (178/204) 100% (82/82)

Base automatically changed from 05-19-dismiss_on_unrecoverable to main June 2, 2026 13:55
@kiftio kiftio merged commit 45f7312 into main Jun 2, 2026
26 checks passed
@kiftio kiftio deleted the client-pattern branch June 2, 2026 14:21
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