### Local Theme Preview Setup
Source: https://github.com/plenigo/plenigo.github.io/blob/master/theme/README.md
Commands to clone the theme, install dependencies, and start the local preview server.
```bash
git clone https://github.com/pages-themes/tactile
cd tactile
script/bootstrap
bundle exec jekyll serve
```
--------------------------------
### Complete Example Page with Metered Views and Client-Side Paywall
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/javascript/includes/load_content_afterwards.md
A full HTML page example demonstrating Plenigo SDK integration for a client-side paywall. This setup assumes test mode with metered views enabled and loads content from a URL based on the product ID and base URL.
```html
A great news page
```
--------------------------------
### Plenigo SDK Initialization (Example)
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/java/includes/paywall.md
This is an example of the script tag after replacing the placeholder COMPANY_ID with a specific company ID.
```javascript
```
--------------------------------
### Complete Example Page with Test Mode
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/javascript/includes/hide_content_by_default.md
A full HTML page example demonstrating SDK integration with client-side paywall, test mode, and metered views enabled. Insert your specific data.
```html
A great news page
This is the content area
You don't have the right to see this content! Sry!
This is the content you waited for!
```
--------------------------------
### Complete Example Page with Plenigo SDK
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/javascript/includes/hide_content_afterwards.md
A full HTML page example demonstrating the Plenigo JavaScript SDK integration for a client-side paywall. This example is configured for test mode with metered views enabled, showing how to set up content areas and provide options for users to purchase or log in.
```html
A great news page
This is the content area
This is the content you waited for!
You don't have the right to see this content! Sry!
```
--------------------------------
### PHP SDK Example: Grant and Remove Access
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/php/includes/user_access_rights.md
This example demonstrates the full configuration and usage of granting and removing user access rights for products using the Plenigo PHP SDK.
```php
New York City Reimagines How It Works
After serving a tour in the sticky rice and fruit fields of northeast Thailand for the Peace Corps,
Leanne Spaulding landed a job at a Virginia-based trade association, working her way to a master?s degree from
Duke University in environmental management. Now Ms. Spaulding is in New York, where she was recently hired by the city's
Sanitation Department. Her duties, naturally, involve garbage, but not in the traditional sense: Ms. Spaulding is trying to help sell residents of
the nation's largest city on its ambitious composting effort. In that respect, her job is like thousands of others
added in recent years that are slowly changing the day-to-day face of government service.
There are now nearly 294,000 full-time city employees, more than at any point in the city?s history. The growth
under Mayor Bill de Blasio comes at a time of record revenues in a booming city, and has been across the board; nearly
every city agency now employs more workers than it did in 2014, when the mayor took office.
The hiring has allowed the de Blasio administration to restaff agencies that were cut back by Mayor Michael R.
Bloomberg after the economic downturn of 2008. But Mr. de Blasio has gone far further, expanding the work force beyond its
```
--------------------------------
### Full HTML Example with Plenigo Video Player
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/javascript/includes/video3q.md
An example of a complete HTML page embedding a video player with access control. It includes the necessary script tag for the Plenigo SDK and the configuration for the video player, including product IDs and a custom no-access callback.
```html
My 1st video
```
--------------------------------
### Serve Theme Locally
Source: https://github.com/plenigo/plenigo.github.io/blob/master/README.md
Start the Jekyll preview server to view your site locally. Access it via localhost:4000 in your browser.
```bash
bundle exec jekyll serve
```
--------------------------------
### Full Page Integration Example
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/custom_integration/paywall.md
A complete HTML page demonstrating the Plenigo SDK integration with concrete IDs and the checkout string.
```html
New York City Reimagines How It Works
New York City Reimagines How It Works
After serving a tour in the sticky rice and fruit fields of northeast Thailand for the Peace Corps, Leanne Spaulding landed a job at a Virginia-based trade association, working her way toa master's degree from Duke University in environmental management.
Now Ms. Spaulding is in New York, where she was recently hired by the city?s Sanitation Department. Her duties, naturally, involve garbage, but not in the traditional sense: Ms. Spaulding is trying to help sell residents of the nation's largest city on its ambitious composting effort. In that respect, her job is like thousands of others added in recent years that are slowly changing the day-to-day face of government service.
There are now nearly 294,000 full-time city employees, more than at any point in the city's history. The growth under Mayor Bill de Blasio comes at a time of record revenues in a booming city, and has been across the board; nearly every city agency now employs more workers than it did in 2014, when the mayor took office.
The hiring has allowed the de Blasio administration to restaff agencies that were cut back by Mayor Michael R. Bloomberg after the economic downturn of 2008. But Mr. de Blasio has gone far further, expanding the work force beyond its pre-recession peak, a costly investment that is not without risk: the city could be vulnerable to an economic downturn.
A report from Moody's earlier this year heralded the diversity in the city's economy, but noted that the city's debt service, pension and retiree health care costs were growing rapidly. Increasing headcount brings added costs with it in the future, said Nick Samuels, a senior credit officer and the author of the report. Keeping up with that over time will require additional economic growth.
Do you want to read this article ?
Please buy a subscription
```
--------------------------------
### Client-Side Paywall Configuration
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/javascript/includes/hide_content_by_default.md
Example snippet for client-side paywall integration. This configures the SDK to show content when the user has purchased the product.
```html
```
--------------------------------
### Paywall Script with Concrete IDs
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/custom_integration/paywall.md
Example of the paywall script with specific company and product IDs implemented.
```html
```
--------------------------------
### Plenigo SDK Script Tag with Example IDs
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/custom_integration/paywall.md
An example of the Plenigo SDK script tag with specific company and product IDs populated. Ensure 'YOUR_DOMAIN_URL' and 'YOUR_IDENTIFIER_FOR_THIS_CONTENT' are also replaced as needed.
```html
```
--------------------------------
### Get Product Information (PHP)
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/custom_integration/includes/products.md
Retrieve product details using the product ID with the PHP SDK.
```php
```
--------------------------------
### Configure and Build Checkout Snippet
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/php/includes/paywall_php.md
This example demonstrates how to configure the Plenigo PHP SDK with your credentials and then build a checkout snippet for a product if the user has not yet purchased it. Ensure the SDK is configured before use.
```php
build();
}
?>
```
--------------------------------
### Configure and Get Subscriptions with PHP SDK
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/php/includes/company_information_php.md
Configure the plenigo PHP SDK with your secret and company ID, then call the CompanyService::getSubscriptions method to retrieve a paginated list of subscriptions. The method accepts start date, end date, test mode, page number, and page size as parameters. Page and size values are clamped to established limits if out of range.
```php
The title of the article
After serving a tour in the sticky rice and fruit fields of northeast Thailand for the Peace Corps,
Leanne Spaulding landed a job at a Virginia-based trade association, working her way to a master's degree from Duke
University in environmental management. Now Ms. Spaulding is in New York, where she was recently hired by the city's Sanitation Department.
Her duties,naturally, involve garbage, but not in the traditional sense: Ms. Spaulding is trying to help sell residents of the
nation's largest city on its ambitious composting effort. In that respect, her job is like thousands of others added in
recent years that are slowly changing the day-to-day face of government service.
<#if showPaywall>
Do you want to read this article ?
Please buy a subscription
<#else>
There are now nearly 294,000 full-time city employees, more than at any point in the city's history. The growth under Mayor Bill de Blasio comes at a time of record revenues in a booming city, and has been across the board; nearly every city agency now employs more workers than it did in 2014, when the mayor took office.
The hiring has allowed the de Blasio administration to restaff agencies that were cut back by Mayor Michael R. Bloomberg after the economic downturn of 2008. But Mr. de Blasio has gone far further, expanding the work force beyond its pre-recession peak, a costly investment that is not without risk: the city could be vulnerable to an economic downturn.
A report from Moody's earlier this year heralded the diversity in the city's economy, but noted that the city's debt service,
pension and retiree health care costs were growing rapidly. Increasing headcount brings added costs with it in the future, said Nick Samuels, a senior credit officer and the author of the report.
Keeping up with that over time will require additional economic growth. Carol Kellermann, the president of the nonprofit Citizens Budget Commission, a fiscal watchdog group, questioned Mr. de Blasio's decision to rapidly grow the city's head count during flush times, saying that it made it more likely that new rounds of painful layoffs could be necessary in the city's future.
You don't have to keep adding people every year, she said. You could manage what you have and use the staff that you have to run programs. Find a way to do the things you want to do with the existing work force.
```
--------------------------------
### Integrate Checkout Flow for Product Purchase (PHP)
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/php/includes/products_php.md
This example demonstrates checking if a user has bought a product and, if not, building a checkout snippet for them to purchase it. It requires SDK configuration and product details.
```php
setType(ProductBase::TYPE_EBOOK);
// 4.Step: This method returns true if the user has already bought the product.
$hasUserBought = UserService::hasUserBought($product->getId());
if ($hasUserBought === FALSE) {
// Since he has not bought the product, we need to build the
// checkout snippet so that he can do the flow on the Frisbii Media site and buy.
$checkout = new CheckoutSnippetBuilder($product);
$plenigoCheckoutCode = $checkout->build();
}
?>
```
--------------------------------
### Example Category Data Response
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/java/includes/products_java.md
This is an example of the JSON structure returned for category data, including category ID and title.
```json
{
{
"categoryId": "bbxEfY22724581319741"
"title": "Test Category for API",
},
{
"categoryId": "9RQtmq06165103137741"
"title": "Test Category for API 2",
},
{
"categoryId": "6g3lbAZ8762418866641"
"title": "Test Category for API 3",
}
}
```
--------------------------------
### Start Registration for Checkout
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/javascript/includes/js_v3.md
Starts the checkout process with a registration flow instead of login. This is used when a new user needs to be created during checkout.
```javascript
new plenigo.Checkout("$purchase.purchaseId", { elementId: "plenigoCheckout" }).register();
```
--------------------------------
### Buy a Free Product with PHP SDK
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/php/includes/voucher_campaigns.md
Use this snippet to allow customers to 'purchase' a free product. Ensure the product is configured as free (0.00 price) in your backend.
```php
```
--------------------------------
### Start Selfservice on Subscription Detail Page
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/javascript/includes/js_v3.md
Start the self-service portal directly on a customer's subscription detail view by providing the `subscriptionId` in the configuration.
```javascript
new plenigo.Snippets(plenigoTransferToken, {elementId: "plenigoSnippets", subscriptionId: 123456}).start();
```
--------------------------------
### Configure Java SDK and Create Checkout Snippet
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/java/includes/checkout_external_products_java.md
Configure the Plenigo Java SDK with your secret and company ID. Then, set up the product details including price, description, ID, currency, and tax type. Finally, build the checkout snippet for external products.
```java
String secret = "Q11DfmzRQcQie3Pp3twzKO32HsV78TngrY2ddvj"; // // The secret key of your specific company.
String companyId = "23NuCmdPoiRRkQiCqP9Q"; // // The company ID of your specific company.
PlenigoManager.get().configure(secret, companyId );
// 2.Step: Set the product.
double price = 12.99; // The price of the product.
String description = "Test"; // The description of the product.
String productId = "123456"; // The product id of the product.
String currency = "USD"; // The currency.
Product product = new Product(price, description, id, currency, TaxType.DOWNLOAD);
// 3.Step: Creating the checkout snippet for this product.The snippet will have the following format: plenigo.checkout('ENCRYPTED_STRING_HERE').
CheckoutSnippetBuilder snippetBuilder = new CheckoutSnippetBuilder(product);
String snippet = snippetBuilder.build();
```
--------------------------------
### Start Password Forgot with Email
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/javascript/includes/js_v3.md
Starts the password forgot process with a pre-filled email address. This is useful when the user's email is already known.
```javascript
// start the process
var config = {
elementId: "plenigoLogin", // the DOM element you want to put the iframe in
email: "john.doe@example.com" // use config attribute email to set the email address in password forgot form
};
new plenigo.SSO(config).forgotPassword();
```
--------------------------------
### Cross-Client Order Webhook Payload Example
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/php/includes/v3.md
Example JSON payload for a CROSS_CLIENT_ORDER webhook, containing entity type, callback type, entity ID, and order details.
```json
{
"entityType": "CROSS_CLIENT_ORDER",
"callbackType": "CREATION",
"entityId": "1235184",
"entity": {
"email": "jane.doe@example.com",
"voucherCode": "YTQQ-B3Y4-MV2S"
}
}
```
--------------------------------
### plenigo.start()
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/javascript/includes/general_functionality.md
Initializes the Frisbii Media JavaScript-SDK. This is called automatically when the SDK is included in the HTML page and the page loads. If the SDK is loaded manually after the page has loaded, this method must be called to start the initialization.
```APIDOC
## plenigo.start()
### Description
Initializes the Frisbii Media JavaScript-SDK. This function is automatically called when the SDK is included in the HTML page and the page is loaded. If you are loading the Javascript-SDK manually after the page is loaded, you need to start the initialization by calling this method.
### Method
`plenigo.start()`
### Endpoint
N/A (JavaScript function call)
```
--------------------------------
### Buy Free Product with PHP SDK
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/custom_integration/includes/voucher_campaigns.md
Use this method to allow customers to 'purchase' a free product assigned to a campaign. Ensure you have the correct product and customer IDs. Errors are handled as exceptions.
```php
getProductList(int pageSize, int page)`
### Parameters
#### Query Parameters
- **pageSize** (string) - Required - The size of the page (Range from 10 to 100).
- **page** (string) - Required - The page number.
### Request Example
```java
// Configure the Java SDK
String secret = "Q11DfmzRQcQie3Pp3twzKO32HsV78TngrY2ddvj";
String companyId = "23NuCmdPoiRRkQiCqP9Q";
PlenigoManager.get().configure(secret, companyId);
// Get a product list
int pageSize = 10;
int page = 0;
PagedList productList = ProductService.getProductList(pageSize, page);
productList.getList();
```
### Response
#### Success Response
Returns a `PagedList` containing `ProductInfo` objects, each with a productId, title, and description.
#### Response Example
```text
ProductInfo:
title: Test Product
id: RgKUHT78563989856641
description: Test
ProductInfo:
title: News
id: SVjYNCn5024345046641
description: Test
```
### Implementation without Frisbii Media SDK
Direct REST API call: [Get product list request](https://api.plenigo.com/#!/product/getProductsWithFullDetails)
```
--------------------------------
### Configure and Build Login Snippet in PHP
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/custom_integration/registration_and_login_with_SDKs.md
Configure the PHP SDK with your secret key and company ID, then use LoginSnippetBuilder to generate the login snippet. Ensure the SDK is correctly installed.
```php
build();
```
```php
build();
$isLoggedIn = \plenigo\services\UserService::isLoggedIn()
?>
```
--------------------------------
### Get Product Data
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/java/includes/products_java.md
Retrieves detailed information for a specific product using its ID.
```APIDOC
## Get Product Data
### Description
Retrieves detailed information for a specific product using its ID. This method is part of the `com.plenigo.sdk.services.ProductService`.
### Method Signature
`ProductData getProductData(String productId)`
### Parameters
#### Path Parameters
- **productId** (string) - Required - The product id from the Frisbii Media Backend.
### Request Example
```java
// Configure the Java SDK
String secret = "Q11DfmzRQcQie3Pp3twzKO32HsV78TngrY2ddvj";
String companyId = "23NuCmdPoiRRkQiCqP9Q";
PlenigoManager.get().configure(secret, companyId);
// Get product information
String productId = "aitnVIz1503443609941";
ProductData productData = ProductService.getProductData(productId);
// Access product details
String title = productData.getTitle();
String id = productData.getId();
double price = productData.getPrice();
String currency = productData.getCurrency();
```
### Response
#### Success Response
Returns a `com.plenigo.sdk.models.ProductData` object containing the product's title, ID, price, and currency.
#### Response Example
```text
ProductData:
title: Test Product
id: RgKUHT78563991046641
price: 18,99 EUR
```
### Implementation without Frisbii Media SDK
Direct REST API call: [Get product information request](https://api.plenigo.com/#!/product/getProduct)
```
--------------------------------
### Prepare Purchase with Offer and Bonus
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/php/includes/v3.md
This snippet demonstrates how to prepare a purchase for an offer that includes one or more bonus products. Ensure debug mode is disabled in production.
```php
// @see https://api.plenigo-stage.com/#operation/preparePurchase
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
$payload = [
"debugMode" => true, // enable debugging in checkout (please turn it off in prod environment)
"customerIpAddress" => $ip,
"customerId" => $customer->customerId,
// there should not be any items attribute here
"items" => [
[
"plenigoOfferId" => "O_6E487EBURRY35FOD0J", // offerId of your all pdf product
"quantity" => 1,
"plenigoBonusIds" => ["BO_ZWOSLHAS3CVOG73G2"], // a list of bonus products you want to sell together with offer
]
]
]);
$response = json_decode($client->request('POST', '/checkout/preparePurchase', [
'headers' => ['X-plenigo-token' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aGVzZSI6ImFyZSIsInBsZW5pZ28iOiJ0ZXN0IiwiZGF0YSI6ImRvIiwibm90IjoiY29uc3VtZSJ9.xnFAQQbHEFLisgeU2YqWsIfpCgEbmh_Hy59Ja0Ztxyw'],
'json' => $payload
])->getBody()->getContents());
```
--------------------------------
### Register User and Create Checkout Snippet with PHP SDK
Source: https://github.com/plenigo/plenigo.github.io/blob/master/pages/sdks/php/includes/external_user_management_php.md
This snippet demonstrates registering a new user and creating a checkout process. It requires SDK configuration and product details. The generated code can be used in HTML for a checkout button.
```php
build($settings, $loginToken);
?>
```