Skip to content

[Android] Rename CheckoutEventProcessor → CheckoutListener, drop stale callbacks#132

Open
tiagocandido wants to merge 1 commit into
05-15-restore_checkoutdelegate_with_trimmed_lifecycle_apifrom
05-15-_android_rename_checkouteventprocessor_checkoutlistener_drop_stale_callbacks
Open

[Android] Rename CheckoutEventProcessor → CheckoutListener, drop stale callbacks#132
tiagocandido wants to merge 1 commit into
05-15-restore_checkoutdelegate_with_trimmed_lifecycle_apifrom
05-15-_android_rename_checkouteventprocessor_checkoutlistener_drop_stale_callbacks

Conversation

@tiagocandido
Copy link
Copy Markdown
Contributor

@tiagocandido tiagocandido commented May 15, 2026

What changes are you making?

Renames CheckoutEventProcessorCheckoutListener on Android (with DefaultCheckoutEventProcessorDefaultCheckoutListener) and drops two methods now owned by the protocol layer:

  • onCheckoutCompleted → use CheckoutProtocol.complete
  • onCheckoutLinkClicked → use CheckoutCommunicationClient.openExternalUrl(...)

Removes the legacy code paths that fed those callbacks: the COMPLETED case in CheckoutBridge, the external-link branch in CheckoutWebView's URL override, and the legacy intent-launching defaults on DefaultCheckoutEventProcessor.

A few behavior tweaks to keep parity with the previous Android implementation:

  • ec.complete now invalidates the preload cache (was done by the old onCheckoutViewComplete path)
  • ec.window.open_request no longer filters URI schemes at the bridge — any URI is forwarded to openExternalUrl(...) so apps can handle mailto:/tel:/custom schemes themselves
  • When openExternalUrl(...) is absent or returns false, the bridge returns a JSON-RPC error instead of acknowledging success
  • FallbackWebView keeps confirmation-page detection and forwards a partial ec.complete (order ID only) to the client, so recovered checkouts still notify the host app. Follow-up: wire the full ECP bridge into the fallback path.

Internal field/class names follow the rename for consistency (CheckoutWebViewEventProcessorCheckoutWebViewListener, eventProcessorlistener throughout). README and lib/api/lib.api are updated.

Note: The React Native Android wrapper extends DefaultCheckoutEventProcessor and overrides onCheckoutCompleted — it will need a follow-up PR to rename the extends clause and route completion through CheckoutProtocol.complete.

How to test

  • ./gradlew :lib:test :lib:apiCheck :lib:detekt :lib:lintRelease
  • Build the MobileBuyIntegration sample and complete a checkout end-to-end; confirm the CheckoutProtocol.complete handler in CartViewModel fires (clears cart and pops back to the product screen)

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)

Copy link
Copy Markdown
Contributor Author

tiagocandido commented May 15, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@tiagocandido tiagocandido force-pushed the 05-15-_android_rename_checkouteventprocessor_checkoutlistener_drop_stale_callbacks branch from 89c10c1 to d4da055 Compare May 15, 2026 14:50
@tiagocandido tiagocandido force-pushed the 05-15-restore_checkoutdelegate_with_trimmed_lifecycle_api branch from d27977c to 7dceb15 Compare May 15, 2026 14:50
@tiagocandido tiagocandido added the #gsd:50662 Rebase Checkout Kit on UCP label May 15, 2026 — with Graphite App
@tiagocandido tiagocandido force-pushed the 05-15-_android_rename_checkouteventprocessor_checkoutlistener_drop_stale_callbacks branch 2 times, most recently from 8b0659f to 8afa420 Compare May 15, 2026 16:07
@tiagocandido tiagocandido force-pushed the 05-15-restore_checkoutdelegate_with_trimmed_lifecycle_api branch from 7dceb15 to 86ecd8b Compare May 15, 2026 16:07
@tiagocandido tiagocandido force-pushed the 05-15-_android_rename_checkouteventprocessor_checkoutlistener_drop_stale_callbacks branch from 8afa420 to 14a4aac Compare May 15, 2026 16:10
@tiagocandido tiagocandido marked this pull request as ready for review May 15, 2026 16:15
@tiagocandido tiagocandido requested a review from a team as a code owner May 15, 2026 16:15
@tiagocandido tiagocandido force-pushed the 05-15-_android_rename_checkouteventprocessor_checkoutlistener_drop_stale_callbacks branch from 14a4aac to 57bb1fe Compare May 15, 2026 16:46
@tiagocandido tiagocandido force-pushed the 05-15-restore_checkoutdelegate_with_trimmed_lifecycle_api branch from 86ecd8b to 9aa6c02 Compare May 15, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant