-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement subscription purchase #1906
Merged
Merged
Changes from all commits
Commits
Show all changes
98 commits
Select commit
Hold shift + click to select a range
28a16e0
Rename shortLivedToken -> authToken
miasma13 2d34f75
Rename longLivedToken -> accessToken
miasma13 11d1b07
Tweak naming
miasma13 38e07b7
Move away from storing externalID
miasma13 6b00835
API for checking entitlements
miasma13 e50d906
API for checking available purchases on the App Store
miasma13 233e77a
Restrict subscription userscript to DDG and test domain
miasma13 ced340e
Remove leftover
miasma13 3fd6283
Error alerts test
miasma13 c756731
Check entitlements in settigns
miasma13 5befeaf
Shared APIService code and SubscriptionService
miasma13 81be159
Core of the purchase flow
miasma13 fd231db
Refresh available products on entering settings
miasma13 8b8c530
Complete purchase flow
miasma13 b8313e9
Rework AccountManager API to async
miasma13 7ce8193
Decouple Account and Purchase packages
miasma13 796dd94
Extract AppStore purchase flow
miasma13 38de072
Update sync Apple ID method return result
miasma13 cc4a3f4
Further tweaking result types
miasma13 4616b69
Further tweaking result types again
miasma13 0717198
Purchase flow errors
miasma13 5805873
Clean up
miasma13 5730c23
Present subscription access view from the offer and onboarding pages
miasma13 a7c009b
Gather subscription URLs in single place
miasma13 b853d93
Initialize and fetch subscription products add app launch
miasma13 b26b976
Rename isSignedIn to isUserAuthenticated
miasma13 046c232
Rename exchangeTokensAndRefreshEntitlements to exchangeAndStoreTokens
miasma13 b5201b7
Remove unnecessary call
miasma13 adac3fb
Extract restore flow to AppStoreRestoreFlow
miasma13 69b7939
Pass email PAT if present when creating an account
miasma13 7360026
Refresh account details after changing email
miasma13 f61b53a
Clean up account details after failed/cancelled purchase
miasma13 85625c3
Refine how error description is built
miasma13 769a22b
Flow for validating and refreshing short lived auth token for email m…
miasma13 9e2252f
Move auth token refresh to when email management flows are launched
miasma13 651eb88
Foundation for alerts
miasma13 ebf1b44
Support Stripe purchase flow
miasma13 cabb412
Adapt App Store purchase flow
miasma13 efa3bc0
Add todo
miasma13 cb9981f
Handle error during purchase
miasma13 31756a4
Edge cases for restore flow
miasma13 966e561
Check for active subscription when restoring
miasma13 0774113
Clean the logic
miasma13 1574e1a
Final tweaks to the restore during purchase
miasma13 b4d34c1
Fetch and show date in the settings
miasma13 49dc0ed
Merge in Purchase package with Account
miasma13 6f5bba1
Remove last trace of Purchase framework from the main target
miasma13 26d12c4
Remove Accounts from the main target
miasma13 fc8b971
Rename Subscription to SubscriptionUI
miasma13 cbb8ea1
Rename Account to Subscrtiption package
miasma13 aaad27d
Enable Stripe flow
miasma13 57d7a94
Change the subscription build config to Review
miasma13 05e82d2
Move files around
miasma13 423c898
Clean up
miasma13 3b9f696
Improve separation of concerns in the API
miasma13 5b9af1f
Show progress view on restoring subscription
miasma13 a2022d3
Purchase dependant environment setup
miasma13 ba50dd6
Navigate to Stripe customer portal to manage the subscription
miasma13 7ddfaf1
Update progress usage during purchase
miasma13 f63b050
Pass email token during Stripe account creation
miasma13 9730905
Cache subscription end date
miasma13 d78fc8e
Check for expiration
miasma13 6d9c30a
Refactor alerts
miasma13 5658059
Restore inactive buttons state and disable automatic sign out on expi…
miasma13 defe062
When setting purchase environment fetch available products to determi…
miasma13 5150caa
Hide Subscription related entrypoints if not authentcated and no able…
miasma13 1887c63
Sign out on expired subscription
miasma13 d87f0de
Merge branch 'main' into michal/subscription-purchase
miasma13 d0e952e
Switch BSK to a branch
miasma13 a170b5c
Update subscription logs
miasma13 4994937
Update logging
miasma13 1f638eb
Add conditionals for iOS 15 plus iOS product identifiers and linting …
afterxleep b330c99
Update logs
miasma13 9b1e950
Fix missed handling of an error case
miasma13 7bb6312
Tweak logs
miasma13 67e385b
Further update to logs
miasma13 a0c09d9
Additional logs
miasma13 f994e0b
Fix whitespace
miasma13 b9a539e
Fix further linting errors
miasma13 82cbbee
Further logging enhancements
miasma13 8fc9ce1
Disable forced sign in on purchase
miasma13 b69fc8f
Bump retries on entitlements polling
miasma13 5ad4d1a
Only pass authToken when accessToken is also present
miasma13 b7ba2c6
In unauthenticated state make the sections not greyed out
miasma13 4546733
Extract logic to separate functions
miasma13 40b262f
Clean AppStoreAccountManagementFlow.refreshAuthTokenIfNeeded
miasma13 b9289a1
Clean up errors
miasma13 5361ff7
Move checkForEntitlements
miasma13 c7bc825
Extract alert titles and descriptions
miasma13 035b923
Extract progress view titles
miasma13 439c275
Clean up todos
miasma13 4b6f0ff
Handle request for navigating to subscription feature via notification
miasma13 ebde2a4
Update comment
miasma13 ab18525
Remove dead code
miasma13 b6aa098
Add Stripe version of something went wrong alert
miasma13 127d19a
Merge branch 'main' into michal/subscription-purchase
miasma13 c2fbced
Fix linting errors
miasma13 71595d9
Add check for the Subscription import
miasma13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future I assume we can replace
STRIPE
with!APPSTORE
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tracked here: https://app.asana.com/0/0/1206144117097623/f