Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Card system protocol
Requests are sent to the card authorization server via TCP/IP.
The card authorization server connects to the card system application server, so a forced closing of the application server is not allowed, and if required, the card authorization server should be restarted.
The request should be sent in proper format (with due regard to uppercase and lowercase characters).
For CRM 5 based on TCP/IP, all requests are accompanied by a header looking as follows:
Message-ID: 1
Message-Type: Request
Time: 2010-01-26 13:57:23
Terminal-Type: 1 Content-Length: 123, where:
"Message-ID" is the message identifier.
"Message-Type" is the message type (Request).
"Time" stands for the time, when the message was sent, formatted as YYYY-MM-DD HH:NN:SS.
"Terminal-Type" is the type of the terminal, the alphanumeric code of which is maintained in the card system under the menu "Software classifiers" and is configured during the terminal installation. "Content-Length" is the length of the data package, in bytes (from "<?xml" to "</Message>").
A sample request to the card authorization server (an empty line between the header and the XML package is mandatory):
Message-ID: 1

Message-Type: Request

Time: 2010-01-26 13:57:23

Terminal-Type: 123

Content-Length: 210
<?xml version="1.0" encoding="Windows-1251" standalone="yes" ?>
<Message Action="Get card info" Terminal_Type="123" Global_Type="ABC" Unit_ID="1" User_ID="1">
<Card_Code>123456789</Card_Code>
<Include>Holder</Include>
</Message>
"Global_Type" is provided at the time of the key receipt; should be specified for each request.
"Unit_ID" — reserved."User_ID" — reserved.
Sample response:
200 OK
Message-Type: Response
Message-ID: 1
Time: 2010-01-27 17:33:36
Content-Length: 736
<?xml version="1.0" encoding="Windows-1251" standalone="yes" ?>
<Cards>
<Card>
<Status>Active</Status>
<Offered>2008-10-23</Offered>
<Expired>2009-10-23</Expired>
<Group_ID>1</Group_ID>
<Group_Name>Main group</Group_Name>
<Holders>
<Holder>
<Division_ID>1</Division_ID>
<Holder_ID>117</Holder_ID>
<L_Name>IVANOV</L_Name>
<F_Name>IVAN</F_Name>
<M_Name>IVANOVICH</M_Name>
<Full_Name>IVANOV IVAN IVANOVICH</Full_Name>
<Birth>1987-01-04</Birth>
<Gender>Male</Gender>
<Marrital>No</Marrital>
<Language_ID>1049</Language_ID>
<Language_Name>Russian</Language_Name>
</Holder>
</Holders>
</Card>
</Cards>
For CRM 7 based on HTTP, requests are sent without the header described above (XML format into UTF-8).
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<Message Message_ID="63" Action="Get card info" Terminal_Type="123" Unit_ID="1" User_ID="1" Sys_Date_Time="2016-04-20 12:57:48.38 +03:00">
<Card_Code>123456789</Card_Code>
<Include>Holder</Include>
</Message>
"Global_Type" is not required for CRM 7.
"Unit_ID" — reserved."User_ID" — reserved.
Sample response:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Cards Message_ID="63">
<Card>
<Status>Active</Status>
<Offered>2008-10-23</Offered>
<Expired>2009-10-23</Expired>
<Group_ID>1</Group_ID>
<Group_Name>Main group</Group_Name>
<Holders>
<Holder>
<Division_ID>1</Division_ID>
<Holder_ID>117</Holder_ID>
<L_Name>IVANOV</L_Name>
<F_Name>IVAN</F_Name>
<M_Name>IVANOVICH</M_Name>
<Full_Name>IVANOV IVAN IVANOVICH</Full_Name>
<Birth>1987-01-04</Birth>
<Gender>Male</Gender>
<Marrital>No</Marrital>
<Language_ID>1049</Language_ID>
<Language_Name>Russian</Language_Name>
</Holder>
</Holders>
</Card>
</Cards>

...

6.1. Adding holders ("Add holders")
If an "Include" is specified in the request, the response will contain the card holder response structure ("Get holder info").
If there is no "Include" in the request, the response will contain the identifiers of the edited or added elements. For example, when one address is added, its identifier will be obtained at the output (introduced for Internet applications).
Default values for the card and holder groups can be specified in the card authorization server configurator. Moreover, the configurator can contain the specification of accounts, required by the system, which will complement the list of accounts transmitted in the request.
The specification of a unique phone number imposes a restriction on the "Value" parameter in the list of contacts. It should correspond to the recommendations of the standard E.164
({+}http://ru.wikipedia.org/wiki/E.164+Image RemovedImage Added). At this stage, the value should contain one "+" character and 11 to 15 digits.
In CRM 7 based on HTTP, an extension of this request is implemented, intended for work optimization.
When specifying the country, city and street values, names can be used instead of identifiers:

...

7.1. Requesting information on account types ("Get accounts types info")
Request to the card authorization server:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Message Action="Get accounts types info" Terminal_Type="2" Global_Type="ABC"> </Message>
XML response format:
Accounts_Types
Account_Type (account type information)
Status (account type status)
"Active"
"Deleted"
"Blocked"
Account_Type_Class (account type class)
"1" — bonus account
"2" — discount account
"3" — debit account
"4" — credit account
"5" — funds spent
"6" — membership
"99" — user account
Account_Type_ID (account type code)
Account_Type_Name (account type name)
Date_From (valid-from date)
Date_To (valid-to date)
7.2. Requesting information on countries ("Get countries info")
Request to the card authorization server:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Message Action="Get countries info" Terminal_Type="2" Global_Type="ABC"> </Message>
XML response format:
Countries
Country (country information) Country_ID (country code) Country_Name (country name)
7.3. Requesting information on card groups ("Get cards groups info")
Request to the card authorization server:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Message Action="Get cards groups info" Terminal_Type="2" Global_Type="ABC"> </Message>
XML response format:
Groups
Group (group information) Group_ID (group code)
Group_Name (group name)
7.4. Requesting information on holder groups ("Get holders groups info")
Request to the card authorization server:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Message Action="Get holders groups info" Terminal_Type="2" Global_Type="ABC"> </Message>
XML response format:
Groups
Group (group information) Group_ID (group code)
Group_Name (group name)
7.5. Requesting information on contact types ("Get contacts types info")
In order to get a default value, the <Default>Yes</Default> tag should be specified.Request to the card authorization server:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Message Action="Get contacts types info" Terminal_Type="2" Global_Type="ABC">
</Message>
Contacts_Types
Contact_Type (contact type information)
Contact_Type_ID (contact type code)
Contact_Type_Code (contact type external code)
Contact_Type_Name (contact type name)
Contact_Type_EMail (contact check for being an email address)
"Yes"
"No"
Contact_Type_Phone (contact check for being a phone number)
"Yes"
"No"
Is_Unique (phone uniqueness flag; optional attribute)
Contact_Type_Skype (contact check for being a Skype number)
"Yes"
"No"
Contact_Type_Social_Network (contact check for being a social network)
"Yes"
"No"
Contact_Type_Dispatch (permit for dispatch)
"Yes" — allowed
"No" — not allowed
7.6. Requesting information on address types ("Get addresses types info")
In order to get a default value, the <Default>Yes</Default> tag should be specified.Request to the card authorization server:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Message Action="Get addresses types info" Terminal_Type="2" Global_Type="ABC">
</Message>

Addresses_Types
Address_Type (address type information) Address_Type_ID (address type code)
Address_Type_Name (address type name)

7.7. Requesting information on divisions ("Get divisions info")
Request to the card authorization server:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Message Action="Get divisions info" Terminal_Type="2" Global_Type="ABC">
</Message>
Divisions
Division (division information) Division_ID (division code)
Division_Name (division name)
Division_Full_Name (division full name)
Division_Main (main division flag)
"Yes" — main division
"No" — not main division
7.8. Requesting information on cities ("Get cities info")
The "Country_ID" parameter is optional. In order to get a default value, the "Default" parameter should be specified; in this case, the "City_ID" value will be ignored, if it is provided in the request.
Request to the card authorization server:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Message Action="Get cities info" Terminal_Type="2" Global_Type="ABC">
<Country_ID>123</Country_ID>
<Default>Yes</Default>
</Message>
Cities
City (city information)
Country_ID (country code)
City_ID (city code) City_Name (city name)

7.9. Requesting information on streets ("Get streets info")
The "City_ID" parameter is optional. In order to get a default value, the "Default" parameter should be specified; in this case, the "City_ID" value will be ignored, if it is provided in the request.
Request to the card authorization server:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Message Action="Get streets info" Terminal_Type="2" Global_Type="ABC">
<City_ID>123</City_ID>
<Default>Yes</Default>
</Message>
Streets
Street (street information)
City_ID (city code)
Street_ID (street code)
Street_Name (street name)
Post_Code (postal code)
The format is optimized in terms of volume (up to a triple volume reduction). In this implementation, the "City_ID" parameter is mandatory.
Request to the card authorization server:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Message Action="Get streets info" Terminal_Type="2" Global_Type="ABC" Query_Version="2"> <City_ID>123</City_ID>
</Message>
Streets
City_ID (city code)
Street (street information) ID (street code)
Name (street name)
Post_Code (postal code; the attribute is available in case of filling) 7.10. Requesting information on card properties ("Get cards properties info")
Request to the card authorization server:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Message Action="Get cards properties info" Terminal_Type="2" Global_Type="ABC">
</Message>
Properties
Property (property information)
Property_ID (property code)
Property_Code (external property code)
Property_Name (property name)
Values (the list of applicable values)
Value (value information) Value_ID (value code)
Value_Type (value type)
"None" — not specified
"Integer" — an integer number: 1234
"Float" — a real number: 12.34
"String" — a string
"Date" — a date: 2014-12-31
"Time" — time: 12:34:56
"DateTime" — date and time: 2014-12-31T12:34:56
Value_Value (external value)
Value_Name (value name)
7.11. Requesting information on card holder properties ("Get holders properties info")
Request to the card authorization server:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Message Action="Get holders properties info" Terminal_Type="2" Global_Type="ABC"> </Message>
The structure is shown in 7.10.
7.12. Requesting information on metro stations ("Get metro stations info")
The "City_ID" parameter is optional.
Request to the card authorization server:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Message Action="Get metro stations info" Terminal_Type="2" Global_Type="ABC"> <City_ID>123</City_ID>
</Message>
Metro_Stations
Metro_Station (metro station information)
City_ID (city code)
Metro_Station_ID (metro station code)
Metro_Station_Name (metro station name)
7.13. Requesting information on timing schemes ("Get timing schemes info")
Implemented for CRM 7 based on HTTP.
Request to the card authorization server:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Message Action="Get timing schemes info" Terminal_Type="2" Global_Type="ABC">
</Message>
Timing_Schemes
Timing_Scheme (timing scheme information) Timing_Scheme_ID (timing scheme code)
Timing_Scheme_Name (timing scheme name)
Timing_Scheme_Details (the list of time entities)
Timing_Scheme_Detail
Time_ID (time code)
Name (time entity name)
Date_From (period start date and time)
Date_To (period end date and time)
Time_From (restriction start time within a period)
Time_To (restriction end time within a period) Months (restriction mask for months)
"0x0001" — January
"0x0002" — February
"0x0004" — March
"0x0008" — April
"0x0010" — May
"0x0020" — June
"0x0040" — July
"0x0080" — August
"0x0100" — September
"0x0200" — October"0x0400" — November
"0x0800" — December
Week_Days (restriction mask for weekdays)
"0x0001" — Monday
"0x0002" — Tuesday
"0x0004" — Wednesday
"0x0008" — Thursday
"0x0010" — Friday
"0x0020" — Saturday
"0x0040" — Sunday
Week_Numbers (restriction mask for week numbers)
"0x0001" — 1st week of the month
"0x0002" — 2nd week of the month
"0x0004" — 3rd week of the month
"0x0008" — 4th week of the month
"0x0010" — 5th week of the month
"0x0020" — 6th week of the month
Birthday (take the card holder date of birth into consideration) Before (days until the date of birth)
After (days after the date of birth)
7.14. Requesting information on contract types ("Get contracts types info")
Request to the card authorization server:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Message Action="Get contracts types info" Terminal_Type="2">
</Message>
Contracts_Types
Contract_Type (contract type information)
Contract_Type_ID (contract type code)
Contract_Type_Name (contract type name)
Contract_From (contract validity start date)
Contract_To (contract validity end date)
Contract_Notes (comment)

  1. New holder authorization and registration

...