Site Map

 

iCents.Init Function

To use the iCents.net platform on a web page, all you have to do is enter an initialization code in the page HTML. The 2 lines below may be included after the <head> tag, in the beginning of the HTML of all pages that have paid-links:

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

 

In the second line of code above, we have the iCents.Init, function, which has 6 optional parameters. Each of these parameters is detailed below.

Syntax with optional parameters:

iCents.Init(URL of an empty file, country and language codes,color scheme, allow turn off, allow test account, strict) 

You may omit any of these parameters, and enter them in any order, separated by commas.

URL of an empty file

This parameter indicates where iCents can find and empty file in your website's domain.

An empty file is an HTML file with nothing inside it, or a transparent picture (gif, png or jpg) or a 1 pixel X 1 pixel image.

Indicating the location of an empty file in the website's domain:

iCents.Init("http://www.site.com/empty.html")

or

iCents.Init("http://www.site.com/empty.gif"), ...

The only reason why you should provide an empty file is that, in case you don't, then for technical reasons the iCents Payment Window may flicker when closing, specially when using the Internet Explorer browser. This effect is usually not visible in Firefox, Safari and Google Chrome.

Note: This must be a file in your website's domain, in any folder to which users have free access, as long as it is within the exact domain of your website.

iCents.net will not work if you provide a file that is not in your website's domain or that is not accessible by all users.

For example, suppose that your website is www.site.com. You could place the file in the root directory: http://www.site.com/empty.html. Any other internal directory would also work, as long as it is within your domain. Here is another example: http://www.site.com/blog/users/empty.gif.

Tip for websites with multiple sub-domains:

Remember than domains like  site.com  or  www.site.com  or  chat.site.com are in fact different domains from each other, and therefore you would need to place a copy of the empty file in each of them.

However,  www.site.com  and  www.site.com/photos  are in the same domain. In this case, you may place a single copy of the empty file.

Country and Language

The default country is USA and the default language is english. You can indicate other two-letter country code and two-letter language code that will be used to display prices and the Payment Window. Based on the country you define, iCents.net will know the currency you want to use on the page. Some 150 countries and their currencies are available for use. However, not all languages are available. You must provide a valid language for the chosen country, otherwise iCents will revert to english.

So far, iCents works in 4 languages: English (en), French (fr), Spanish (sp) and German (de); and these languages can be used with any country. In the near future, we hope to have dozens of different languages available.

You may provide the country code and the language code, in this order, separated by a comma and with no spaces, as seen below:

Initializing English (USA):

iCents.Init("us,en")

 

Initializing French (France):

iCents.Init("fr,fr")

 

Initializing Spanish (Spain):

iCents.Init("es,es")

 

Initializing German (Germany):

iCents.Init("de,de")

Note, however, that once users sign in to an account or manually change the country and language, their choice will prevail over yours, and they will see all prices and converted to their local currency of choice.

Color Scheme parameter

When the user hovers the mouse over a paid-link, its price is automatically displayed. An optional iCents.Init parameter called "color scheme" changes the color of this displayed price. iCents.net allows the website to choose from several available color options. If no color scheme is entered, iCents.net will use the standard scheme: "defaultcolors". The other possible color schemes are: pastelcolors, graycolors, seacolors and earthcolors.

Using the Standard color scheme:

iCents.Init()
iCents.Init("defaultcolors")

Using the Pastel color scheme:

iCents.Init("pastelcolors")

Using the Gray color scheme:

iCents.Init("graycolors")

Using the Sea color scheme:

iCents.Init("seacolors")

Using the Earth color scheme:

iCents.Init("earthcolors")

Turning iCents Off (AllowTurnOff parameter)

When provided, the optional allowTurnOff parameter of the iCents.Init function will allow you to turn iCents on and off in the page. This parameter must usually be included when you need to make iCents compatible with sales via traditional subscription systems. A traditional subscription system is one in which the Internet user registers in the website, creates a login and password and pays a (usually fixed) monthly or annual fee to have access to the content of the entire website.

The iCents.net micropayment and micro-subscription platform is 100% compatible with all traditional subscription systems. You do not have to choose between the implementation of micropayments and micro-subscriptions or traditional subscriptions. They can be offered at the same time!

iCents.net has specific functionalities to make it compatible with traditional subscriptions. The website does not need to create different pages for subscribers and non-subscribers. When the Internet user logs into the website, after being positively identified as a valid subscriber, the website can easily turn iCents off for this user.

When iCents is turned off, all paid-links immediately behave like regular links, without payment. The website can turn iCents on and off whenever necessary, with no need for page reloads. Furthermore, when iCents is turned off, all micro-subscription buttons turn green to show full access has been unlocked. Note the "allowTurnOff" parameter does not turn iCents off on the page; the parameter only allows it to be turned off. To actually turn iCents off (and turn it back on) on the page whenever you desire, use the iCents.TurnOn and iCents.TurnOff functions.

Allowing iCents to be turned off in the page:

iCents.Init("allowTurnOff")

No Test Accounts (noTestAccounts parameter)

When you are setting up your pages and creating your paid-links, you will want to click the paid-links to test whether everything is working as you planned. iCents.net allows you to create and use test accounts to make sure that you do not spend any real money when performing tests on your website.

When provided, the optional noTestAccounts parameter of the iCents.Init function will not allow test accounts to be used in the page.

Preventing the use of test credits in the page:

iCents.Init("noTestAccounts")

Note: even when test accounts are allowed in the page this doesn't mean anyone can pay on your website using any test account. You must setup your web server so that it only unlocks content for the specific secret password of a test account you created.

Enforcing mandatory attributes (Strict parameter)

When provided, the optional strict parameter of the iCents.Init function will cause iCents to require the presence of all mandatory parameters in paid-links. This means that if one of the paid-links does not have all of the mandatory parameters, when the mouse is hovering over this link, an error message will appear instead of its price.

The presence of the price attribute is what turns a regular link into a paid-link.

Additionally, a paid-link has 2 more mandatory attributes: unlock and receiver. See below:

<a href="test.gif" price="US$0.1" unlock="test.gif" receiver="test@test.com")>
click here
</a>

If any one of these attributes is missing, the link will not display the price when the mouse is over it; instead an error message will appear. For example, if unlock is missing, the error message will be "Invalid Link! (missing unlock)".

If the "strict" parameter is not included in the iCents.Init function, the link will show the price even if one of these parameters is missing. This can be useful for testing during a web page development phase. Additionally, if the link is clicked, the Payment Window will appear as usual. However, links without all the mandatory parameters cannot actually be paid, and will only work when a test account is being used.