commit 0ca7d31605a979d79d62ffcdb65a6eed1074271c
parent c6a52d2e30aa8fad93b7fb96444909a5f8eab0c5
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 11 Oct 2025 17:41:44 +0200
update docs
Diffstat:
| M | README.md | | | 31 | +++++++++++++++++++------------ |
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/README.md b/README.md
@@ -5,7 +5,7 @@ before granting access to nodes.
## Features
-- Adds a "price" field to configurable content types
+- Adds a "price category" field to configurable content types
- Implements access control without tracking (but does use session cookies)
- Truncates node bodies to show teasers for users that did not (yet) pay
- Configurable which content types are subject to access control
@@ -25,29 +25,36 @@ Navigate to `/admin/config/content/Turnstile` to configure:
- **Enabled Content Types**: Select which content types should have the price field and access restriction
- **Payment Backend URL**: Taler merchant backend HTTP(S) URL of your payment backend service
- **Access Token**: Authentication token for the Taler merchant backend
+- **Enable access if backend is down**: Disables Turnstile if we cannot
+ setup payments with the Taler merchant backend for any reason
## Usage
-1. Create or edit a node of an enabled content type
-2. Set a price in the "Price" field to enable paywall protection
-3a. Users without the `payment_cookie` will see truncated content
-3b. Users with the cookie will see the original content
-3c. If merchant backend is down, all articles will be available gratis
- (so you do not annoy your subscribers if your payment processing
- functinality is down).
+1. Configure your merchant backend instance (bank account, currencies,
+ subscription types).
+2. Configure merchant backend access in Turnstile settings.
+ You may want to set it so that if the merchant backend is down,
+ all articles will be available gratis
+ (that way, you do not annoy your subscribers if your payment
+ processing is down).
+3. Define one or more price categories under "Structure"
+4. Enable Turnstile for some content types (bundles)
+5. Create or edit a node of an enabled content type
+6. Set a price category in the respective field to enable paywall protection
+7a. Users without the `payment_cookie` will see truncated content
+7b. Users with the cookie will see the original content
## TODO
-- add price *categories*
+- actually *use* price categories when determining article price!
+- keep or remove price field?
- Make truncation logic work with tiles / cards
-- Add support for subsciptions
-- Add support for discount tokens
## How it Works
The module uses `hook_entity_view_alter()` to intercept node rendering and
-calls the `hasAccess()` function to: --
+calls the `hasAccess()` function to:
1. Check if the customer already paid,
2a. If not set, truncates the content body,