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

Commit e6dee42

Browse files
authored
Merge pull request #124 from inplayer-org/donation-paywall-methods-addition-patch-1
Update paywall3.md
2 parents bcf36eb + bd66f31 commit e6dee42

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

docs/paywall3.md

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,17 @@ Example:
457457
paywall.isAuthenticated();
458458
```
459459

460+
### `showDonationsFlow`
461+
462+
This method initiates the donation flow for the provided `assetId`. The donation flow lists all donation options added to the asset that is being accessed.
463+
464+
Example:
465+
466+
```js
467+
paywall.showDonationsFlow(assetId);
468+
```
469+
470+
460471
### Asset Manipulation Methods
461472

462473
The Paywall 3.0 increases flexibility by introducing methods that help you easily manipulate with adding or removing specific or all assets to/from a paywall instance. Also, aids optimization of created paywall instances by giving you the choice of destroying those that are most likely not to be used in the recent future.
@@ -691,14 +702,25 @@ Although you may use the paywall's JavaScript methods to invoke some of the func
691702

692703
Here is the list of the HTML classes that can be used for creating each of the standalone functionalities:
693704

694-
| HTML class | Description |
705+
| HTML class | Description |
695706
|--------------|---------------|
696-
| `inplayer-paywall-login` | Invokes the login screen of the paywall |
697-
| `inplayer-paywall-logout` | Invokes the logout action |
698-
| `inplayer-paywall-account` | Invokes the 'My Account' screen of the registered user |
699-
| `inplayer-paywall-ccm` | Invokes the default card management screen |
700-
| `inplayer-paywall-change-pass` | Invokes the 'Change Password' screen |
701-
| `inplayer-paywall-purchases` | Invokes the 'My Purchases' paywall screen where an end-user can see the list of payments they have completed |
707+
| `inplayer-paywall-login` | Invokes the login screen of the paywall |
708+
| `inplayer-paywall-logout` | Invokes the logout action |
709+
| `inplayer-paywall-account` | Invokes the 'My Account' screen of the registered user |
710+
| `inplayer-paywall-ccm` | Invokes the default card management screen |
711+
| `inplayer-paywall-change-pass` | Invokes the 'Change Password' screen |
712+
| `inplayer-paywall-purchases` | Invokes the 'My Purchases' paywall screen where an end-user can see the list of payments they have completed |
713+
| `inplayer-paywall-donations` | Invokes the donations flow for the provided asset. See below for example of usage |
714+
715+
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:
717+
718+
```
719+
<button class="inplayer-paywall-donations" data-asset-id="{asset-id}" />
720+
```
721+
722+
When clicking on this element, the donations flow for the provided asset is initiated by opening the donation options screen.
723+
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.
702724

703725
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.
704726

@@ -750,6 +772,7 @@ Here are listed and defined the Paywall 3.0 standalone functions:
750772

751773
Table 4
752774

775+
753776
## Custom Asset Preview
754777

755778
There's a default asset preview template that you can tweak via our dashboard but if that doesn't meet your custom needs, you can always use the `noPreview` flag (by setting it to `true`) to disable displaying of the default preview altogether and put your own preview HTML code in the asset div.

0 commit comments

Comments
 (0)