... Elxis version 2009.3 codename Aphrodite is out, download it from Elxis Download Center (EDC) ...

IOSR Connector

From Elxis Official Documentation

Revision as of 19:36, 19 September 2011 by Datahell (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search
This page is part of the IOS Reservations v3.x online user guide created by Ioannis Sannos (Is Open Source).

You will find all articles of this manual inside the IOS Reservations category.
Purchase online IOS Reservations     IOS Reservations demo   IOSR Connector demo
License Commercial. Copyright (c) 2008-2011 Is Open Source. All rights reserved.
November 13, 2010: Version 3.5 released.


IOS Reservations Connector allows you to accept bookings from remote sites without having to install IOS Reservations on them. This way you can display hotels and process bookings from other web sites. The system has a client and a server part. The client part is uploaded on the sites where you wish the book request form to be displayed (any number of sites). The server part is uploaded on the central elxis site with IOS Reservations installed. Note that the client part can be used in any site, not just elxis powered ones. The only requirement is to be able to run PHP scripts. IOSR Connector client can be integrated into elxis, wordpress, joomla, mambo, drupal, smf, modX, typo3, and any other content management system, blog, forum, or on any PHP powered site.

Live demo of IOSR Connector

Image:Iosrc_integrate_solutions.jpg


Contents

Install IOSR Connector

IOS Reservations connector installation is extremely easy. On the zip package you have purchased by Is Open Source there is a client and a connector folder. Upload the connector folder inside the directory shown bellow and IOSR Connector installation is complete!

components/com_reservations/includes/

The client folder should be uploaded on the integrated external sites. If the client site is powered by Elxis, Joomla or an other CMS and there is a ready-to-use extension for IOSR Connector you can use that one instead. For instance you can use the corresponding bot for Elxis or the corresponding plugin for Joomla. These extensions are included in IOSR Connector package.


Create IOSR Connector APIs

Each time you wish to accept bookings from a new web site you have to create an API. APIs are unique for each site/hotel pair. Go to IOSR administration and click the IOSR Connector icon on the control panel. From the top right menu click New. On the next page select the hotel to accept reservations from and write down the URL of the site from where you will accept the bookings. The API will be valid for the whole domain, so you don't have to write the exact path of the place where the client will be located at. For maximum security requests from any other site will be dropped. If you wish fill-in the commission fee to any amount. This is an easy way to calculate commission fees for external bookings if you wish to. Note that this commission fee does not have any affect on the reservation total cost. When ready click Apply.

After the API is created you can select an optional payment method by picking one of Bank Deposit and Credit Card (offline). These methods should be enabled in the hotel's edit page. The payment method can be set per API. If you select Credit card offline then the guest will be prompt to enter his credit card details during the booking process via the Connector. If you select Bank Deposit and the reservation surety fee is greater than zero then the guest after the reservation is complete will see the hotel's bank account details in order to pay the surety fee via bank deposit later on.

You can any time stop accepting bookings from an API by setting the Active option to No.

IOSR Connector informs you, for each API separately, about the total requests made to each API, the date time of the last request, the number of reservations made and the date time of the last reservation. So, you have a kind of statistics system to inform you how your external booking goes on.

If your IOSR Connector license is for one hotel then the picked hotel will always be the same. You will be, off course, allowed to create unlimited APIs in order to integrate your hotel to any number of web sites. But you will need an IOSR Connector unlimited license to create APIs for more hotels.


IOSR Connector integration

There are 2 general methods you can integrate IOSR Connector to a web site and many other sub-options.

  • Let IOSR Connector generate a full page layout (even in a pop-up window).
  • Display IOSR Connector internally into the body tag of an existing page.


The integration page

Take the client folder and upload it to any path of the external web side. You can rename that folder to anything you wish. For instance rename it to xhotel. If you uploaded that folder on the site's root www folder then your IOSR Connector client will be accessible from the internet like that:

http://www.site.com/xhotel/integrate_sample.php

The connector's base in the integrate_sample.php PHP file. For better URLs we will rename that file to index.php and we will delete the included index.html file. So, our Connector is now accessible like that:

http://www.site.com/xhotel/

Open the index.php and the iosrc.config.php files with a text editor such as psPad. On index.php write the absolute path to the iosrc.client.php file and the API key you previously generated on IOSR administration for that web site. Here is an example:

<?php 
define('IOSR_CONNECTOR', 1);
require_once('/home/mydomain/public_html/xhotel/iosrc.client.php');
$client = new iosrclient('111111111111111111111111');
$client->process(true);
unset($client);
?>

If you wish to display IOSR Connector internally to an existing web page check the true shown above to false:

<?php 
define('IOSR_CONNECTOR', 1);
require_once('/home/mydomain/public_html/xhotel/iosrc.client.php');
$client = new iosrclient('111111111111111111111111');
$client->process(false);
unset($client);
?>

If you don't know which is the absolute path to the iosrc.client.php file but you know that it is on the same folder as your index.php file you can:

//write this:
require_once(dirname(__FILE__).'/iosrc.client.php');
//instead of this:
require_once('/home/mydomain/public_html/xhotel/iosrc.client.php');


You are not limited in putting the integration page inside the xhotel folder. You can put it anywhere you like. You can also create multiple integration pages if you wish to display multiple hotels by copying the integration_sample.php file.

Here are some examples:

http://www.site.com/super-hotel.php
http://www.site.com/paradise.php
http://www.site.com/bookings/hilton.php


Client configuration

You can feed the IOSR Connector client the configuration options in 2 ways: By using the iosrc.config.php file.

$client = new iosrclient('111111111111111111111111');

By feeding dynamically the client with a configuration array. In this case the contents of the iosrc.config.php file get ignored.

$client = new iosrclient('111111111111111111111111', 0, $config);

The configuration options regardless if they are loaded by the configuration file or feed dynamically, is a PHP array having those keys:

  • CLIENTURL The URL where the client folder is located (for example: http://www.site.com/xhotel/)
  • SRVURL The URL of the site where IOS Reservations is installed (example: http://www.iosres.com)
  • ENCKEY Encyption key to be used to encrypt sensitive data. Take it from IOS Reservations configuration page (tab Interconnectivity).
  • CURRENCY The currency to display prices (the server's default or one of the exchange rates supported! If empty the IOSR server's default will be used)
  • LANG Client interface language. Use an Elxis formatted language name like english, italian, german, greek, etc, or leave it empty for auto-detection.
  • CALENDAR Calendar date format. Options are: d-m-Y and Y-m-d
  • ACTIONURLThe URL that will be used as the form action. If empty it will be used the value of PHP's variable PHP_SELF (by default this is empty).
  • FORMPARAMS If you need to pass extra parameters to the form (POST method) put them in this array. By default this is an empty array.


More on ACTIONURL

ACTIONURL is very useful in some cases. For example when we load IOSR Connector inside a CMS like Elxis that uses a URL rewrite system and we want after the form's submission to stay in the same page and not get redirected to an index.php file (value of PHP_SELF). For instance if we display IOSR Connector in an Elxis autonomous page with URL http://www.elxissite.com/test.html we can set the value of ACTIONURL to the URL of that autonomous page. So after the form submission we will get redirected again at http://www.elxissite.com/test.html and not at http://www.elxissite.com/index.php


More on FORMPARAMS

FORMPARAMS is an array of key-value pairs that will be injected into all client's pages as hidden input text boxes. This is very useful under some cases. Here is an example of a FORMPARAMS array:

$iosrc_config['FORMPARAMS'] = array('Itemid' => 23, 'option' => 'com_content', 'task' => 'view', 'id' => 12);

The above will generate the HTML code bellow:

<input type="hidden" name="Itemid" value="23" />
<input type="hidden" name="option" value="com_content" />
<input type="hidden" name="task" value="view" />
<input type="hidden" name="id" value="12" />


CMS plugins for easy integration

Here is a list of ready-to-use plug-ins to integrate IOSR Connector easily to CMSs:

  • IOSR Connector bot for Elxis CMS (free extension included in IOSR Connector package).
  • IOSR Connector plugin for Joomla CMS v1.5 (free extension included in IOSR Connector package).


By the time you read this page there might be more ready-to-install plug-ins to easily integrate IOSR Connector to a number of CMSs without having to touch the code. If you are a PHP developer you can easily create such plug-in for your favourite content management system.


More help

If you need professional assistant you may contact one of Is Open Source official partners.


IOS Reservations Connector is not included into the standard IOS Reservations package but it is sold separately as an extension to IOS Reservations system under 2 license options:

For a single hotel (you can integrate it into unlimited number of sites).
For unlimited hotels (you can integrate them into unlimited number of sites).

IOSR Connector requires IOS Reservations 3.5 or newer!
Personal tools