Pos Easy Integration Principles
Principles
For those who are looking for a straightforward, loosely couple integration between Adelya and a POS system. We propose an easy mechanism
The principle of this integration is: on Pos side we do not request that you implement the cardreader applet, nor that you identify the consumer first before sending a ticket linked to that consummer.
We propose that after payment you POST a ticket - in XML for now - to one of our dedicated page on a browser. This page will then automaticaly switch to wait_for_card mode, and once the card is tap over the reader, the ticket is integrated by our system on the consumer history. This last action computes the relevant loyalty rewards.
As a simple flowchart is often better than a long web page, below is an illustration of the process
Datas & Url
url: /loyaltyoperator/integration/easyIntegration.jsp
parameters: ticket (in XML see below for an example)
authentification: basic (see home page for an example)
<?xml version="1.0"?>
<AdEvent>
<type>addCA</type>
<fvalue>35.68</fvalue>
<comment>commentaire associé aux données</comment>
<details class="set">
<com.adelya.common.AdEventDetail>
<detailType>I</detailType>
<class1>DB HOLA24 MOIS</class1>
<class2>Nuit</class2>
<class3>1</class3>
<class10>0999992096118</class10>
<unitValue>10.99</unitValue>
<quantity>2</quantity>
<value>10.99</value>
<modifier>-3.3</modifier>
<finalValue>18.68</finalValue>
</com.adelya.common.AdEventDetail>
<com.adelya.common.AdEventDetail>
<detailType>I</detailType>
<class1>Chaussures Sophie22</class1>
<class2>Chaussures</class2>
<class3>1</class3>
<class10>0999991610971</class10>
<unitValue>17.00</unitValue>
<quantity>1</quantity>
<value>17</value>
<finalValue>17.00</finalValue>
</com.adelya.common.AdEventDetail>
<com.adelya.common.AdEventDetail>
<detailType>C</detailType>
<class1>Réduction FID</class1>
<class2>FID</class2>
<class10>CODECHFID</class10>
<unitValue>-10</unitValue>
<quantity>1</quantity>
<value>-10</value>
<finalValue>-10.00</finalValue>
</com.adelya.common.AdEventDetail>
</details>
</AdEvent>
How-to burn rewards
We recommend that you implement a 'View consummer data' button. This button will also pop-up one of adelya's page waiting for consumer identification.
This page will wait for consumer identification (as for the ticketabove), then display a consumer data summary. If a reward is available, it will be clearly visible. Back to the POS entry screen, enter the according discount AND send this discount as a event.details in the ticket XML (with detailType set to 'C'). If the loyalty rules are correctly crafted, this will burn the reward.
Creating a new consumer and giving them a card
In fact here we will use the system standard feature. So just take a never before used card, tap it on the reader. The system will prompt you with a web form to create the new card holder. Just click on save when done.
How do I open a browser from my POS
If your Pos system is written in some web language just Post to a new window like you would post a form. But with authentication (Javascript will help you here see home page)
In Java a good example from stackoverflow here
If your POS system is written in c# it could be done with something like this:
public void PostPage(string url, string ticketAsXML)
{
String postdata = "details=" + ticketAsXML;
System.Text.Encoding a = System.Text.Encoding.UTF8;
byte[] byte1 = a.GetBytes(postdata);
String gotourl = protocol + Program.server + url;
badgeBrowserControl.Navigate(gotourl, "", byte1, "Content-Type: application/x-www-form-urlencoded\r\nAuthorization: Basic XXXXXX\r\n");
}