Site Map
 

 

All the information that you need to start accepting micropayments or micro-subscriptions on your website is explained on this page. Do it now in as little as 15 minutes. All you have to do is follow the steps below:
 

 

Step 1

Initialize iCents.net on your web pages

Select and copy of the following 2 lines of code:

 
<script src="http://www.icents.us/iCents.js" type="text/javascript" charset="iso-8859-1"></script>
<div id="iCents">iCents</div><script>iCents.Init("notestaccounts")</script>
 

Then paste these 2 lines of code in the HTML of all of your pages that have paid-links.

Note: We suggest you place them right after the <head> tag, near the beginning of the HTML code.  

 

Step 2

Place paid-links or micro-subscription buttons on your web pages, setting prices and other characteristics.

To create paid-links you simply need to add the price, duration and receiver attributes to the HTML of your anchor tags:

See this example:

This is the HTML of a regular link:

<a href="page.html"> a regular link </a>

And this is the HTML of a paid-link that costs 10 cents for 2 hours and pays to david@example.com:

<a href="page.html" price="US$ 0.10" duration="120" receiver="david$example#com" > a paid-link </a>

 

Learn more about the price, duration and receiver attributes.  

 

Step 3

Access Control

Apart from creating paid-links (micropayments or micro-subscriptions) you must also control the access to your content. This is necessary so that users cannot simply copy and paste the link location (URL) to bypass the iCents Payment Window and get access to the content for free.

There are 2 ways to do access control:

Simple Client-Side Access Control

A simple client-side access control does not require the installation of any software on your webserver. Simply add the following JavaScript code inside the HTML of the page you want to control access to:

 
    <style>body {display:none} </style>
    <script>if (iCents.IsLocked("http://example.com/protectedpage.html", true, true)) 
    document.location.replace("accessNotGranted.html"); 
    else document.body.style.display="block";</script>
    

If users enter the protected page without paying, they will be redirected to a "access not granted" page. For example, this paid-link takes you to a protected test page. Before paying, try to copy the link location and paste it in your browser to see what happens.

When copying the code above, do not forget to replace http://example.com/protectedpage.html with your real web page address. Also, the accessNotGranted.html file should be a real file in your server.

Note: You must also add the initialization code to the protected page (as explained in step 1 above).

Advanced Server-Side Access Control

We are still developing the advanced server-side access control API, and you will be able to use it in a number of ways. The easiest one will be to install some software we'll provide, and then follow the naming convention. The default naming convention (that you may change) is that all URLs that contain the term "_pay" must be paid to be accessed. For example, the following URLs are controlled:

http://www.icents.net/examples/image_pay.gif
or
http://www.icents.net/examples_pay/image.gif

This will be enough to control access. As you can see, it is easy to protect a whole folder or a single file, since the "_pay" can be anywhere within the URL.

Since the server-side access control is still under development, you should now only use the client-side access control, as described in the previous topic.

More Information

We have prepared complete instructions for you, structured in a logical fashion. Please follow these steps: