InPlayer offers the solution of linking your Custom Payment service to our Authentication and Access Management services. In this guide you will learn how to integrate with our technology for the process of user authentication and access validation while using your own external payment method.
To begin with, first, you must obtain the status of an InPlayer Merchant. It is a simple and easy-to-do procedure, precisely described in this guide. Once you have gained the status of a merchant, it is time to create your first asset. On our platform, you protect your content by putting it in an 'asset'. So once created, our system recognizes your content as 'asset'. In other words, whenever your end-users try to access your content (after they completed the purchase successfully), the content specified in the asset (e.g. a video) will be displayed to the paying customer.
To create an asset, visit our asset creation documentation for assistance. Depending on the type of your content (video, audio, text, HTML, file etc) choose the suitable step-by-step guide to walk you throughout the procedure.
To register an account using the JS SDK, you need to call the
InPlayer.Account.signUp() method, entering all the specific signup data for your end-user.
You can find this method defined in detail here.
When the registration is completed and delivers a successful response, among the response parameters you will find a unique authentication token. This token indicates that the respective end-user is authenticated.
To authenticate or login an already existing account, you need to call the ‘InPlayer.Account.signIn()' method.
Proceed here to learn more about this method.
On the other hand, if you decide to use our API, these are the endpoints you need:
Start by firing the [POST] /v2/accounts/customers request and enter all the relevant details that will get your end-user registered in our system.
For a more detailed description of this endpoint refer to this section of our API documentation.
As for user authentication, fire the [POST] /accounts/authenticate request.
You can find this endpoint documented here.
Once the user authentication is confirmed to be successful, what follows is checking whether your end-user has access to the asset/content they are trying to reach. To do so, if you have been using our JS SDK library, you need to call the
checkAccessForAsset SDK method with specified asset ID.
To check out our JS SDK documentation, specifically for this method, proceed here.
In case you have been using our APIs, the
GET items access is to be fired with the specified asset ID (item ID) and the token as an authorization header.
Proceed here to find the endpoint concisely described and check out the possible responses.
If the access to the required asset is verified, the content will be included in the response and you can use it to display the content on the page. On the contrary, if the end-user’s access is not found, they must be redirected to your payment screen where the payment process can be completed successfully.
Since the payment process is your implementation that functions completely independent of our platform, you present the end-users with a payment screen displaying your pay-per-view and/or subscription prices. The payment process is initiated and completed at your payment page. Afterwards, you get to grant the customers access to the required asset via our services.
When the payment is confirmed to be successful, you need to grant access to your asset in our system so that your customers can reach the content they purchased. For this reason, you need to fire the
Grant access to an item request with the specified asset ID, consumer ID, access fee ID or expiration date, and the token as an authorization header. At this point, even if you have been using JS SDK methods so far, to grant access you are going to need the
[POST] /items/access endpoint.
Proceed here to find this endpoint documented in detail. For a per-per-view type of asset, the access duration period will last from the activation date till its expiration date. In the case of subscription, every time a new rebilling transaction occurs in your processor, the grant access endpoint should be invoked again thus extending the access to the paying subscriber.
Finally, once the process of granting access is completed, another access check should be issued in order to have the content of the asset rightfully displayed to the paying customer. Again, you need to call the
checkAccessForAsset JS SDK method or the
GET items access API endpoint. If the access is confirmed, your end-users are ready to consume the content behind your asset, if not, they are to be redirected to your payment screen to complete the purchase successfully.