Content Monetization - Straas/Straas-web-document GitHub Wiki

Prerequisites

Before starting a payment, you must:

  1. Contact StraaS to enable your StraaS monetization module.
  2. Register a payment gateway account such as Spgateway. StraaS currently support ζ™Ίε―Œι€š, θ—ζ˜Ÿ.
  3. Enter the StraaS CMS (Content Management System) and setup the payment gateway information (i.e. hash_key and hash_iv).

Create your monetization rule

After all the prerequisites are fulfilled, you can now start setup monetization rules through control panel of StraaS CMS. Monetization rule is the unit of selling content. Each monetization rule includes video or playlist, price, and valid duration that can be configured.

We are planning create monetization rule through api in near future.

List monetization rules

After your server get the app token (How to get an app token?), your server can get monetization rules for specific video_ids or playlist_ids by RESTful API.

Let's say I want to list all the related monetization rules of the video1 and video2.

curl -X GET --header 'Accept: application/json' 
--header 'Authorization: Bearer <app token>' 
'https://app.straas.net/api/v1/monetization_rules?video_ids=<video1>,<video2>'

The detail api reference please see link.

Sell content to your customers

To sell a ticket, or sell a monetization rule, your server needs to create an order for your customers, which are created members, in StraaS paywall system.

curl -X POST --header 'Accept: application/json' 
--header 'Authorization: Bearer <app token>' 
-d '{ "member_id":<your member's id>,
"monetization_rule_id"=<monetization rule id>,
"redirect_url": <the url you want to redirect to after transaction is accomplished}'
'https://app.straas.net/api/v1/app/orders'

The detail reference please see link

Please note that there are extra flow need to be implemented in your server, see the detail in payment process.

Sell your content by redeem code, passcode or gift code

Through StraaS.io you can easily create the passcode in StraaS CMS and let StraaS takes care the rest of the service. Your audiences can easily type in the redeem code in StraaS's player and authorized to the streaming.

Appendix

Payment Process

The payment procedure is divided into 2 parts. The first part is the communication between a client device (denoted as CILENT in the following section), which is your customer from browser or mobile App, and your server (denoted as SERVER in the following section). The second part is between SERVER and your StraaS CMS (denoted as CMS in following section).

  1. [CLIENT <-> SERVER] CLIENT invokes payment procedure through UI

    • e.g. An User clicks the purchase button in the web page and then send a request to SERVER to create an order.
  2. [SERVER <-> CMS] Create an order

    • After SERVER received CLIENT's request, SERVER creates an order by the API POST /api/v1/app/orders with the monetization rule.
    • Note that:
      • The return_url should be provided in the API request by SERVER.
      • The redirect_url is provided in the API response by CMS .
  3. [CLIENT <-> SERVER] redirect user to the payment page

    • After SERVER received the response from CMS, SERVER MUST redirect CLIENT to redirect_url provided by CMS (Http status 302).
    • All the transaction and data model will be handled in the page of redirect_url.
  4. After the transaction is accomplished, CLIENT will be redirected to the return_url provided by SERVER, and the whole procedure is accomplished.

⚠️ **GitHub.com Fallback** ⚠️