zerosettle 1.3.4
zerosettle: ^1.3.4 copied to clipboard
ZeroSettle SDK for Flutter — Merchant of Record web checkout.
1.3.4 #
Tracks ZeroSettleKit 1.3.4. Two adopter-visible changes plus a bridge cleanup.
ZSApplePaySetupRequiredException gains autoPresentedSetup field #
Mirrors Kit 1.3.4's payload addition on ZeroSettleError.applePaySetupRequired(autoPresentedSetup:). When the SDK auto-presented the system Wallet (because Configuration.applePaySetupBehavior == ApplePaySetupBehavior.presentBuiltInUI, the default), autoPresentedSetup is true; your app should NOT stack additional setup UI. When delegateToApp, the flag is false and your app owns the setup affordance — call ZeroSettle.instance.presentApplePaySetup() when ready.
try {
await ZeroSettle.instance.purchase(productId: 'pro_monthly');
} on ZSApplePaySetupRequiredException catch (e) {
if (e.autoPresentedSetup) {
// SDK already opened Wallet — no UI needed, maybe analytics
} else {
showCustomSetupSheet();
}
}
Source-compatible — the new field has a default of false, so existing catch (e) blocks keep working.
OfferManager factory: orphan-manager hazard fixed (Kit-side) #
Kit 1.3.4's offerManager(stripeCustomerId:) is now non-throwing and eager — it returns the canonical shared instance regardless of identify() state. The Flutter bridge no longer wraps the call in try/catch. Adopters using await ZeroSettle.instance.offerManager(...) benefit automatically: handles obtained before identify() runs now stay live and re-evaluate eligibility in place once the user identifies.
Internal: @Observable migration in ZeroSettleKit (no Flutter impact) #
Kit 1.3.4 migrated ApplePayAvailability from ObservableObject/@Published to Swift's modern Observation framework. The Flutter bridge subscribes to the deprecated-but-still-supported statePublisher (Combine AnyPublisher) — no Flutter-visible behavior change. Will be revisited before Kit 2.0 removes the Combine bridge.
Bumps #
- iOS pod dependency:
ZeroSettleKit ~> 1.3.4. - Plugin tracks Kit's 1.3.x line in lockstep.
1.3.3 #
Tracks ZeroSettleKit 1.3.3. No Flutter-visible API changes — the Kit's 1.3.3 work (OfferTipView and ZSOfferManager direct-init no longer require userId:) only affects native Swift call sites. Flutter already uses the canonical ZeroSettle.instance.offerManager(stripeCustomerId:) factory, so all 1.3.3 fixes are absorbed transparently.
- iOS pod dependency:
ZeroSettleKit ~> 1.3.3.
1.3.2 #
Tracks ZeroSettleKit 1.3.2. Pre-existing primitives that were missing in earlier 1.3.x Flutter releases are now bridged, plus the new Apple Pay availability + setup-behavior surface.
New purchase primitives #
purchase({productId, presentation?})— unified purchase entry point. Routes web vs. StoreKit per jurisdiction. Returns aCheckoutTransaction.purchaseViaStoreKit({productId})— explicit native StoreKit 2 purchase. Returns aCheckoutTransactionpopulated from the StoreKit 2Transaction(price/currency may benull).CheckoutTypeenum for the optionalpresentationargument onpurchase().
New state queries #
getCurrentUserId() → Future<String?>— observable identity state.getIsBootstrapped() → Future<bool>— SDK readiness flag adopters can poll/listen for before calling user-scoped APIs.recommendedAppAccountToken() → Future<String>— UUID derivation helper for non-UUID user IDs (Firebase, Privy, Auth0, etc.).
Pending claims (StoreKit ownership transfer UX) #
getPendingClaims() → Future<List<PendingClaim>>— read once.pendingClaimsUpdatesstream — emits whenever the SDK observes a StoreKit purchase that belongs to another ZeroSettle account on this device. Power your "transfer this purchase?" UX from this stream, then calltransferStoreKitOwnershipToCurrentUser({productId})when the user confirms.- New
PendingClaimmodel.
Apple Pay surface (new in Kit 1.3.2) #
Configuration.applePaySetupBehavior— new optionalconfigure()parameter.ApplePaySetupBehavior.presentBuiltInUI(default) opens system Wallet automatically when an Apple-Pay-only merchant has no Wallet card;ApplePaySetupBehavior.delegateToAppsurfacesZSApplePaySetupRequiredExceptionso your app can handle the flow.presentApplePaySetup()— opens system Wallet to add a card.getIsApplePayOnly() → Future<bool>— true when the active merchant config is Apple-Pay-only.getApplePayState() → Future<ApplePayAvailabilityState>— read the current.ready/.setupRequired/.unavailablestate.applePayStateUpdatesstream — observe state transitions to drive your own banner / pre-flight UI.- 2 new exceptions:
ZSApplePayUnavailableException,ZSApplePaySetupRequiredException. CheckoutConfig.paymentMethods+isApplePayOnlygetter on the remote config.
Bug fixes #
setBaseUrlOverridehad no concreteMethodChanneloverride (regression introduced in 0.4.0). Fixed; any environment usingbaseUrlOverride(staging, internal/ngrok) now configures correctly.- MIME-type cleanups in test mocks for
acceptSaveOffer/fetchUpgradeOfferConfigso facade round-trips don't fail on empty maps.
Bumps #
- iOS pod dependency:
ZeroSettleKit ~> 1.3.2. - Plugin tracks Kit's 1.3.x line in lockstep.
1.3.0 #
- Adds
identify()as the canonical entry point. Takes anIdentity(sealed class withIdentity.user,Identity.anonymous,Identity.deferred). Call once at launch (and again on sign-in/sign-out). Subsequent user-scoped calls read identity from internal state — no more passinguserId:everywhere. - Adds 10
userId-less method overloads.restoreEntitlements(),fetchTransactionHistory(),acceptSaveOffer({productId}),presentCancelFlow({productId}),pauseSubscription({productId, pauseDurationDays}),resumeSubscription({productId}),cancelSubscription({productId, immediate}),presentUpgradeOffer({productId}),fetchUpgradeOfferConfig({productId}),trackMigrationConversion(). Use these after callingidentify(). - Deprecates the
userId:parameter on every facade method, plusbootstrap(). They still compile and work through the 1.x line, but the parameter is annotated@Deprecatedand will be removed in2.0. Migrate by callingidentify()once and droppinguserId:from the rest. - Adds
appleMerchantId,preloadCheckout,maxPreloadedWebViewstoconfigure(). Configuration parity with iOS Kit 1.3.0. - Fixes
pauseSubscriptionsignature. The bridge now passespauseDurationDaysto ZeroSettleKit 1.3.0 (waspauseOptionId). DeprecatedpauseOptionIdparameter remains on the facade for source compatibility through 1.x. - Adds 5 new exception types mapped from ZeroSettleKit 1.3.0 errors:
ZSInvalidPublishableKeyException,ZSCheckoutConfigExpiredException,ZSTransactionVerificationFailedException,ZSPurchasePendingException,ZSUserNotIdentifiedException. - Fixes
CancelFlowOption.fromMapnull-safety fortriggersOffer/triggersPause(defaults tofalsewhen absent). - Bumps iOS pod dependency to
ZeroSettleKit ~> 1.3.0. - See
MIGRATING.mdin the iOS Kit for the full 1.3.0 migration guide; the same renames and deprecations apply to the Flutter SDK Dart facade.
0.4.0 #
- Aligns bridge with ZeroSettleKit 1.2.5.
- Adds
setCustomer({name, email})andlogout(). - Adds
transferStoreKitOwnershipToCurrentUser(replaces removedclaimEntitlement). - Adds
hasActiveEntitlement(productId),product(productId). - Maps
ZeroSettleError.checkoutNotStartedtoZSCheckoutNotStartedException. - Surfaces previously-missing model fields:
Entitlement.storekitOriginalTransactionId,originalPurchaseDateProduct.subscriptionGroupId,billingInterval,freeTrialDuration,isTrialEligibleCheckoutTransaction.storekitStatus
- Stubs removed APIs (
openCustomerPortal,showManageSubscription,presentSaveTheSaleSheet) withnot_implementederrors; Dart facade kept for source-compat. - Fixes bridge drift:
ZeroSettleKit.Product → ZSProduct,Price.cents → Price.amountCents,Entitlement.statusno longer optional.
0.3.4 #
- Update to ZeroSettleKit 1.2.3
0.3.3 #
- Maintenance release - no functional changes
0.3.2 #
- Add
ZSMigrateTipViewwidget for encouraging StoreKit users to migrate to web billing - Update to ZeroSettleKit 0.7.2
0.3.1 #
- Breaking: Add required
freeTrialDaysparameter tobootstrap(),warmUpPaymentSheet(),preloadPaymentSheet(), andpresentPaymentSheet()methods - Update to ZeroSettleKit 0.7.1+ with free trial support
- Update podspec to automatically use latest 0.7.x releases
0.3.0 #
- Add
remoteConfiganddetectedJurisdictiongetters for jurisdiction-specific checkout behavior - Add support for smart subscription management via
showManageSubscription() - Update to ZeroSettleKit 0.6.0+ API surface
0.2.0 #
- Update models and APIs to match ZeroSettleKit iOS SDK
- Add checkout events stream
- Improve error handling
0.1.0 #
- Initial release with core IAP functionality
- Support for product catalog, payment sheets, and entitlements
- iOS platform support via ZeroSettleKit