Skip to content
This repository was archived by the owner on Oct 2, 2025. It is now read-only.

Commit cffc798

Browse files
authored
Merge pull request #125 from inplayer-org/paywall-gifts-standalone-and-public-method-patch-1
Gift standalone and public method.md
2 parents e6dee42 + fa7b339 commit cffc798

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

docs/paywall3.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ var paywall = new InplayerPaywall('c6f4002f-7415-4eb6-ab03-72b0f7aff0e8',
165165
</script>
166166
```
167167

168+
168169
### Additional Asset Options
169170

170171
Apart from the main asset options, there are additional **CSS/JS scripts** available to be imported to the player being loaded after purchase, along withquery parameters meant for **player customisation.** More precisely, these scripts are given to the player being loaded after a purchase is completed. For this reason, they should be distinguished from the general scripts included in the asset embed process.
@@ -267,6 +268,7 @@ var paywall = new InplayerPaywall('c6f4002f-7415-4eb6-ab03-72b0f7aff0e8',
267268
</script>
268269
```
269270

271+
270272
### Additional Global Options
271273

272274
Depending on your preference, there are additional global options to include in your embed code as to customize the assets to your liking. You get to set up the language of your asset(s) via the paywall `language` option (English is the default one), you get to decide whether you want your user menu or the modal header logo displayed or hidden, the former via the `hideUserMenu` and the latter via the `hideLogo` option as in the example below:
@@ -361,6 +363,10 @@ To gain a better understanding of all paywall options mentioned above (both per
361363
| `brandingId` | Sets a global branding theme for all assets on a page. | Number | Global option |
362364
| `registerFirst` | If `true`, it sets the 'Register screen' as default, as opposed to the 'Login screen'; optional. | Boolean(set `false` by default) | Global option |
363365
| `ssoDomain` | By providing a valid `ssoDomain`, the SSO feature will be enabled; optional. | String | Global option |
366+
| `userMenuPosition` | The user menu can be set up to be positioned on the `left` or on the `right`. By default it is positioned on the right. | String | Global option |
367+
| `hideBuyGiftOption` | Disabling the `buy as a gift` option on the 'Price Options Screen'. | Boolean(set `false` by default) | Asset option |
368+
| `hideGiftFlowAfterPurchase` | Disabling the `buy as a gift` option on the screen after successful purchase. | Boolean(set `false` by default) | Asset option |
369+
364370

365371
## Paywall Methods
366372

@@ -467,6 +473,15 @@ Example:
467473
paywall.showDonationsFlow(assetId);
468474
```
469475

476+
### `showGiftsFlow`
477+
478+
This method initiates the gifts flow for the provided `assetId`.
479+
480+
Example:
481+
482+
```js
483+
paywall.showGiftsFlow(assetId);
484+
```
470485

471486
### Asset Manipulation Methods
472487

@@ -711,9 +726,10 @@ Here is the list of the HTML classes that can be used for creating each of the s
711726
| `inplayer-paywall-change-pass` | Invokes the 'Change Password' screen |
712727
| `inplayer-paywall-purchases` | Invokes the 'My Purchases' paywall screen where an end-user can see the list of payments they have completed |
713728
| `inplayer-paywall-donations` | Invokes the donations flow for the provided asset. See below for example of usage |
729+
| `inplayer-paywall-gifts` | Invokes the gifts flow for the provided asset. See below for example of usage |
714730

715731

716-
The HTML class **inplayer-paywall-donations** can be added to any HTML element. The `asset-id` represents the ID of a specific InPlayer asset. Usage example:
732+
The HTML classes **inplayer-paywall-donations**, **inplayer-paywall-gifts** can be added to any HTML element. The `asset-id` represents the ID of a specific InPlayer asset. Usage example for donations:
717733

718734
```
719735
<button class="inplayer-paywall-donations" data-asset-id="{asset-id}" />
@@ -722,6 +738,14 @@ The HTML class **inplayer-paywall-donations** can be added to any HTML element.
722738
When clicking on this element, the donations flow for the provided asset is initiated by opening the donation options screen.
723739
The donation options screen lists all donation options added to the asset that is being accessed. After selecting a donation option the end-user can proceed with the donation payment.
724740

741+
Usage example for gifts:
742+
743+
```
744+
<button class="inplayer-paywall-gifts" data-asset-id="{asset-id}" />
745+
```
746+
747+
When clicking on this element, the gift flow for the provided asset is initiated by opening the receivers email address screen. After entering the receivers email address the end-user can proceed with the gift payment.
748+
725749
The advantage of using these classes is that they come with a built-in logic for displaying and hiding the elements, depending on whether the user is authenticated or not. For example, the HTML element with the **inplayer-paywall-logout class** will only be shown when the user is authenticated.
726750

727751

0 commit comments

Comments
 (0)