Content Authorization

When a user requests a metered page, the authorization process will trigger automatically.  If the user is granted access to the page content based on the configured business rules, she will simply see the requested content.

If the server API responds indicating the user does not have access to the content, then the PaymeterSdk will trigger an event alerting any listeners to the fact that the user is unauthorized.

The Paymeter SDK Loader sets up a default listener for these events.  The default functionality will display overlays to the user that describe what has happened.  These overlays might be invasive 'modal' pop-up windows that inform the user she must subscribe to gain access to the content or they might be less intrusive alert dialogs that float off to the edges of the page.  The specific look and feel of these overlays is completely configurable but outside the scope of this document.

The default functionality listens for two specific events to be triggered by the PaymeterSdk:

onWallFired

This event is fired when the server indicates that the user has exhausted his allotment of free views to a given content category.  The PaymeterSdk will handle this event by calling into the OverlaySdk and asking that library to retrieve the appropriate overlay that is associated with the given content category and that has been designated as a 'Wall'. 

The PaymeterSdk will then call back to the OverlaySdk and request that the overlay be rendered as a pop-up.  Displaying the overlay as a pop-up typically means the overlay shows as a raised window over the top of the existing content which is then blurred or grayed to make it unreadable.  The user is unable to dismiss the overlay except by following specific calls to action like subscribing, signing in to an existing account, etc.

onWarningFired

This event is fired when the server indicates that the user has reached a warning threshold.  The Paymeter business rules allow for setting thresholds where a warning message should be displayed.  This is typically a countdown message indicating to the user how many free views of the given content remain before she'll be stopped and asked to subscribe.

The PaymeterSdk will handle this event by calling into the OverlaySdk and asking that library to retrieve the appropriate overlay associated with the given content category and designated as a 'Warning'.  The PaymeterSdk will then ask the OverlaySdk to display that overlay as an alert.  Displaying the overlay as an alert typically means the overlay floats against (or near) an edge of the browser window without obscuring underlying content.  The default alert display allows the user to dismiss the message if she chooses not to answer a specific call to action.