Skip to content

Commit 2895726

Browse files
authored
Release 3.0.0 (#178)
* Release 3.0.0 * Add changelog entry * Update version in readme
1 parent 4b622c4 commit 2895726

File tree

3 files changed

+82
-16
lines changed

3 files changed

+82
-16
lines changed

CHANGELOG.md

+78-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,72 @@
11
# Changelog
22

3+
## 3.0.0 - May 20, 2024
4+
5+
Version `3.0.0` of the Checkout Sheet Kit ships with numerous improvements to error handling, including graceful degradation. In the event that your app receives an HTTP error on load or crashes mid-experience, the kit will implement a retry in an effort to attempt to recover.
6+
7+
### Error handling
8+
9+
```swift
10+
func checkoutDidFail(error: ShopifyCheckoutSheetKit.CheckoutError) {
11+
var errorMessage: String = ""
12+
13+
/// Internal Checkout SDK error
14+
if case .sdkError(let underlying, let recoverable) = error {
15+
errorMessage = "\(underlying.localizedDescription)"
16+
}
17+
18+
/// Checkout unavailable error
19+
if case .checkoutUnavailable(let message, let code, let recoverable) = error {
20+
errorMessage = message
21+
switch code {
22+
case .clientError(let clientErrorCode):
23+
errorMessage = "Client Error: \(clientErrorCode)"
24+
case .httpError(let statusCode):
25+
errorMessage = "HTTP Error: \(statusCode)"
26+
}
27+
}
28+
29+
/// Storefront configuration error
30+
if case .configurationError(let message, let code, let recoverable) = error {
31+
errorMessage = message
32+
}
33+
34+
/// Checkout has expired, re-create cart to fetch a new checkout URL
35+
if case .checkoutExpired(let message, let code, let recoverable) = error {
36+
errorMessage = message
37+
}
38+
39+
if !error.isRecoverable {
40+
handleUnrecoverableError(errorMessage)
41+
}
42+
}
43+
```
44+
45+
### Opting out
46+
47+
To opt out of the recovery feature, or to opt-out of the recovery of a specific error, extend the `shouldRecoverFromError` delegate method:
48+
49+
```swift
50+
class Controller: CheckoutDelegate {
51+
shouldRecoverFromError(error: CheckoutError) {
52+
// default:
53+
return error.isRecoverable
54+
}
55+
56+
checkoutDidFail(error: CheckoutError) {
57+
// Error handling...
58+
}
59+
}
60+
```
61+
62+
### Caveats
63+
64+
In the event that the Checkout Sheet Kit has triggered the recovery experience, certain features _may_ not be available.
65+
66+
1. Theming may not work as intended.
67+
2. **Web pixel lifecycle events will not fire.**
68+
3. `checkoutDidComplete` lifecycle events will contain only an `orderId`.
69+
370
## 2.0.1 - March 19, 2024
471

572
- Makes `CheckoutCompletedEvent` encodable/decodable.
@@ -13,23 +80,22 @@
1380

1481
```json
1582
{
16-
"sourceLanguage" : "en",
17-
"strings" : {
18-
"shopify_checkout_sheet_title" : {
19-
"comment" : "The title of the checkout sheet.",
20-
"extractionState" : "manual",
21-
"localizations" : {
22-
"en" : {
23-
"stringUnit" : {
24-
"state" : "translated",
25-
"value" : "Checkout"
83+
"sourceLanguage": "en",
84+
"strings": {
85+
"shopify_checkout_sheet_title": {
86+
"comment": "The title of the checkout sheet.",
87+
"extractionState": "manual",
88+
"localizations": {
89+
"en": {
90+
"stringUnit": {
91+
"state": "translated",
92+
"value": "Checkout"
2693
}
27-
},
94+
}
2895
}
2996
}
3097
}
3198
}
32-
3399
```
34100

35101
### Breaking Changes

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
**Shopify Checkout Sheet Kit** is a Swift Package library that enables Swift apps to provide the world’s highest converting, customizable, one-page checkout within the app. The presented experience is a fully-featured checkout that preserves all of the store customizations: Checkout UI extensions, Functions, branding, and more. It also provides platform idiomatic defaults such as support for light and dark mode, and convenient developer APIs to embed, customize, and follow the lifecycle of the checkout experience. Check out our blog to [learn how and why we built the Checkout Sheet Kit](https://www.shopify.com/partners/blog/mobile-checkout-sdks-for-ios-and-android).
77

8-
### Requirements
8+
## Requirements
99

1010
- Swift 5.7+
1111
- iOS SDK 13.0+
@@ -19,7 +19,7 @@ The SDK is an open-source [Swift Package library](https://www.swift.org/package-
1919

2020
```swift
2121
dependencies: [
22-
.package(url: "https://github.com/Shopify/checkout-sheet-kit-swift", from: "2")
22+
.package(url: "https://github.com/Shopify/checkout-sheet-kit-swift", from: "3")
2323
]
2424
```
2525

@@ -35,7 +35,7 @@ For more details on managing Swift Package dependencies in Xcode, please see [Ap
3535
#### CocoaPods
3636

3737
```ruby
38-
pod "ShopifyCheckoutSheetKit", "~> 2"
38+
pod "ShopifyCheckoutSheetKit", "~> 3"
3939
```
4040

4141
For more information on CocoaPods, please see their [getting started guide](https://guides.cocoapods.org/using/getting-started.html).

ShopifyCheckoutSheetKit.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Pod::Spec.new do |s|
2-
s.version = "3.0.0-beta.5"
2+
s.version = "3.0.0"
33

44
s.name = "ShopifyCheckoutSheetKit"
55
s.summary = "Enables Swift apps to embed the Shopify's highest converting, customizable, one-page checkout."

0 commit comments

Comments
 (0)