Use A Payment Solution

The Widget Framework's Story content type provides support for premium content. Content items of this type display a Premium tab in Content Studio where an editor can mark the content item as premium content. The title and selected other fields can be set to non-premium, making these fields will be visible to non-paying site visitors.

When a visitor clicks on a premium story link, the system checks to see whether or not the visitor has paid for access and only displays the whole content item for paying visitors.

Payment must be handled by a third-party system. The process works as follows:

  • When a reader who has not paid clicks on a premium content link, he is offered the option of paying to read the content, and redirected to the payment system if he accepts.

  • After paying, the payment system sets a cookie for that user with an appropriate expiration date.

  • The user is redirected back to the Escenic site. The Escenic site's cache server (e.g Varnish) checks for the existence of the payment cookie. If the cookie is present then it adds a PAYWALL_OPEN value to the HTTP header.

  • The Escenic filter chain checks whether or not the PAYWALL_OPEN value is present in the header. If it is present, then the filter chain sets a request scope attribute called com.escenic.paywall.context

  • The template JSP reads the com.escenic.paywall.context attribute to determine whether or not to display premium fields.

graphics/paywall_working_flow.png