Skip to content

Commit 3e920bb

Browse files
committed
Render checkout in custom bottom sheet
1 parent 87bbef5 commit 3e920bb

23 files changed

Lines changed: 1943 additions & 823 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ This repository contains the Checkout Kit implementations, samples, and protocol
2929
| --- | --- | --- | --- | --- | --- |
3030
| `ShopifyCheckoutKit` | `4.0.0-alpha.2` | Swift Package Manager, CocoaPods | Alpha | iOS checkout presentation SDK. | [Swift](platforms/swift/README.md) |
3131
| `ShopifyAcceleratedCheckouts` | `4.0.0-alpha.2` | Swift Package Manager, CocoaPods subspec | Alpha | SwiftUI Shop Pay and Apple Pay accelerated checkout buttons for iOS 16+. | [Swift](platforms/swift/README.md#accelerated-checkouts) |
32-
| `com.shopify:checkout-kit` | `4.0.0-alpha.1` | Maven Central | Alpha | Android checkout dialog SDK. | [Android](platforms/android/README.md) |
32+
| `com.shopify:checkout-kit` | `4.0.0-alpha.2` | Maven Central | Alpha | Android checkout presentation SDK. | [Android](platforms/android/README.md) |
3333
| `@shopify/checkout-kit-react-native` | `4.0.0-alpha.2` | npm `next` dist-tag | Alpha | React Native wrapper for the iOS and Android native SDKs. | [React Native](platforms/react-native/README.md) |
3434
| `@shopify/checkout-kit` | `4.0.0-alpha.2` | npm `next` dist-tag | Alpha | Web component for opening Shopify checkout from a web page. | [Web](platforms/web/README.md) |
3535
| `ShopifyCheckoutProtocol` | Source package | Swift Package Manager | Internal/supporting | Swift client for Embedded Checkout Protocol messages. | [Protocol Swift](protocol/languages/swift/README.md) |
@@ -80,7 +80,7 @@ Use the Shopify.dev guides for broader product workflows:
8080

8181
Checkout Kit is the current home for the SDKs that were previously published as Checkout Sheet Kit. The renamed packages use a shared `4.0.0-alpha.X` version format while the new package line settles:
8282

83-
- Swift is currently `4.0.0-alpha.2`; Android and React Native start at `4.0.0-alpha.1`.
83+
- Swift, Android, and React Native are currently `4.0.0-alpha.2`.
8484
- Web is currently `4.0.0-alpha.2` and is published under the npm `next` dist-tag.
8585
- React Native requires React Native New Architecture.
8686
- Stable releases will continue on the same `4.x` package line after the alpha period.

platforms/android/AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Shopify Checkout Kit for Android publishes Maven artifacts that are consumed by
88

99
The main modules are:
1010

11-
- **`lib/`** — the Checkout Kit library, published as `com.shopify:checkout-kit`. It presents Shopify checkouts as a native, dialog-hosted WebView in consumer apps.
11+
- **`lib/`** — the Checkout Kit library, published as `com.shopify:checkout-kit`. It presents Shopify checkouts as a native bottom-sheet-hosted WebView in consumer apps.
1212
- **`../../protocol/languages/kotlin/embedded-checkout-protocol/`** — the Embedded Checkout Protocol Kotlin artifact, published as `com.shopify:embedded-checkout-protocol`. The Android Gradle project path is `:embedded-checkout-protocol`, and the Kotlin package is `com.shopify.ucp.embedded.checkout`.
1313
- **`samples/CheckoutKitAndroidDemo/`** — a demo app that consumes Checkout Kit and the Kotlin protocol artifact as source dependencies. Changes here never reach consumers; this module is for internal testing and developer onboarding.
1414

@@ -25,7 +25,7 @@ The sample is a separate Gradle composite (`samples/CheckoutKitAndroidDemo/setti
2525
## Key components
2626

2727
- **`ShopifyCheckoutKit.kt`** — the public singleton. Entry point for all consumer interactions (configure, present).
28-
- **`CheckoutDialog.kt`** — the dialog that hosts the WebView, including the progress indicator and checkout error coordination.
28+
- **`CheckoutBottomSheet.kt`** — the bottom sheet that hosts the WebView, including the progress indicator, gesture coordination, and checkout error coordination.
2929
- **`CheckoutWebView.kt`** — primary WebView. Instruments page loads and attaches the ECP JavaScript interface.
3030
- **`BaseWebView.kt`** — abstract base class. Any new WebView variant must extend this so shared configuration (user agent suffix, WebChromeClient hooks, navigation error handling) is consistent.
3131
- **`CheckoutProtocol.kt`** — the curated consumer-facing Checkout Kit protocol API. This is where supported events/delegations are intentionally exposed.

platforms/android/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
> production-ready. The current Checkout Kit for Android alpha is `4.0.0-alpha.2`.
1111
> Stability is not guaranteed, and breaking changes may occur in any release.
1212
13-
**Checkout Kit for Android** lets Android apps present Shopify checkout in a native dialog while preserving store checkout customizations such as Checkout UI extensions, Shopify Functions, branding, and supported payment methods.
13+
**Checkout Kit for Android** lets Android apps present Shopify checkout in a native bottom sheet while preserving store checkout customizations such as Checkout UI extensions, Shopify Functions, branding, and supported payment methods.
1414

1515
> [!NOTE]
1616
> This package was previously published as `com.shopify:checkout-sheet-kit`. New integrations should use `com.shopify:checkout-kit`.
@@ -114,14 +114,14 @@ val listener = object : DefaultCheckoutListener() {
114114
ShopifyCheckoutKit.present(checkoutUrl, activity, listener)
115115
```
116116

117-
The `present` call returns a `CheckoutKitDialog?`. Keep it if you need to dismiss the dialog programmatically:
117+
The `present` call returns a `CheckoutHandle?`. Keep it if you need to dismiss checkout programmatically:
118118

119119
```kotlin
120-
val checkoutDialog = ShopifyCheckoutKit.present(checkoutUrl, activity) {
120+
val checkout = ShopifyCheckoutKit.present(checkoutUrl, activity) {
121121
onCancel { resetCheckoutUi() }
122122
}
123123

124-
checkoutDialog?.dismiss()
124+
checkout?.dismiss()
125125
```
126126

127127
## Preload checkout
@@ -344,6 +344,10 @@ Checkout Kit opens external HTTPS links, `mailto:`, `tel:`, and custom-scheme li
344344
## Troubleshooting
345345

346346
- Use `LogLevel.DEBUG` while integrating.
347+
- For production release builds, use Android app shrinking and optimization
348+
when appropriate. Checkout Kit does not require integration-specific R8 rules
349+
for normal usage, and app-level shrinking can remove unused dependency code
350+
and resources.
347351
- If checkout reports an expired, completed, or invalid cart, create a fresh cart and use its new `checkoutUrl`.
348352
- If checkout cannot access camera, file upload, or location features, check your manifest permissions and runtime permission flow.
349353
- If offsite payment redirects do not return to your app, verify App Links/deep link intent filters and domain association.

platforms/android/lib/api/lib.api

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public final class com/shopify/checkoutkit/CheckoutExpiredException : com/shopif
3434
public final class com/shopify/checkoutkit/CheckoutExpiredException$Companion {
3535
}
3636

37-
public abstract interface class com/shopify/checkoutkit/CheckoutKitDialog {
37+
public abstract interface class com/shopify/checkoutkit/CheckoutHandle {
3838
public abstract fun dismiss ()V
3939
}
4040

@@ -499,10 +499,10 @@ public final class com/shopify/checkoutkit/ShopifyCheckoutKit {
499499
public static final fun getConfiguration ()Lcom/shopify/checkoutkit/Configuration;
500500
public static final fun invalidate ()V
501501
public static final fun preload (Ljava/lang/String;Landroidx/activity/ComponentActivity;)V
502-
public static final fun present (Ljava/lang/String;Landroidx/activity/ComponentActivity;Lcom/shopify/checkoutkit/DefaultCheckoutListener;)Lcom/shopify/checkoutkit/CheckoutKitDialog;
503-
public static final fun present (Ljava/lang/String;Landroidx/activity/ComponentActivity;Lcom/shopify/checkoutkit/DefaultCheckoutListener;Lcom/shopify/checkoutkit/CheckoutProtocol$Client;)Lcom/shopify/checkoutkit/CheckoutKitDialog;
504-
public static final synthetic fun present (Ljava/lang/String;Landroidx/activity/ComponentActivity;Lkotlin/jvm/functions/Function1;)Lcom/shopify/checkoutkit/CheckoutKitDialog;
505-
public static synthetic fun present$default (Ljava/lang/String;Landroidx/activity/ComponentActivity;Lcom/shopify/checkoutkit/DefaultCheckoutListener;Lcom/shopify/checkoutkit/CheckoutProtocol$Client;ILjava/lang/Object;)Lcom/shopify/checkoutkit/CheckoutKitDialog;
502+
public static final fun present (Ljava/lang/String;Landroidx/activity/ComponentActivity;Lcom/shopify/checkoutkit/DefaultCheckoutListener;)Lcom/shopify/checkoutkit/CheckoutHandle;
503+
public static final fun present (Ljava/lang/String;Landroidx/activity/ComponentActivity;Lcom/shopify/checkoutkit/DefaultCheckoutListener;Lcom/shopify/checkoutkit/CheckoutProtocol$Client;)Lcom/shopify/checkoutkit/CheckoutHandle;
504+
public static final synthetic fun present (Ljava/lang/String;Landroidx/activity/ComponentActivity;Lkotlin/jvm/functions/Function1;)Lcom/shopify/checkoutkit/CheckoutHandle;
505+
public static synthetic fun present$default (Ljava/lang/String;Landroidx/activity/ComponentActivity;Lcom/shopify/checkoutkit/DefaultCheckoutListener;Lcom/shopify/checkoutkit/CheckoutProtocol$Client;ILjava/lang/Object;)Lcom/shopify/checkoutkit/CheckoutHandle;
506506
}
507507

508508
public final class com/shopify/checkoutkit/WindowOpenRequest {

0 commit comments

Comments
 (0)