Skip to content

Releases: Shopify/checkout-sheet-kit-swift

3.1.2

06 Nov 15:38
054485a
Compare
Choose a tag to compare

What's Changed

Full Changelog: 3.1.1...3.1.2

3.1.1

18 Oct 13:40
773e42b
Compare
Choose a tag to compare

What's Changed

Full Changelog: 3.1.0...3.1.1

3.1.0

16 Oct 17:08
02d796b
Compare
Choose a tag to compare

What's Changed

  • Expose invalidate function to manually clear preload cache by @markmur in #220
  • Prevent recovery for multipass URLs with one-time tokens by @markmur in #226
  • Open deep links externally by @markmur in #227
  • Ignore cancelled redirects, add OS debug logging by @markmur in #225

Full Changelog: 3.0.4...3.1.0

3.0.4

09 Aug 09:33
822ee10
Compare
Choose a tag to compare

What's Changed

Full Changelog: 3.0.3...3.0.4

3.0.3

06 Aug 10:54
38d444d
Compare
Choose a tag to compare

What's Changed

Full Changelog: 3.0.2...3.0.3

3.0.2

24 Jul 12:47
4dfe8a8
Compare
Choose a tag to compare

What's Changed

  • Set allowsInlineMediaPlayback to true on webview by @markmur in #204

New Contributors

Full Changelog: 3.0.1...3.0.2

3.0.1

19 Jun 10:43
3b508af
Compare
Choose a tag to compare

What's Changed

    • Fixes an issue where web pixels events do not fire after checkout completion by @markmur in #184

Full Changelog: 3.0.0...3.0.1

3.0.0

20 May 12:11
2895726
Compare
Choose a tag to compare

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

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:

class Controller: CheckoutDelegate {
  func shouldRecoverFromError(error: CheckoutError) {
    // default:
    return error.isRecoverable

    // Opt-out of all recovery
    return false
  }

  func 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.

Also included

  • Improve error handling (HTTP + Bridge events) by @markmur in #156
  • Graceful degradation with webview reuse by @markmur in #163
  • Bump rexml from 3.2.6 to 3.2.8 in the bundler group across 1 directory by @dependabot in #177

Full Changelog: 2.0.1...3.0.0

3.0.0-beta.5

16 May 10:29
e65945b
Compare
Choose a tag to compare
3.0.0-beta.5 Pre-release
Pre-release

3.0.0-beta.4

16 May 08:09
cd493e9
Compare
Choose a tag to compare
3.0.0-beta.4 Pre-release
Pre-release