Skip to content

Commit

Permalink
Release 3.0.0 (#178)
Browse files Browse the repository at this point in the history
* Release 3.0.0

* Add changelog entry

* Update version in readme
  • Loading branch information
markmur authored May 20, 2024
1 parent 4b622c4 commit 2895726
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 16 deletions.
90 changes: 78 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,72 @@
# Changelog

## 3.0.0 - May 20, 2024

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.

### Error handling

```swift
func checkoutDidFail(error: ShopifyCheckoutSheetKit.CheckoutError) {
var errorMessage: String = ""

/// Internal Checkout SDK error
if case .sdkError(let underlying, let recoverable) = error {
errorMessage = "\(underlying.localizedDescription)"
}

/// Checkout unavailable error
if case .checkoutUnavailable(let message, let code, let recoverable) = error {
errorMessage = message
switch code {
case .clientError(let clientErrorCode):
errorMessage = "Client Error: \(clientErrorCode)"
case .httpError(let statusCode):
errorMessage = "HTTP Error: \(statusCode)"
}
}

/// Storefront configuration error
if case .configurationError(let message, let code, let recoverable) = error {
errorMessage = message
}

/// Checkout has expired, re-create cart to fetch a new checkout URL
if case .checkoutExpired(let message, let code, let recoverable) = error {
errorMessage = message
}

if !error.isRecoverable {
handleUnrecoverableError(errorMessage)
}
}
```

### Opting out

To opt out of the recovery feature, or to opt-out of the recovery of a specific error, extend the `shouldRecoverFromError` delegate method:

```swift
class Controller: CheckoutDelegate {
shouldRecoverFromError(error: CheckoutError) {
// default:
return error.isRecoverable
}

checkoutDidFail(error: CheckoutError) {
// Error handling...
}
}
```

### Caveats

In the event that the Checkout Sheet Kit has triggered the recovery experience, certain features _may_ not be available.

1. Theming may not work as intended.
2. **Web pixel lifecycle events will not fire.**
3. `checkoutDidComplete` lifecycle events will contain only an `orderId`.

## 2.0.1 - March 19, 2024

- Makes `CheckoutCompletedEvent` encodable/decodable.
Expand All @@ -13,23 +80,22 @@

```json
{
"sourceLanguage" : "en",
"strings" : {
"shopify_checkout_sheet_title" : {
"comment" : "The title of the checkout sheet.",
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Checkout"
"sourceLanguage": "en",
"strings": {
"shopify_checkout_sheet_title": {
"comment": "The title of the checkout sheet.",
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Checkout"
}
},
}
}
}
}
}

```

### Breaking Changes
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

**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).

### Requirements
## Requirements

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

```swift
dependencies: [
.package(url: "https://github.com/Shopify/checkout-sheet-kit-swift", from: "2")
.package(url: "https://github.com/Shopify/checkout-sheet-kit-swift", from: "3")
]
```

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

```ruby
pod "ShopifyCheckoutSheetKit", "~> 2"
pod "ShopifyCheckoutSheetKit", "~> 3"
```

For more information on CocoaPods, please see their [getting started guide](https://guides.cocoapods.org/using/getting-started.html).
Expand Down
2 changes: 1 addition & 1 deletion ShopifyCheckoutSheetKit.podspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Pod::Spec.new do |s|
s.version = "3.0.0-beta.5"
s.version = "3.0.0"

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

0 comments on commit 2895726

Please sign in to comment.