Blog

Friday 13 December 2019

Micropayment technical information

 

In this tutorial, we will explain how to monetize your content with the Rentabiliweb micropayment solutions.
First, we will see how to install the oneshot payment and the BC personalized payment above 3 euros (premium and above customers).
Then you will learn to use the affiliation with the Rentabiliweb payment forms.

Contents :

1. MICROPAYMENT

1.1 One Shot payment installation

Rentabiliweb One shot micropayment is a secure solution allowing you to make your website profitable.

Phone Billing/SMS premium

You have a complete international offer available.
A vocal machine dictates the code by telephone.
By sms : The user sends a keyword and receives the code by sms in return. Each country establishes its own way of billing.
You must choose different price levels to offer your members.
Bank card

We offer several price points : from 1.80 to 15 euros.
If you want to use a precise price point higher than 3 euros, we advise you to create a BC oneshot document.

Note : The Mistercash configuration is connected to our Bankcard payment solution.

Setting

The available parameters are :

  • Per entry : the code will be valid x times ;
  • Per day : the code will be valid for x day as from the first login.

1.1.1 Payment form

The form installation is very easy and fast.
The script contains all visuals and technical elements of the form allowing you to secure and make your paid content profitable.

Three different forms are available :

  • Classic form (popup) : presentation of the national flag of each country, as well as an area to enter the code.
    By clicking on a flag, the user will be able to see in a popup, all the payment types available for his country.
  • Iframe form : it consists of the same areas as the classical form but it does not open a popup to display the different payment means.
    The user see directly the number to dial.
    It includes a geo-positioning software function showing the available payment means for the internet user’s country.
  • The Facebook form : it has the same features as the iframe form, but the design is diffrent because it is used to monetize the Facebook applications.

Parameters required to submit a code into the form :

  • docId : Your document ID ;
  • siteId : Your site ID where the document is configured ;
  • code[n] : the field allowing the user to enter the access code to your paid content (n: 0 to 10).

Optional parameters :

  • noInfos : If this parameter is 1, Rentabiliweb won’t return parameters during the redirection on the error page (code, docId, siteId, data) ;
  • data : Thanks to this parameter, you can pass on information to your protected pages or to your error page. Rentabiliweb returns the field data value in GET method in the redirection URL ;
  • record : This parameter will allow you to save values which will be returned to you in the codes reporting.
a) Payment forms

To install a payment form, you just have to make your choice between this two available types. Just click on « Document management » in the left menu of your Rentabiliweb administrator space (in the section « Micropayment/Bank card »).Then, click on the button « Install » of the document you want to install.

 

Rentabiliweb micropayment : document management

Rentabiliweb micropayment : scripts setup

You just need to copy the script of the payment form you choosed, then you paste it in your payment page (the access page that you have configured in your Rentabiliweb document) where this form is needed.

To instal the Facebook form on your website, you just have to replace the <fb:iframe> and </<fb:iframe> tags by the standard <iframe> and </iframe> tags.

Example :

Script of the Facebook form for Facebook applications :

<fb:iframe src="http://payment.rentabiliweb.com/form/acte/form_fb.php?docId=xxxxx&siteId=yyyyyy&cnIso=geoip" frameborder="0" scrolling="auto" width="580" height="400"></fb:iframe>

Script for websites :

<iframe src="http://payment.rentabiliweb.com/form/acte/form_fb.php?docId=xxxxx&siteId=yyyyyy&cnIso=geoip" frameborder="0" scrolling="auto" width="580" height="400"></iframe>
b) Transmitting more data

You can transmit more data to your protected page (or to your error page).
With the popup and iFrame forms, it can be done through a hidden field. This hidden field will have to be named « data », and it will take the value that you will give to it.

The html code of this hidden field :

<input type="hidden" name="data" value="my_value"/>

or else, to pass a php variable :

<input type="hidden" name="data" value="<?php echo $my_var; ?>"/>

This way to process can be used also to pass the record and noInfos parameters.

Html code to pass the noInfos parameter :

<input type="hidden" name="noInfos" value="1"/>

If you do so, this implies that Rentabiliweb will not return any parameter when redirecting on the error page (code, docId, siteId, data).

The popup and iFrame forms can roughly divided in two parts. The one allows to buy a ticket, the other allows the ticket to be submitted. It is possible in this second part to add a tag for a hidden field to pass one of the optionnal parameters.

Example for the popup form and the data parameter (value)

<form id="rweb_tickets_XXXXX"  method="get" action="http://payment.rentabiliweb.com/access.php" style="margin: 0px; padding: 0px;" >
     <table width="280" cellpadding="0" cellspacing="0" style=" margin: 2px auto;">
          <tr>
	       <td style="text-align: center"><label for="code_0" style=" font-family:Arial, Helvetica, sans-serif;font-size: 12px; font-weight:bold; color:#3b5998; padding: 2px 2px 5px 2px; margin: 0px;">
                        Saisissez votre code d'accès et validez :<br/>
			<span style="font-size: 11px; font-style: italic;color:#5c5c5c;">Please enter your access code :</span></label></td>
          </tr>
          <tr>
               <td style="text-align: center">
	            <input name="code[0]" type="text" id="code_0" size="10" style="border: solid 1px #3b5998; padding: 2px; font-weight: bold; color:#3b5998; text-align: center;"/>
	            <input type="hidden" name="docId" value="XXXXX" />
		    <input type="hidden" name="data" value="my_value" />
		    <input type="button"  alt="Ok" onclick="getElementById('rweb_sub_XXXXX').disabled=true;document.getElementById('rweb_tickets_XXXXX').submit();" id="rweb_sub_XXXXX"  style="width: 40px; height:20px; vertical-align:middle; margin-left: 5px; border: none; background:url(http://payment.rentabiliweb.com/data/i/component/button_ok.gif);"/></td>
          </tr>
     </table>
</form>

Example for the iFrame form and the data (php variable)

<form id="rweb_tickets_XXXXX" method="get" action="http://payment.rentabiliweb.com/access.php" style="margin: 0px; padding: 0px;" >
     <table width="400" cellpadding="0" cellspacing="0" style=" margin: 2px auto;">
          <tr>
               <td style="text-align: center"><label for="code_0" style=" font-family:Arial, Helvetica, sans-serif;font-size: 12px; font-weight:bold; color:#3b5998; padding: 2px; margin: 0px;">
               Saisissez votre code d'accès et validez :
	       <br/>
	       <span style="font-size: 11px; font-style: italic;color:#5c5c5c;">Please enter your access code :</span></label></td>
          </tr>
          <tr>
               <td style="text-align: center">
	            <input name="code[0]" type="text" id="code_0" size="10" style="border: solid 1px #3b5998; padding: 2px; font-weight: bold; color:#3b5998; text-align: center;"/>
		    <input type="hidden" name="docId" value="XXXXX" />
		    <input type="hidden" name="data" value="<?php echo $my_var;?>" />
		    <input type="button"  alt="Ok" onclick="getElementById('rweb_sub_XXXXX').disabled=true;document.getElementById('rweb_tickets_XXXXX').submit();" id="rweb_sub_XXXXX"  style="width: 40px; height:20px; vertical-align:middle; margin-left: 5px; border: none; background:url(http://payment.rentabiliweb.com/data/i/component/button_okdefault.gif);"/>
               </td>
          </tr>
     </table>
</form>

For the Facebook form, the way to pass more data is a bit different. You can do this by adding the data parameter to the URL of the form source.

Example for the Facebook form and the data parameter (value)

<iframe src="http://payment.rentabiliweb.com/form/acte/form_fb.php?docId=xxxxx&siteId=yyyyyy&cnIso=geoip&data=my_value" frameborder="0" scrolling="auto" width="580" height="400"></iframe>

Example for the Facebook form and the data parameter (php variable)

<iframe src="http://payment.rentabiliweb.com/form/acte/form_fb.php?docId=xxxxx&siteId=yyyyyy&cnIso=geoip&data=<?php echo $ma_variable; ?>" frameborder="0" scrolling="auto" width="580" height="400"></iframe>

If you want to pass several values with this field, you just have to create an array, to serialize it and to encode it (in base 64 for example). The result could be :

$arr = array($myVar1, $myVar2, $myVarN);
$data = serialize($arr);
$data = base64_encode($data);

This field is passed as GET parameter, so if you want to obtain it in your protected page or in your error page, please write :

$the_field_to_obtain=$_GET['data'];

If you serialized then encoded an array, you will have to write :

$data = base64_decode($_GET['data']);
$arr= unserialize($data);

You can also pass affiliation parameters with the hidden fields method. This is explained below, in 2.2 Configuration and integration of affiliation variables.

c) HTML code

DO NOT MODIFY THE HTLM CODE OTHERWISE ERRORS CAN OCCUR.

To modify the way your payment form looks like, you can use a css file or you can modify the style in the right tags. Not to display a block, you need to add into the css file or the mark style=”display:none;”.

To make the blocks identification easier, you can use the web developer toolbar with firefox, click here : http://chrispederick.com/work/web-developer.

Once settled, push ctrl+shift+F and click on a block to display its class or id.

1.1.2 Code checking

Rentabiliweb provides a script to secure access to your paid area.
You can find this script in the same webpage that the payment form (please refer to a) Payment forms).

This protection script must be imperatively used with our payment form (without modification of the html code), otherwise errors can occur.
If you want to get help or advice about the protection of your site or the personalization of the payment form, please contact our technical team.

Thanks to the PHP or ASP languages, your website will be able to check the user’s code through the Rentabiliweb servers.
Your script will perform an HTTP request.

You can choose the protection script between two types : Php or Javascript.

To install the Php protection script, you just have to copy the Php protection script from the page Micropayment » Document setup, then you paste it in the top of your protected page (the protected page that you have configured in your Rentabiliweb document).

Example

<?php
// Pass and login of your document
$docId = XXXXXX
$siteId = YYYYYY

// PHP5 with register_long_arrays non active ?
if (!isset($HTTP_GET_VARS)) {
$HTTP_SESSION_VARS    = $_SESSION;
$HTTP_SERVER_VARS      = $_SERVER;
$HTTP_GET_VARS           = $_GET;
}

// Construction of the request to check the code
$query      = 'http://payment.rentabiliweb.com/checkcode.php?';
$query     .= 'docId='.$docId;
$query     .= '&siteId='.$siteId;
$query     .= '&code='.$HTTP_GET_VARS['code'];
$query     .= "&REMOTE_ADDR=".$HTTP_SERVER_VARS['REMOTE_ADDR'];
$result     = @file($query);

if(trim($result[0]) !== "OK") {
header('Location: http://www.yoursite.com/yourerrorpage.html');
exit();
}
// Access to your protected page
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
//THE CODE OF YOUR PROTECTED PAGE
...
</html>

URL of the verification script : http://secure.Rentabiliweb.com/checkcode.php

Parameters required for the request :

  • docId : Your document ID ;
  • siteId : Your site ID where the document is configured ;
  • code : This parameter will contain the code entered by the Internet user (in case of multi-codes they will be separated by dashes “-“).

In case of mistake, our script will return: KO

In case of a valid code, Rentabiliweb will send: OK

Moreover, on the second and the third line, Rentabiliweb provides you informations concerning the code origin (country, payment type) in this form :

– $result[1] : is the Iso code of the country (for Dom Tom: DT, for Credit card payment: XX);
– $result[2] : is the payment type used to obtain the code (1: Phone billing, 2: sms, 3: Internet+, 5 : Bank Card, 10 : Neosurf, 13 : OnNET).

To install the Javascript protection script, you just have to copy the Javascript protection script from the page Micropayment » Document setup, then you paste it between the <head> and </head> tags of the html code of the page to protect (the page your customer has to pay to see the content).

Example

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="en">
<meta name="description" content="description of your page " />
<meta name="keywords" content="your keywords" />

<noscript>
<meta http-equiv="Refresh" content="0;URL=URL_CHECKTICKET_JS?docId=xxxxx&siteId=yyyyyy&nojs=1">
</noscript>
<script type="text/javascript" language="Javascript" src="URL_CHECKTICKET_JS?docId=xxxxx&siteId=yyyyyy"></script>
</head>

To secure several pages through the same access you can use a session or cookie system.

1.2 Installation of the bank card payment > 3 EUR (premium and prestige customers)

1.2.1 Payment form

  • purchase button

This button will allow your visitors to buy their subscriber ticket to access your service.
This button opens a popup with the payment systems available.
Variables needed for the proper functioning of the popup :
– docId : Your document ID.
– siteId : The site ID where the document is configured.

Optional parameters:
– data : Thanks to this parameter, you will be able to pass on information to the protected page url and to your callback url (if configured on your document).
Rentabiliweb will send back the field data value in the protected page url and in the callback url (if configured on your document) by GET method.

  • entry form

This form works the same way as the one shot payment form. It accepts the same parameters.

1.2.2 Code checking

The subscriber’s ticket checking is made like the One-shot payment.

1.2.3 Callback url

Rentabiliweb informs you when your client buys a subscriber ticket.
As soon as a purchase is validated, the Rentabiliweb’s server sends a request on your servers to the url indicated in the parameter setting of your document.

Here are parameters send back by this URL :

In case of One-Shot payment :

– docId : document login
– ticket : subscription code issued to the Internet user
– reference : Transaction number
– amount : Amount paid by the internet user
– data : “data” information if in the purchase script there is some subscriber pass

When paying by subscription renewal :

– docId : document login
– duration : Subscription duration
– endDate : subscription end date (form: YYYY-MM-DD HH: MM: SS)
– ticket : subscriber ticket delivered to the internet user
– reference : Transaction number
– amount : Amount paid by the internet user
– rebil : “1” if it is about a renewal, “0”: if it is about a first payment
– data : “data” information if in the purchase script there is some subscriber ticket

The callback URL is executed for each transaction (payment, subscription renewal).

2. AFFILIATION

2.1 Use of partner links

By creating the affiliate program, you have to set up a banner and a promotional link .

Rentabiliweb provide your affiliates, with a subscription link and scripts to promote your services.
The system automatically share gains during the Creditcard payment or the code entry for a One shot payment.

We manage your affiliations technical backoffice (registrations, automatic emails, statistics/earnings) and your affiliates payment.

2.2 Configuration and integration of affiliation variables

You can set parameters your affiliation and affiliated out-payments directly through the payment form.

Affiliation variables have priority on links partners.

Both systems cannot be used at the same time.

Parameters :

  • PRID : id of your affiliation program ;
  • CAFF_n : Affiliate code of the partner who will get the earnings (n for 1 to 4) ;
  • POUR_n : earning percentage pay return to the partner (n from 1 to 4) for the One Shot payment ;
  • POUR_CB_n : earning percentage pay return to the partner (n from 1 to 4) for the bank card payment ;
  • PRGR_n : code of the fixed amount outpayments program which will be use to calculate the affiliates earnings (n from 1 to 4).

Please note that you can only use one of the parameters POUR_n (POUR_CB_n for a Bank Card document) or PRGR_n.

To configure your fixed amount outpayments programs click here.

Integration

They can be integrated in the same way as explained in b) Transmitting more data, which means thanks to hidden fields in the payment form.

Example for the popup form :

<form id="rweb_tickets_XXXXX"  method="get" action="http://payment.rentabiliweb.com/access.php" style="margin: 0px; padding: 0px;" >
     <table width="280" cellpadding="0" cellspacing="0" style=" margin: 2px auto;">
          <tr>
	       <td style="text-align: center"><label for="code_0" style=" font-family:Arial, Helvetica, sans-serif;font-size: 12px; font-weight:bold; color:#3b5998; padding: 2px 2px 5px 2px; margin: 0px;">
                        Saisissez votre code d'accès et validez :<br/>
			<span style="font-size: 11px; font-style: italic;color:#5c5c5c;">Please enter your access code :</span></label></td>
          </tr>
          <tr>
               <td style="text-align: center">
	            <input name="code[0]" type="text" id="code_0" size="10" style="border: solid 1px #3b5998; padding: 2px; font-weight: bold; color:#3b5998; text-align: center;"/>
	            <input type="hidden" name="docId" value="XXXXX" />
		    <input type="hidden" name="PRID" value="<?php echo $the_prid;?>" />
                    <input type="hidden" name="CAFF_1" value="<?php echo $the_affiliate_identifying_number;?>" />
                    <input type="hidden" name="POUR_1" value="<?php echo $this_affiliate_percentage;?>" />
		    <input type="button"  alt="Ok" onclick="getElementById('rweb_sub_XXXXX').disabled=true;document.getElementById('rweb_tickets_XXXXX').submit();" id="rweb_sub_XXXXX"  style="width: 40px; height:20px; vertical-align:middle; margin-left: 5px; border: none; background:url(http://payment.rentabiliweb.com/data/i/component/button_ok.gif);"/></td>
          </tr>
     </table>
</form>

You will enter the percentage as a figure, like 80 for 80%, or 45 for 45%.