-
Notifications
You must be signed in to change notification settings - Fork 5
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
✨ Add support for Single Post Subscription (including fix as per Google Extended Access UX) #2
Open
AnuragVasanwala
wants to merge
31
commits into
Automattic:trunk
Choose a base branch
from
rtCamp:fix/google-extended-access-ux
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
✨ Add support for Single Post Subscription (including fix as per Google Extended Access UX) #2
AnuragVasanwala
wants to merge
31
commits into
Automattic:trunk
from
rtCamp:fix/google-extended-access-ux
Conversation
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
Update php and js scripts to use fields defined by option page.
✨ Add `Extended Access` submenu option page inside `WooCommerce`
…Camp/newspack-extended-access into feat/single-post-subscription
When saving Google Client API ID, notice displayed/hide after second attempt. This has been fixed by using `admin_notices` hook.
🐛 Fix admin notice issue
🔥 Fix critical issue where `$allowed_referrers` is not set correctly
This commit addresses: - Test files are prefixed with `test-*` - Remove unnecessary codeblock - Update few constants
…le-extended-access-ux
Merge `fix/google extended access ux`
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.
The goal of the PR is to add support for Single Post Subscription by utilizing Google Extended Access and COOKIE based authentication for the post.
Changes proposed in this Pull Request:
Dashboard -> WooCommerce -> Settings -> Memberships -> Newspack Extended Access
).COOKIE
based authentication (based on'newspack_' . md5( $post_id . $user_id )
).WooCommerce Memberships
)WooCommerce Memberships
)How to test the changes in this Pull Request
composer install
?gaa_at=testp&gaa_n=1234567&gaa_sig=testsig&gaa_ts=999999999
UX Flow
Scene 1: Anonymous User (New User)
?gaa_at=testp&gaa_n=1234567&gaa_sig=testsig&gaa_ts=999999999
parameters embedded by Google News).a. REST Controller responds with
NO_USER_LOGGED_IN
.b. Google Extended Access now displays
Google Login Prompt
.c. User login through
Google Login Prompt
(and user gets automatically registered by controller ascustomer
).a. REST Controller responds with
NO_SUBSCRIPTION
found for user for the post.b. Google Extended Access displays
Google Subscription Prompt
.c. Here, if user click on
Subscribe
button, user will be forwarded to the paywall page.d. If user click
X
button,Google Subscription Prompt
went away, a COOKIE on the machine will be created and Google Extended Access unlocks article.Scene 2: Logged in User with No Subscription
?gaa_at=testp&gaa_n=1234567&gaa_sig=testsig&gaa_ts=999999999
parameters embedded by Google News).a. REST Controller responds with
LOGGED_IN
user but postNOT_GRANTED
.a. REST Controller responds with
NO_SUBSCRIPTION
found for user for the post.b. Google Extended Access displays
Google Subscription Prompt
.c. Here, if user click on
Subscribe
button, user will be forwarded to the paywall page.d. If user click
X
button,Google Subscription Prompt
went away, a COOKIE on the machine will be created and Google Extended Access unlocks article.Scene 3: Registered in User with Subscription
?gaa_at=testp&gaa_n=1234567&gaa_sig=testsig&gaa_ts=999999999
parameters embedded by Google News).a. REST Controller responds with
NO_USER_LOGGED_IN
.b. Google Extended Access now displays
Google Login Prompt
.c. User login through
Google Login Prompt
.a. REST Controller responds with
VALID_SUBSCRIPTION
found for user for the post.b. Google Extended Access unlocks article.
Scene 4: Logged in User with Subscription
?gaa_at=testp&gaa_n=1234567&gaa_sig=testsig&gaa_ts=999999999
parameters embedded by Google News).a. REST Controller responds with
LOGGED_IN
user withVALID_SUBSCRIPTION
.b. Google Extended Access unlocks article.
Dependency
This plugin requires following plugin to be installed, configured and active:
Configuration
This plugin requires a valid
Google Client API ID
specific to your Newspack Site domain. Please create a newGoogle Client API ID
for your site, if not already created. Follow instruction provided on Setting up Google Client API ID.Setting up Google Client API ID
Login to you Newspack site dashboard as an
Administrator
:WooCommerce
menuSettings
menuMemberships
tabNewspack Extended Access
Google Client API ID