Conversation
Install this buildOpen Tophat, select your target device, then click Install. Links open on the Mac running Tophat.
Checkout Kit E2E results
|
9a1a1a7 to
67f6e15
Compare
beac0b0 to
01d1ed8
Compare
Package Size
Android file breakdown
Measured from the PR base SHA and PR head SHA. The file breakdown shows uncompressed sizes within each package artifact, so individual files do not sum to the compressed artifact total. This comment reports package artifact sizes only; it is not a final app binary-size report. |
67f6e15 to
6bcf2dd
Compare
01d1ed8 to
1eefb47
Compare
6bcf2dd to
47abfe1
Compare
38ab010 to
c3304f1
Compare
47abfe1 to
8e3dbfb
Compare
tiagocandido
left a comment
There was a problem hiding this comment.
One README issue I could not attach inline (unchanged line outside the diff): line ~202 still says "callbacks and protocol client are fixed when the view is created" — the protocol client is gone in this PR; trim to just callbacks.
| ``` | ||
|
|
||
| `ec.window.open_request` is handled by your registered `CheckoutProtocol.windowOpen` handler if you provide one. Otherwise, Checkout Kit opens web links in Android Custom Tabs and non-web links through Android intents. | ||
| `onStart` and `onUpdate` observe checkout state; they do not send mutations to the checkout running in the WebView. |
There was a problem hiding this comment.
Preload consumes ec.start with the noop listener bound and it is not replayed, so with preloading on by default onStart mostly will not fire — is that intended? If yes, worth saying so here and in the preload section; if not, replay the latest snapshot when a real listener binds.
| public class CheckoutCompleteEvent internal constructor(public val checkout: Checkout) | ||
|
|
||
| /** The payload delivered when checkout cannot continue. */ | ||
| public class CheckoutFailureEvent internal constructor(public val error: CheckoutException) |
There was a problem hiding this comment.
Is internal constructor deliberate? Kotlin consumers cannot construct these for tests (the RN wrapper does exactly that with CheckoutException today), Java bypasses it anyway, and Swift's events are public. I'd make them public.
There was a problem hiding this comment.
There are obviously differences between the two types (e.g. number of constructor args).. But the comments are pulling constructor visibility in opposite directions..
Make Checkout's constructor to reduce public API surface, and make event constructors public for testability.
It feels possible that test fixtures might also want to construct a Checkout instance, (RN doesn't today, and it does construct events - but maybe that's more of a current impl detail).
Maybe it's worth thinking about what our policy should be for Kit-emitted models - are they SDK-owned/read-only outputs. Or are they public value types consumers should be able to construct for fixtures
| */ | ||
| @Serializable(with = CheckoutSerializer::class) | ||
| @Suppress("LongParameterList") | ||
| public data class Checkout( |
There was a problem hiding this comment.
A public data class means copy and the positional constructor are in lib.api, so every future field is a binary-breaking change. Since only the SDK produces snapshots, I'd make the constructor internal — also squares oddly with the events being locked down.
| override fun deserialize(decoder: Decoder): Checkout { | ||
| val input = decoder as? JsonDecoder | ||
| ?: throw SerializationException("Checkout can only be deserialized from JSON") | ||
| val fields = input.decodeJsonElement().jsonObject |
There was a problem hiding this comment.
.jsonObject throws IllegalArgumentException on a non-object, but callers are told to catch SerializationException. as? JsonObject ?: throw SerializationException(...) keeps it consistent.
8e3dbfb to
0775be4
Compare
c3304f1 to
157560e
Compare
5a48d81 to
0f3715c
Compare
Stack
Top to bottom:
Android integrations now receive Kit-owned checkout snapshots through typed start, update, complete, and failure callbacks in the Kotlin presentation builder and Java listener API. The snapshot preserves domain fields and extensions while excluding
ucp; line items remain unchanged. The four supported protocol change notifications share one update callback with equal-snapshot deduplication.Adds
Open,Handled, andCancellink policies, keeps protocol clients internal, and removes client injection from normal presentation. Both demo presentation modes and their documentation use the new callbacks. Adapter state is scoped to each presentation, queued callbacks stop after teardown or failure, and completion preserves unrelated preloads.This is an intentional prerelease API change: failure callbacks now receive
CheckoutFailureEvent, and protocol-client registration is replaced by Kit callbacks. The README includes migration guidance and the public API baseline is updated. React Native will need a coordinated callback migration when it adopts the next published Android SDK.Validation passed: 496 library tests, 47 protocol tests, 98 demo tests, Android library and demo builds (debug and release), static analysis, lint, and both API baseline checks.