Skip to content

Update data classes to reflect latest web pixel schema #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

- [ ] I have bumped the version number in the [`build.gradle` file](https://github.com/Shopify/checkout-kit-android/blob/main/lib/build.gradle#L17)
- [ ] I have added a [Changelog](https://github.com/shopify/checkout-sheet-kit-android/blob/main/CHANGELOG.md) entry.
- [ ] I have updated the versions in the [README.md](https://github.com/shopify/checkout-sheet-kit-android/blob/main/README.md) for both Gradle and Maven.

</details>

Expand Down
16 changes: 11 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 3.0.4 August 7, 2024

- Update Web Pixel schema data classes.

## 3.0.3 August 6, 2024

- Tag instrumentation with `preloading` state.
Expand All @@ -16,9 +20,9 @@
## 3.0.0 May 20, 2024

- `ShopifyCheckoutSheet.present()` now returns an interface allowing clients to dismiss the sheet.
- Error handling has been improved*. The kit also attempts to load checkout in a recovery WebView when certain errors are encountered. See [Error Handling](https://github.com/Shopify/checkout-sheet-kit-android#error-handling) for more information.
- Error handling has been improved\*. The kit also attempts to load checkout in a recovery WebView when certain errors are encountered. See [Error Handling](https://github.com/Shopify/checkout-sheet-kit-android#error-handling) for more information.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is auto-formatting


*Please note the exception class hierarchy has been updated to be more comprehensive. Each exception class now returns an `isRecoverable: Boolean`, an `errorCode` and an `errorDescription`.
\*Please note the exception class hierarchy has been updated to be more comprehensive. Each exception class now returns an `isRecoverable: Boolean`, an `errorCode` and an `errorDescription`.

## 2.0.1 March 19, 2024

Expand All @@ -36,16 +40,16 @@ If you were previously setting the loading spinner color, the field has been ren

```diff
Colors(
- spinnerColor = Color.ResourceId(R.color.a_color),
+ progressIndicator = Color.ResourceId(R.color.a_color),
- spinnerColor = Color.ResourceId(R.color.a_color),
+ progressIndicator = Color.ResourceId(R.color.a_color),
)
```

2. **Breaking Changes** The `onCheckoutCompleted` callback now returns a completed event object, containing details about the order:

```kotlin
override fun onCheckoutCompleted(checkoutCompletedEvent: CheckoutCompletedEvent) {
println(checkoutCompletedEvent.orderDetails.id)
println(checkoutCompletedEvent.orderDetails.id)
}
```

Expand Down Expand Up @@ -81,12 +85,14 @@ _Note_: If your processor extends `DefaultCheckoutEventProcessor`, a no-op imple
```

2. Update the imports throughout your codebase:

```diff
- com.shopify.checkoutkit.*
+ com.shopify.checkoutsheetkit.*
```

3. Update the `present|preload|configure()` calls throughout your codebase:

```diff
- ShopifyCheckoutKit.present|preload|configure()
+ ShopifyCheckoutSheetKit.present|preload|configure()
Expand Down
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](/LICENSE)
![Tests](https://github.com/Shopify/checkout-sheet-kit-android/actions/workflows/test.yml/badge.svg?branch=main)
[![GitHub Release](https://img.shields.io/github/release/shopify/checkout-sheet-kit-android.svg?style=flat)]()
[![GitHub Release](https://img.shields.io/github/release/shopify/checkout-sheet-kit-android.svg?style=flat)]()

![image](https://github.com/Shopify/checkout-sheet-kit-android/assets/2034704/c6c726dc-a211-406b-b848-53ade91a164d)

Expand All @@ -23,7 +23,7 @@ your project:
#### Gradle

```groovy
implementation "com.shopify:checkout-sheet-kit:3.0.1"
implementation "com.shopify:checkout-sheet-kit:3.0.4"
```

#### Maven
Expand All @@ -33,7 +33,7 @@ implementation "com.shopify:checkout-sheet-kit:3.0.1"
<dependency>
<groupId>com.shopify</groupId>
<artifactId>checkout-sheet-kit</artifactId>
<version>3.0.1</version>
<version>3.0.4</version>
</dependency>
```

Expand Down Expand Up @@ -88,7 +88,7 @@ fun presentCheckout() {

> [!TIP]
> To help optimize and deliver the best experience the SDK also provides a
[preloading API](#preloading) that can be used to initialize the checkout session ahead of time.
> [preloading API](#preloading) that can be used to initialize the checkout session ahead of time.

### Configuration

Expand Down Expand Up @@ -286,7 +286,7 @@ ShopifyCheckoutSheetKit.configure {
// To disable recovery (default = checkoutException.isRecoverable)
return false
}

override fun preRecoveryActions(exception: CheckoutException, checkoutUrl: String) {
// Perform actions prior to recovery, e.g. logging, clearing up cookies:
if (exception is HttpException) {
Expand All @@ -299,21 +299,21 @@ ShopifyCheckoutSheetKit.configure {

#### `CheckoutException`

| Exception Class | Error Code | Description | Recommendation |
| ------------------------------ | ------------------------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------ |
| `ConfigurationException` | 'checkout_liquid_not_migrated' | `checkout.liquid` is not supported. | Upgrade to Extensibility. |
| Exception Class | Error Code | Description | Recommendation |
| ------------------------------ | ------------------------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `ConfigurationException` | 'checkout_liquid_not_migrated' | `checkout.liquid` is not supported. | Upgrade to Extensibility. |
| `ConfigurationException` | 'storefront_password_required' | Access to checkout is password protected. | We are working on ways to enable the Checkout Sheet Kit for usage with password protected stores. |
| `ConfigurationException` | 'unknown' | Other configuration issue, see error details for more info. | Resolve the configuration issue in the error message. |
| `CheckoutExpiredException` | 'cart_expired' | The cart or checkout is no longer available. | Create a new cart and open a new checkout URL. |
| `CheckoutExpiredException` | 'cart_completed' | The cart associated with the checkout has completed checkout. | Create new cart and open a new checkout URL. |
| `CheckoutExpiredException` | 'invalid_cart' | The cart associated with the checkout is invalid (e.g. empty). | Create a new cart and open a new checkout URL. |
| `CheckoutSheetKitException` | 'error_receiving_message' | Checkout Sheet Kit failed to receive a message from checkout. | Show checkout in a fallback WebView. |
| `CheckoutSheetKitException` | 'error_sending_message' | Checkout Sheet Kit failed to send a message to checkout. | Show checkout in a fallback WebView. |
| `CheckoutSheetKitException` | 'render_process_gone' | The render process for the checkout WebView is gone. | Show checkout in a fallback WebView. |
| `CheckoutSheetKitException` | 'unknown' | An error in Checkout Sheet Kit has occurred, see error details for more info. | Show checkout in a fallback WebView. |
| `HttpException` | 'http_error' | An unexpected server error has been encountered. | Show checkout in a fallback WebView. |
| `ClientException` | 'client_error' | An unhandled client error was encountered. | Show checkout in a fallback WebView. |
| `CheckoutUnavailableException` | 'unknown' | Checkout is unavailable for another reason, see error details for more info. | Show checkout in a fallback WebView. |
| `ConfigurationException` | 'unknown' | Other configuration issue, see error details for more info. | Resolve the configuration issue in the error message. |
| `CheckoutExpiredException` | 'cart_expired' | The cart or checkout is no longer available. | Create a new cart and open a new checkout URL. |
| `CheckoutExpiredException` | 'cart_completed' | The cart associated with the checkout has completed checkout. | Create new cart and open a new checkout URL. |
| `CheckoutExpiredException` | 'invalid_cart' | The cart associated with the checkout is invalid (e.g. empty). | Create a new cart and open a new checkout URL. |
| `CheckoutSheetKitException` | 'error_receiving_message' | Checkout Sheet Kit failed to receive a message from checkout. | Show checkout in a fallback WebView. |
| `CheckoutSheetKitException` | 'error_sending_message' | Checkout Sheet Kit failed to send a message to checkout. | Show checkout in a fallback WebView. |
| `CheckoutSheetKitException` | 'render_process_gone' | The render process for the checkout WebView is gone. | Show checkout in a fallback WebView. |
| `CheckoutSheetKitException` | 'unknown' | An error in Checkout Sheet Kit has occurred, see error details for more info. | Show checkout in a fallback WebView. |
| `HttpException` | 'http_error' | An unexpected server error has been encountered. | Show checkout in a fallback WebView. |
| `ClientException` | 'client_error' | An unhandled client error was encountered. | Show checkout in a fallback WebView. |
| `CheckoutUnavailableException` | 'unknown' | Checkout is unavailable for another reason, see error details for more info. | Show checkout in a fallback WebView. |

#### Exception Hierarchy

Expand Down Expand Up @@ -438,7 +438,7 @@ and initialize a buyer-aware checkout session.

> [!Important]
> the above JSON omits useful customer attributes that should be provided where possible and
encryption and signing should be done server-side to ensure Multipass keys are kept secret.
> encryption and signing should be done server-side to ensure Multipass keys are kept secret.

#### Shop Pay

Expand Down
2 changes: 1 addition & 1 deletion lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def resolveEnvVarValue(name, defaultValue) {
return rawValue ? rawValue : defaultValue
}

def versionName = resolveEnvVarValue("CHECKOUT_SHEET_KIT_VERSION", "3.0.3")
def versionName = resolveEnvVarValue("CHECKOUT_SHEET_KIT_VERSION", "3.0.4")

ext {
app_compat_version = '1.6.1'
Expand Down
Loading
Loading