Skip to content

Commit 35c7707

Browse files
authored
Update data classes to reflect latest web pixel schema (#119)
1 parent f86e335 commit 35c7707

File tree

7 files changed

+246
-29
lines changed

7 files changed

+246
-29
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
- [ ] I have bumped the version number in the [`build.gradle` file](https://github.com/Shopify/checkout-kit-android/blob/main/lib/build.gradle#L17)
2626
- [ ] I have added a [Changelog](https://github.com/shopify/checkout-sheet-kit-android/blob/main/CHANGELOG.md) entry.
27+
- [ ] 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.
2728

2829
</details>
2930

CHANGELOG.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 3.0.4 August 7, 2024
4+
5+
- Update Web Pixel schema data classes.
6+
37
## 3.0.3 August 6, 2024
48

59
- Tag instrumentation with `preloading` state.
@@ -16,9 +20,9 @@
1620
## 3.0.0 May 20, 2024
1721

1822
- `ShopifyCheckoutSheet.present()` now returns an interface allowing clients to dismiss the sheet.
19-
- 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.
23+
- 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.
2024

21-
*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`.
25+
\*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`.
2226

2327
## 2.0.1 March 19, 2024
2428

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

3741
```diff
3842
Colors(
39-
- spinnerColor = Color.ResourceId(R.color.a_color),
40-
+ progressIndicator = Color.ResourceId(R.color.a_color),
43+
- spinnerColor = Color.ResourceId(R.color.a_color),
44+
+ progressIndicator = Color.ResourceId(R.color.a_color),
4145
)
4246
```
4347

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

4650
```kotlin
4751
override fun onCheckoutCompleted(checkoutCompletedEvent: CheckoutCompletedEvent) {
48-
println(checkoutCompletedEvent.orderDetails.id)
52+
println(checkoutCompletedEvent.orderDetails.id)
4953
}
5054
```
5155

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

8387
2. Update the imports throughout your codebase:
88+
8489
```diff
8590
- com.shopify.checkoutkit.*
8691
+ com.shopify.checkoutsheetkit.*
8792
```
8893

8994
3. Update the `present|preload|configure()` calls throughout your codebase:
95+
9096
```diff
9197
- ShopifyCheckoutKit.present|preload|configure()
9298
+ ShopifyCheckoutSheetKit.present|preload|configure()

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

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

@@ -23,7 +23,7 @@ your project:
2323
#### Gradle
2424

2525
```groovy
26-
implementation "com.shopify:checkout-sheet-kit:3.0.1"
26+
implementation "com.shopify:checkout-sheet-kit:3.0.4"
2727
```
2828

2929
#### Maven
@@ -33,7 +33,7 @@ implementation "com.shopify:checkout-sheet-kit:3.0.1"
3333
<dependency>
3434
<groupId>com.shopify</groupId>
3535
<artifactId>checkout-sheet-kit</artifactId>
36-
<version>3.0.1</version>
36+
<version>3.0.4</version>
3737
</dependency>
3838
```
3939

@@ -88,7 +88,7 @@ fun presentCheckout() {
8888

8989
> [!TIP]
9090
> To help optimize and deliver the best experience the SDK also provides a
91-
[preloading API](#preloading) that can be used to initialize the checkout session ahead of time.
91+
> [preloading API](#preloading) that can be used to initialize the checkout session ahead of time.
9292
9393
### Configuration
9494

@@ -286,7 +286,7 @@ ShopifyCheckoutSheetKit.configure {
286286
// To disable recovery (default = checkoutException.isRecoverable)
287287
return false
288288
}
289-
289+
290290
override fun preRecoveryActions(exception: CheckoutException, checkoutUrl: String) {
291291
// Perform actions prior to recovery, e.g. logging, clearing up cookies:
292292
if (exception is HttpException) {
@@ -299,21 +299,21 @@ ShopifyCheckoutSheetKit.configure {
299299
300300
#### `CheckoutException`
301301
302-
| Exception Class | Error Code | Description | Recommendation |
303-
| ------------------------------ | ------------------------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------ |
304-
| `ConfigurationException` | 'checkout_liquid_not_migrated' | `checkout.liquid` is not supported. | Upgrade to Extensibility. |
302+
| Exception Class | Error Code | Description | Recommendation |
303+
| ------------------------------ | ------------------------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
304+
| `ConfigurationException` | 'checkout_liquid_not_migrated' | `checkout.liquid` is not supported. | Upgrade to Extensibility. |
305305
| `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. |
306-
| `ConfigurationException` | 'unknown' | Other configuration issue, see error details for more info. | Resolve the configuration issue in the error message. |
307-
| `CheckoutExpiredException` | 'cart_expired' | The cart or checkout is no longer available. | Create a new cart and open a new checkout URL. |
308-
| `CheckoutExpiredException` | 'cart_completed' | The cart associated with the checkout has completed checkout. | Create new cart and open a new checkout URL. |
309-
| `CheckoutExpiredException` | 'invalid_cart' | The cart associated with the checkout is invalid (e.g. empty). | Create a new cart and open a new checkout URL. |
310-
| `CheckoutSheetKitException` | 'error_receiving_message' | Checkout Sheet Kit failed to receive a message from checkout. | Show checkout in a fallback WebView. |
311-
| `CheckoutSheetKitException` | 'error_sending_message' | Checkout Sheet Kit failed to send a message to checkout. | Show checkout in a fallback WebView. |
312-
| `CheckoutSheetKitException` | 'render_process_gone' | The render process for the checkout WebView is gone. | Show checkout in a fallback WebView. |
313-
| `CheckoutSheetKitException` | 'unknown' | An error in Checkout Sheet Kit has occurred, see error details for more info. | Show checkout in a fallback WebView. |
314-
| `HttpException` | 'http_error' | An unexpected server error has been encountered. | Show checkout in a fallback WebView. |
315-
| `ClientException` | 'client_error' | An unhandled client error was encountered. | Show checkout in a fallback WebView. |
316-
| `CheckoutUnavailableException` | 'unknown' | Checkout is unavailable for another reason, see error details for more info. | Show checkout in a fallback WebView. |
306+
| `ConfigurationException` | 'unknown' | Other configuration issue, see error details for more info. | Resolve the configuration issue in the error message. |
307+
| `CheckoutExpiredException` | 'cart_expired' | The cart or checkout is no longer available. | Create a new cart and open a new checkout URL. |
308+
| `CheckoutExpiredException` | 'cart_completed' | The cart associated with the checkout has completed checkout. | Create new cart and open a new checkout URL. |
309+
| `CheckoutExpiredException` | 'invalid_cart' | The cart associated with the checkout is invalid (e.g. empty). | Create a new cart and open a new checkout URL. |
310+
| `CheckoutSheetKitException` | 'error_receiving_message' | Checkout Sheet Kit failed to receive a message from checkout. | Show checkout in a fallback WebView. |
311+
| `CheckoutSheetKitException` | 'error_sending_message' | Checkout Sheet Kit failed to send a message to checkout. | Show checkout in a fallback WebView. |
312+
| `CheckoutSheetKitException` | 'render_process_gone' | The render process for the checkout WebView is gone. | Show checkout in a fallback WebView. |
313+
| `CheckoutSheetKitException` | 'unknown' | An error in Checkout Sheet Kit has occurred, see error details for more info. | Show checkout in a fallback WebView. |
314+
| `HttpException` | 'http_error' | An unexpected server error has been encountered. | Show checkout in a fallback WebView. |
315+
| `ClientException` | 'client_error' | An unhandled client error was encountered. | Show checkout in a fallback WebView. |
316+
| `CheckoutUnavailableException` | 'unknown' | Checkout is unavailable for another reason, see error details for more info. | Show checkout in a fallback WebView. |
317317
318318
#### Exception Hierarchy
319319
@@ -438,7 +438,7 @@ and initialize a buyer-aware checkout session.
438438

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

443443
#### Shop Pay
444444

lib/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def resolveEnvVarValue(name, defaultValue) {
1414
return rawValue ? rawValue : defaultValue
1515
}
1616

17-
def versionName = resolveEnvVarValue("CHECKOUT_SHEET_KIT_VERSION", "3.0.3")
17+
def versionName = resolveEnvVarValue("CHECKOUT_SHEET_KIT_VERSION", "3.0.4")
1818

1919
ext {
2020
app_compat_version = '1.6.1'

0 commit comments

Comments
 (0)