Skip to content

[Android] Add support for ec_auth and ec_color_scheme#326

Merged
kiftio merged 1 commit into
mainfrom
06-24-add_support_for_ec_auth_and_ec_color_scheme
Jun 25, 2026
Merged

[Android] Add support for ec_auth and ec_color_scheme#326
kiftio merged 1 commit into
mainfrom
06-24-add_support_for_ec_auth_and_ec_color_scheme

Conversation

@kiftio

@kiftio kiftio commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What changes are you making?

The EmbeddedCheckoutProtocol.url() function previously accepted a flat List<String> for delegations. This PR introduces a typed Options class and a typed Delegation class to the Kotlin ECP library, replacing the raw string list with a structured, extensible API.

Key changes:

  • Introduces EmbeddedCheckoutProtocol.Options to group delegations, auth, and colorScheme into a single parameter passed to url().
  • Introduces EmbeddedCheckoutProtocol.Delegation as a string-backed value type with a companion catalog of known delegations (windowOpen, paymentCredential, paymentInstrumentsChange, fulfillmentAddressChange). Unknown delegation values round-trip intact for forward compatibility.
  • url() now appends ec_auth and ec_color_scheme query parameters in addition to ec_version and ec_delegate, and strips stale values of all four protocol params before re-applying them.
  • appendEcpParams() in the Android SDK now reads any existing ec_auth value from the caller-supplied URL and forwards it through Options.auth, preserving caller-supplied auth tokens.
  • The Kotlin catalog generation script (generate_kotlin_catalog.mjs) is updated to read x-delegations from the OpenRPC spec and emit the Delegation companion catalog automatically.

How to test

  1. Run the protocol library tests:
    ./gradlew :embedded-checkout-protocol:test
    
  2. Run the Android SDK tests:
    ./gradlew :lib:test
    
  3. Verify that a URL containing ?ec_auth=token passed through appendEcpParams() retains ec_auth=token in the output.
  4. Verify that calling EmbeddedCheckoutProtocol.url() with Options(auth = "token", colorScheme = "dark") appends ec_auth=token and ec_color_scheme=dark.
  5. Verify idempotency: calling url() twice with the same Options on an already-decorated URL produces a single set of protocol params with no duplicates.

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 checkoutKitAndroid in platforms/android/gradle/libs.versions.toml
  • 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 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@kiftio kiftio changed the base branch from 06-16-hide_communication_client to graphite-base/326 June 24, 2026 12:52
@kiftio kiftio force-pushed the graphite-base/326 branch from 76288b0 to 53488b2 Compare June 24, 2026 12:52
@kiftio kiftio force-pushed the 06-24-add_support_for_ec_auth_and_ec_color_scheme branch from f1504be to e5b20cc Compare June 24, 2026 12:52
@kiftio kiftio changed the base branch from graphite-base/326 to 06-24-move_url_encoding_to_protocol June 24, 2026 12:52
@kiftio kiftio force-pushed the 06-24-move_url_encoding_to_protocol branch from 53488b2 to 9ae6451 Compare June 24, 2026 14:23
@kiftio kiftio force-pushed the 06-24-add_support_for_ec_auth_and_ec_color_scheme branch from e5b20cc to 5369aaf Compare June 24, 2026 14:23
@kiftio kiftio force-pushed the 06-24-move_url_encoding_to_protocol branch from 9ae6451 to bdd4542 Compare June 24, 2026 14:58
@kiftio kiftio force-pushed the 06-24-add_support_for_ec_auth_and_ec_color_scheme branch from 5369aaf to 40c8694 Compare June 24, 2026 14:58
@kiftio kiftio marked this pull request as ready for review June 24, 2026 15:04
@kiftio kiftio requested a review from a team as a code owner June 24, 2026 15:04
@kiftio kiftio changed the title Add support for ec_auth and ec_color_scheme [Android] Add support for ec_auth and ec_color_scheme Jun 24, 2026
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 92%
91.66% (319/348) 87.86% (181/206) 100% (82/82)

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

Package Size

Platform Artifact Base Head Delta
Android release AAR 167.2 KiB 167.4 KiB +210 B

Measured from the PR base SHA and PR head SHA. This comment reports package artifact sizes only; it is not a final app binary-size report.

@kiftio kiftio force-pushed the 06-24-move_url_encoding_to_protocol branch from bdd4542 to afb8ce9 Compare June 24, 2026 15:29
@kiftio kiftio force-pushed the 06-24-add_support_for_ec_auth_and_ec_color_scheme branch from 40c8694 to 77aa730 Compare June 24, 2026 15:29
@kiftio kiftio force-pushed the 06-24-move_url_encoding_to_protocol branch from afb8ce9 to d98a9b4 Compare June 24, 2026 15:57
@kiftio kiftio force-pushed the 06-24-add_support_for_ec_auth_and_ec_color_scheme branch from 77aa730 to 220cff9 Compare June 24, 2026 15:57
@kiftio kiftio force-pushed the 06-24-move_url_encoding_to_protocol branch from d98a9b4 to f4914e7 Compare June 25, 2026 08:39
@kiftio kiftio force-pushed the 06-24-add_support_for_ec_auth_and_ec_color_scheme branch 2 times, most recently from b121d47 to 912db75 Compare June 25, 2026 09:15
@kiftio kiftio force-pushed the 06-24-move_url_encoding_to_protocol branch from f4914e7 to 7bc20e2 Compare June 25, 2026 09:42
@kiftio kiftio force-pushed the 06-24-add_support_for_ec_auth_and_ec_color_scheme branch from 912db75 to 87e76c6 Compare June 25, 2026 09:42
@kiftio kiftio mentioned this pull request Jun 25, 2026
13 tasks
@kiftio kiftio changed the base branch from 06-24-move_url_encoding_to_protocol to graphite-base/326 June 25, 2026 09:45
@kiftio kiftio force-pushed the graphite-base/326 branch from 7bc20e2 to 210cf54 Compare June 25, 2026 10:06
@kiftio kiftio force-pushed the 06-24-add_support_for_ec_auth_and_ec_color_scheme branch from 87e76c6 to 4c18156 Compare June 25, 2026 10:06
@graphite-app graphite-app Bot changed the base branch from graphite-base/326 to main June 25, 2026 10:07
@kiftio kiftio force-pushed the 06-24-add_support_for_ec_auth_and_ec_color_scheme branch from 4c18156 to 57e1c0e Compare June 25, 2026 10:07

kiftio commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Jun 25, 11:07 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 25, 11:07 AM UTC: @kiftio merged this pull request with Graphite.

@kiftio kiftio merged commit 97c4467 into main Jun 25, 2026
33 checks passed
@kiftio kiftio deleted the 06-24-add_support_for_ec_auth_and_ec_color_scheme branch June 25, 2026 11:07
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.

3 participants