You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Optional: grant, deny, or proxy requested web permissions.
174
+
}
175
+
}
176
+
```
177
+
178
+
If you prefer a reusable object, or are integrating from Java, `DefaultCheckoutEventProcessor`
179
+
remains available.
180
+
120
181
> [!TIP]
121
182
> To help optimize and deliver the best experience the SDK also provides a
122
183
> [preloading API](#preloading) that can be used to initialize the checkout session ahead of time.
@@ -317,9 +378,9 @@ The library will automatically invalidate/abort preload under the following cond
317
378
318
379
- Request results in network error or non 2XX server response code
319
380
- The checkout has successfully completed, as indicated by the server response
320
-
- When `ShopifyCheckoutSheet.configure` is called (e.g. with theming changes).
381
+
- When `ShopifyCheckoutKit.configure` is called (e.g. with theming changes).
321
382
322
-
A preloaded checkout _is not_ automatically invalidated when checkout is closed. For example, if a buyer loads the checkout then exists, the preloaded checkout is retained and should be updated when cart contents change.
383
+
A preloaded checkout _is not_ automatically invalidated when checkout is closed. For example, if a buyer loads the checkout then exits, the preloaded checkout is retained and should be updated when cart contents change.
323
384
324
385
#### Additional considerations for preloaded checkout
325
386
@@ -332,41 +393,57 @@ A preloaded checkout _is not_ automatically invalidated when checkout is closed.
332
393
333
394
## Monitoring the lifecycle of a checkout session
334
395
335
-
Extend the `DefaultCheckoutEventProcessor` abstract class to register callbacks for key lifecycle events during the checkout session:
396
+
For the common lifecycle path, register callbacks directly on `present(...)`:
336
397
337
398
```kotlin
338
-
val processor = object : DefaultCheckoutEventProcessor(activity) {
339
-
override fun onCheckoutCompleted(checkoutCompletedEvent: CheckoutCompletedEvent) {
>The `DefaultCheckoutEventProcessor` provides default implementations for current and future callback functions (such as `onLinkClicked()`), which can be overridden by clients wanting to change default behavior.
477
+
> The `DefaultCheckoutEventProcessor` overload remains available for reusable or Java-facing
478
+
> integrations and provides default implementations for optional browser/system callbacks.
399
479
400
480
### Error handling
401
481
@@ -406,8 +486,8 @@ In the event of a checkout error occurring, the Checkout Kit _may_ attempt to re
406
486
407
487
There are some caveats to note when this scenario occurs:
408
488
409
-
1. The checkout experience may look different to buyers. Though the sheet kit will attempt to load any checkoput customizations for the storefront, there is no guarantee they will show in recovery mode.
410
-
2. The `onCheckoutCompleted(checkoutCompletedEvent:CheckoutCompletedEvent)` will be emitted with partial data. Invocations will only received the order ID via `checkoutCompletedEvent.orderDetails.id`.
489
+
1. The checkout experience may look different to buyers. Though the kit will attempt to load any checkout customizations for the storefront, there is no guarantee they will show in recovery mode.
490
+
2. The `onCheckoutCompleted(checkoutCompletedEvent: CheckoutCompletedEvent)` callback will be emitted with partial data. Invocations will only receive the order ID via `checkoutCompletedEvent.orderDetails.id`.
411
491
412
492
Should you wish to opt-out of this fallback experience entirely, you can do so by overriding `shouldRecoverFromError`. Errors given to the `onCheckoutFailed(error: CheckoutException)` lifecycle method will contain an `isRecoverable` property by default indicating whether the request should be retried or not.
413
493
@@ -492,7 +572,7 @@ classDiagram
492
572
493
573
Buyer-aware checkout experience reduces friction and increases conversion. Depending on the context
494
574
of the buyer (guest or signed-in), knowledge of buyer preferences, or account/identity system, the
495
-
application can use on of the following methods to initialize personalized and contextualized buyer
575
+
application can use one of the following methods to initialize personalized and contextualized buyer
Copy file name to clipboardExpand all lines: platforms/android/lib/api/lib.api
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -756,6 +756,17 @@ public final class com/shopify/checkoutkit/CheckoutLineItem$Companion {
756
756
public final fun serializer ()Lkotlinx/serialization/KSerializer;
757
757
}
758
758
759
+
public final class com/shopify/checkoutkit/CheckoutPresentation {
760
+
public final fun connect (Lcom/shopify/checkoutkit/CheckoutCommunicationClient;)V
761
+
public final fun onCancel (Lkotlin/jvm/functions/Function0;)V
762
+
public final fun onComplete (Lkotlin/jvm/functions/Function1;)V
763
+
public final fun onFail (Lkotlin/jvm/functions/Function1;)V
764
+
public final fun onGeolocationPermissionsHidePrompt (Lkotlin/jvm/functions/Function0;)V
765
+
public final fun onGeolocationPermissionsShowPrompt (Lkotlin/jvm/functions/Function2;)V
766
+
public final fun onPermissionRequest (Lkotlin/jvm/functions/Function1;)V
767
+
public final fun onShowFileChooser (Lkotlin/jvm/functions/Function3;)V
768
+
}
769
+
759
770
public final class com/shopify/checkoutkit/CheckoutProtocol {
760
771
public static final field INSTANCE Lcom/shopify/checkoutkit/CheckoutProtocol;
761
772
public static final field specVersion Ljava/lang/String;
@@ -3927,6 +3938,7 @@ public final class com/shopify/checkoutkit/ShopifyCheckoutKit {
3927
3938
public static final fun preload (Ljava/lang/String;Landroidx/activity/ComponentActivity;)V
3928
3939
public static final fun present (Ljava/lang/String;Landroidx/activity/ComponentActivity;Lcom/shopify/checkoutkit/DefaultCheckoutEventProcessor;)Lcom/shopify/checkoutkit/CheckoutKitDialog;
3929
3940
public static final fun present (Ljava/lang/String;Landroidx/activity/ComponentActivity;Lcom/shopify/checkoutkit/DefaultCheckoutEventProcessor;Lcom/shopify/checkoutkit/CheckoutCommunicationClient;)Lcom/shopify/checkoutkit/CheckoutKitDialog;
3941
+
public static final synthetic fun present (Ljava/lang/String;Landroidx/activity/ComponentActivity;Lkotlin/jvm/functions/Function1;)Lcom/shopify/checkoutkit/CheckoutKitDialog;
3930
3942
public static synthetic fun present$default (Ljava/lang/String;Landroidx/activity/ComponentActivity;Lcom/shopify/checkoutkit/DefaultCheckoutEventProcessor;Lcom/shopify/checkoutkit/CheckoutCommunicationClient;ILjava/lang/Object;)Lcom/shopify/checkoutkit/CheckoutKitDialog;
0 commit comments