Add checkout-only mode for web2app flows#440
Closed
KanishkKundu05 wants to merge 3 commits intosuperwall:developfrom
Closed
Add checkout-only mode for web2app flows#440KanishkKundu05 wants to merge 3 commits intosuperwall:developfrom
KanishkKundu05 wants to merge 3 commits intosuperwall:developfrom
Conversation
Adds `openWebCheckout(forPlacement:)` convenience method and `checkoutOnly` option on `PaywallOverrides` that skips the intermediate paywall UI and presents only the Stripe checkout sheet. The paywall webview still loads invisibly to generate the checkout URL, while a native loading spinner is shown to the user. This is fully opt-in and backward compatible — all existing behavior is unchanged. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
In checkout-only mode the Stripe checkout sheet is the only visible content, so present it as .overFullScreen without animation instead of as a half-sheet sliding over an invisible paywall. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds step-by-step setup instructions, dashboard JS example, error handling patterns, and describes the full user-visible experience. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
Closing as this is resolved on Slack |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
openWebCheckout(forPlacement:)public convenience method for web2app flows that skip the intermediate paywall UI and go directly to the Stripe checkout sheetcheckoutOnlyoption toPaywallOverrides(defaults tofalse, fully backward compatible)File Changes
PaywallOverrides.swiftcheckoutOnly: Boolproperty (defaultfalse)PublicPresentation.swiftopenWebCheckout()methods; threadedpaywallOverridesthroughinternallyRegister()PaywallViewController.swiftPaywallOverridesTests.swiftcheckoutOnlydefaults and initializationCHANGELOG.mddocs/checkout-only-mode.mdHow It Works
Superwall.shared.openWebCheckout(forPlacement: "placement")openPaymentSheet→ spinner removed, Stripe checkout sheet presentedDashboard Requirement
The paywall must be configured to auto-trigger the purchase action on page load via custom JS in the paywall editor.
Test plan
xcodebuild build)scripts/lint.sh)openWebCheckout(forPlacement:)with an auto-trigger paywall and verify no intermediate paywall is shown🤖 Generated with Claude Code
Greptile Summary
This PR introduces checkout-only mode for web2app flows, allowing users to skip the intermediate paywall UI and go directly to the Stripe checkout sheet.
openWebCheckout(forPlacement:)public convenience methods (with and without feature gates)checkoutOnly: Boolproperty toPaywallOverrides(defaults tofalsefor full backward compatibility)PaywallViewControllerThe implementation is clean and follows the existing architectural patterns. All initializers properly default
checkoutOnlytofalse, ensuring no breaking changes.Confidence Score: 5/5
Important Files Changed
checkoutOnlyboolean property with proper defaults across all initializersopenWebCheckout()convenience methods and threadedpaywallOverridesparameter throughFlowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[User calls openWebCheckout] --> B[Create PaywallOverrides with checkoutOnly=true] B --> C[Paywall presents] C --> D{isCheckoutOnly?} D -->|Yes| E[setupCheckoutOnlyMode] D -->|No| F[Normal paywall flow] E --> G[webView.alpha = 0] E --> H[Show native spinner] E --> I[Hide exit/refresh buttons] G --> J[Webview loads invisibly] H --> J I --> J J --> K{Webview success?} K -->|No| L[handleWebViewFailure] L --> M[removeCheckoutOnlySpinner] M --> N[Dismiss paywall] K -->|Yes| O[JS fires openPaymentSheet] O --> P[removeCheckoutOnlySpinner] P --> Q[Show Stripe checkout sheet] Q --> R{User action?} R -->|Purchase| S[Normal purchase flow] R -->|Cancel| T[Auto-dismiss paywall] S --> U[didRedeemSucceedDuringCheckout=true] U --> V[Keep paywall for completion]Last reviewed commit: 16a344e
(5/5) You can turn off certain types of comments like style here!