<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>UniversalPaymentSolution's Weblog</title>
	<atom:link href="http://universalpaymentsolution.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://universalpaymentsolution.wordpress.com</link>
	<description>Just another Electronic Payment World weblog</description>
	<lastBuildDate>Thu, 18 Feb 2010 05:24:59 +0000</lastBuildDate>
	<language>id</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='universalpaymentsolution.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>UniversalPaymentSolution's Weblog</title>
		<link>http://universalpaymentsolution.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://universalpaymentsolution.wordpress.com/osd.xml" title="UniversalPaymentSolution&#039;s Weblog" />
	<atom:link rel='hub' href='http://universalpaymentsolution.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Handheld Business Solutions</title>
		<link>http://universalpaymentsolution.wordpress.com/2010/02/18/handheld-business-solutions/</link>
		<comments>http://universalpaymentsolution.wordpress.com/2010/02/18/handheld-business-solutions/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 05:24:59 +0000</pubDate>
		<dc:creator>universalpaymentsolution.wordpress.com</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://universalpaymentsolution.wordpress.com/?p=21</guid>
		<description><![CDATA[Handheld Business Solutions Whether you have a complete specification which must simply be implemented or whether you have only a general idea of what you want, we can work with you to achieve the profitable solution that is right for &#8230; <a href="http://universalpaymentsolution.wordpress.com/2010/02/18/handheld-business-solutions/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=21&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://universalpaymentsolution.files.wordpress.com/2010/02/flick-software-services.jpg"><img class="alignnone size-medium wp-image-22" title="Flick Software Services" src="http://universalpaymentsolution.files.wordpress.com/2010/02/flick-software-services.jpg?w=300&#038;h=265" alt="" width="300" height="265" /></a></p>
<p>Handheld Business Solutions<a href="http://www.flicksoftware.com/services.html"></a></p>
<p>Whether you have a complete specification which must simply be implemented or whether you have only a general idea of what you want, we can work with you to achieve the profitable solution that is right for your company and for your customers.</p>
<p>Our expertise lies in building software that runs on handheld, embedded, and mobile computers and the support software running on a server or other infrastructural computing system.</p>
<p><ins datetime="2010-02-18T20:22:22+00:00"></ins></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/universalpaymentsolution.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/universalpaymentsolution.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/universalpaymentsolution.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/universalpaymentsolution.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/universalpaymentsolution.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/universalpaymentsolution.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/universalpaymentsolution.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/universalpaymentsolution.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/universalpaymentsolution.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/universalpaymentsolution.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/universalpaymentsolution.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/universalpaymentsolution.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/universalpaymentsolution.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/universalpaymentsolution.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=21&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://universalpaymentsolution.wordpress.com/2010/02/18/handheld-business-solutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19d3af9e420cb6b94803283bbc3b57d7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">univ</media:title>
		</media:content>

		<media:content url="http://universalpaymentsolution.files.wordpress.com/2010/02/flick-software-services.jpg?w=300" medium="image">
			<media:title type="html">Flick Software Services</media:title>
		</media:content>
	</item>
		<item>
		<title>Master Key Smartcard</title>
		<link>http://universalpaymentsolution.wordpress.com/2008/02/15/master-key-smartcard/</link>
		<comments>http://universalpaymentsolution.wordpress.com/2008/02/15/master-key-smartcard/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 16:33:13 +0000</pubDate>
		<dc:creator>universalpaymentsolution.wordpress.com</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://universalpaymentsolution.wordpress.com/2008/02/15/master-key-smartcard/</guid>
		<description><![CDATA[Master Key Posted July 9th, 2007 by fajran Master Key adalah sebuah istilah untuk menyebut sebuah kunci kriptografi untuk mengakses smartcard secara aman, baik dari segi otentikasi, integritas data, maupun keamanan data. Master key ini digunakan untuk membuka secure channel &#8230; <a href="http://universalpaymentsolution.wordpress.com/2008/02/15/master-key-smartcard/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=19&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1 class="title">Master Key</h1>
<div class="meta">
<div class="submitted">Posted July 9th, 2007 by <a href="http://smartcard.ui.edu/?q=user/fajran" title="View user profile.">fajran</a></div>
</div>
<div class="content">Master Key adalah sebuah istilah untuk menyebut sebuah kunci kriptografi untuk mengakses smartcard secara aman, baik dari segi otentikasi, integritas data, maupun keamanan data. Master key ini digunakan untuk membuka secure channel untuk komunikasi dengan applet pada smartcard.</p>
<p>Ada tiga buah master key pada kartu, yaitu Key Enc, Key Mac, dan Key Dek, dimana setiap kunci memiliki kegunaannya masing-masing.</p>
<ul>
<li><b>Key Enc</b> digunakan untuk membuat card cryptogram dan host cryptogram pada saat membuka secure channel dengan kartu.</li>
<li><b>Key Mac</b> digunakan untuk membuat Message Authentication Code (MAC) ketika data yang dilewatkan perlu ditambahkan sebuah MAC untuk menjamin integritas data.</li>
<li><b>Key Dek</b> digunakan untuk melakukan enkripsi/dekripsi data yang lewat.</li>
</ul>
<p>Agar kunci pada setiap kartu yang ada dapat dibuat berbeda, maka ada sebuah teknik penurunan kunci yang dapat digunakan. Ketiga kunci tersebut diturunkan dari sebuah master key yang sama untuk setiap kartu. Namun penurunan kunci melibatkan data unik dari setiap kartu yang ada, yaitu Key Diversification Data (yang tersusun dari Personalization Master Key ID (KMCid) dan Chip Serial Number). Proses penurunan kunci akan dibahas pada tulisan yang lain.</p></div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/universalpaymentsolution.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/universalpaymentsolution.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/universalpaymentsolution.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/universalpaymentsolution.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/universalpaymentsolution.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/universalpaymentsolution.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/universalpaymentsolution.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/universalpaymentsolution.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/universalpaymentsolution.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/universalpaymentsolution.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/universalpaymentsolution.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/universalpaymentsolution.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/universalpaymentsolution.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/universalpaymentsolution.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/universalpaymentsolution.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/universalpaymentsolution.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=19&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://universalpaymentsolution.wordpress.com/2008/02/15/master-key-smartcard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19d3af9e420cb6b94803283bbc3b57d7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">univ</media:title>
		</media:content>
	</item>
		<item>
		<title>Overview SmartCard</title>
		<link>http://universalpaymentsolution.wordpress.com/2007/11/28/overview-smartcard/</link>
		<comments>http://universalpaymentsolution.wordpress.com/2007/11/28/overview-smartcard/#comments</comments>
		<pubDate>Wed, 28 Nov 2007 07:07:03 +0000</pubDate>
		<dc:creator>universalpaymentsolution.wordpress.com</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://universalpaymentsolution.wordpress.com/2007/11/28/overview-smartcard/</guid>
		<description><![CDATA[About Smart Cards Smart card functions Smart card standards and platforms The advent of the cashless society Smart card standards and platforms Alternatives to smart cards The shifting sands of technology Fundamentals of card operation Contact, contactless and combi interfaces &#8230; <a href="http://universalpaymentsolution.wordpress.com/2007/11/28/overview-smartcard/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=18&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>About Smart Cards</h1>
<p><a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#scf">Smart card functions</a><br />
<a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#scs">Smart card standards and platforms</a><br />
<a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#tao">The advent of the cashless society</a><br />
<a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#scs">Smart card standards and platforms</a><br />
<a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#ats">Alternatives to smart cards</a><br />
<a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#tss">The shifting sands of technology</a><br />
<a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#foc">Fundamentals of card operation</a><br />
<a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#cca">Contact, contactless and combi interfaces</a><br />
<a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#tco">The challenge of interoperability</a><br />
<a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#atc">Authenticating the cardholder</a></p>
<p><strong>Introduction</strong></p>
<p>Although originally conceived in the 1970s, smart cards &#8211; as with many technologies &#8211; suffer from the use of terminology that is often imprecise and confusing. Our definitions used in the contents of this Internet site are set out in this introduction.</p>
<p>A <strong>smart card</strong> is a standard credit card-sized plastic token within which a microchip has been embedded. This chip is the engine room of the smart card, and indeed is what makes it &#8216;smart&#8217;. Smart card chips come in two broad varieties: <strong>memory-only chips</strong>, with storage space for data, and with a reasonable level of built-in security; and microprocessor chips which, in addition to memory, embody a processor controlled by a card <strong>operating system</strong>, with the ability to process data onboard, as well as carrying small programs capable of local execution. The main storage area in such cards is normally <strong>EEPROM</strong> (Electrically Erasable Programmable Read-Only Memory), which &#8211; subject to defined security constraints &#8211; can have its content updated, and which retains current contents when external power is removed. Newer smart card chips may also have <strong>maths co-processors</strong> integrated into the microprocessor chip, able to perform quite complex encryption routines relatively quickly.</p>
<p>A smart card is therefore characterised uniquely by its chip, with its ability to store much more data (currently up to about 32,000 bytes) than is held on a magnetic stripe, all within an extremely secure environment. These <strong>security features</strong> built into smart card chips are amongst the most sophisticated of their type available in the commercial world. Data residing in the chip can be protected against external inspection or alteration, so effectively that the vital secret keys of the <strong>cryptographic systems</strong> used to protect the integrity and privacy of card-related communications can be held safely against all but the most sophisticated forms of attack. The ingenuity of the cryptographers further supplements the physical security of the chip, ensuring that penetrating one card&#8217;s security does not compromise an entire card scheme.</p>
<p>It is because of these security and data storage features that smart cards are rapidly being embraced as the consumer token of choice in many areas of the public sector and commercial worlds. The Internet, in particular, is focussing the need for online identification and authentication between parties who cannot otherwise know or trust each other, and smart cards &#8211; coupled with effective <strong>cardholder verification techniques</strong> &#8211; are believed to be the most efficient and portable way of enabling the new world of e-trade. <strong>Interoperability</strong> (see below) is the key requirement to facilitate universal consumer acceptability: the ability of a card function developed by one organisation to be used without difficulty in schemes owned and operated by many organisations. So it is that the current world population of smart cards of some 1.7 billion is set to increase to 4 billion or more cards within the next 3-4 years.</p>
<p>[ <a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#TOP">Top</a> ]</p>
<p><strong><a name="scf"></a>Smart card functions</strong></p>
<p>Smart cards are being deployed in most sectors of the public and private marketplaces. Single-function cards are being used for payphone telephony, digital mobile telephony (these &#8216;cards&#8217; do not in one aspect conform to the basic definition of a smart card, i.e. credit card-sized), the credit and debit functions of financial institutions, retail loyalty schemes, corporate staff systems, subscription TV operations, mass transit ticketing schemes and many more. With the advent of <strong>multi-application cards</strong> capable of carrying data relating to several functions, more complex schemes are being developed, particularly by cities for their citizens and by central Governments for their residents. In most of these schemes, simple data structures are held and updated within cards, normally comprising personal information about the cardholder and his or her accounting relationship with the card and application issuer, together with transactional data relating to the particular function. Central processing systems often mirror this data, having collected it through a polling mechanism from the terminals that accept the particular cards and enable them to participate in the related transactions.</p>
<p>Most smart card schemes utilise one or more generic functions, this being one of several advantages offered by smart technology. Another advantage of smart cards is that these functions are frequently associated with offline operations, i.e. functions performed without immediate access to the central system. The generic functions of cards include general transaction-based storage, storage of <strong>kernel personal data</strong> and account reference information, and &#8211; increasingly &#8211; the storage of monetary value (<strong>electronic purse</strong>) able to be loaded and spent repeatedly during the life of the card.</p>
<p>If, by contrast, a completely online scheme (where the user terminal can always make immediate contact with the central processing system) is implemented, the use of smart cards within such a scheme is threatened, because the data storage ability of the card might become redundant if recourse may always be made to the same data held centrally. Such permanently online schemes may be commercially viable within a single organisation, but consumer- and citizen-oriented scheme owners are increasingly recognising the benefits of issuing to the user a powerful, multi-function smart card.</p>
<p>The current proliferation of consumer plastic, giving rise to serious <strong>purse and wallet bulge</strong>, is focussing card issuers on the challenge of providing multi-application platforms within smart cards, able to carry functions relating not only to the card issuer&#8217;s business, but also carrying functions issued by <strong>third party application providers</strong> who may wish to rent space within such cards. This requirement has given rise to the need for suitable platforms able to carry segmented data sets in a discrete way to ensure that one application provider&#8217;s data cannot be compromised by a third party. Accordingly, a number of multi-application platform products have been developed, not only by the more traditional smart card suppliers but, more unusually, by card scheme operators with an interest in issuing cards and then defraying costs by renting space within them. Such multi-application platforms allow the addition and deletion of application data areas in-flight, without the need for replacing cards. This ability in turn leads to <strong>major branding, ownership and control issues</strong>, many of which have yet to be addressed and resolved.</p>
<p>[ <a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#TOP">Top</a> ]</p>
<p><strong><a name="scs"></a>Smart card standards and platforms</strong></p>
<p>A number of international standards bodies have concerned themselves with developing basic standards governing the physical and logical attributes of smart cards. Most of these, however, have lagged far behind the realities of technical progress, and have not addressed application level and interoperability issues sufficiently to allow the development of software to proceed with confidence. This has left space for international card players to develop products according to specifications which they severally wish to have recognised as <em>de facto</em> standards. Particular market sectors, which have developed such specifications, include GSM (Global System for Mobile communications) and the main credit institutions in the EMV (Europay, MasterCard, Visa) consortium. Several countries with strong central Governments are also establishing effective standards for national schemes, although Great Britain has largely stood back and allowed the fragmented development of proprietary systems to proliferate. The effect of such fragmentation will be to impose major barriers to the interoperability of cards across national and scheme boundaries (see below). In the longer term, major players with global reach &#8211; such as Microsoft &#8211; are likely to deploy cards and software in an effort to saturate the international market with a particular topography or architecture. Other possible routes to the acceptance of common standards are via a private sector consortium (Global Platform), and via the e-Europe public sector Initiative.</p>
<p>[ <a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#TOP">Top</a> ]</p>
<p><strong><a name="tao"></a>The advent of the cashless society</strong></p>
<p>In the modern world, the widespread use of cash in the form of notes and coins is increasingly being seen to hamper the effective deployment of new forms of trading. These transaction processes, as with face to face transactions, require immediate and anonymous payments. In the long-term evolution from cowry shells and tally sticks to paper and metal coinage and beyond, it is abundantly clear that the <strong>electronic storage and transfer of money value</strong> is an imperative, particularly where low-value payments require to be made internationally over telecommunications networks.</p>
<p>The virtual elimination of cash tokens is therefore a holy grail of national Governments, of Internet merchants and of financial institutions with a real interest in controlling and profiting from that 80% of high street expenditure currently made with notes and coins. Such electronic money can take many forms, and has been endowed with a wide and misleading vocabulary including stored value and e-purse. This has led to the development by a number of financial institutions of smart card-based products performing stored value functions, ranging from simple throw-away, burn-off cards such as payphone cards, to reloadable e-purse cards designed for low-value payments in a variety of outlets and even remotely over networks.</p>
<p>To date, single-function, generic <strong>e-purse cards</strong>, issued by financial institutions in various projects in a number of countries, have resulted in technical success but commercial failure in terms of usage rate. The consumer imperative and retailer benefits necessary for success have been almost completely lacking. The only truly successful examples of stored value, apart from payphone cards, have been mass transit tokens based on <strong>contactless</strong>technology (see below), which have provided real convenience to consumers in cities such as Hong Kong. The race for purse is, however, just beginning, and new players are emerging to challenge the more traditional financial institutions as purse providers. The value of the <strong>pre-paid float</strong> is attractive to telcos, transport operators and retailers, and the banks are now fighting to support legislation with the aim of preventing upstarts from engaging in open purse activity. A product to watch is Sony&#8217;s Edy: an accounted purse in a contactless card &#8211; already gaining ground in Hong Kong, where it has been introduced by the Octopus mass transit card scheme (and, as a pre-requisite, the Octopus management company had to obtain a limited banking licence).</p>
<p>Even within the banking community, incompatible and competing purse architectures proliferate, with anonymous and non-accounted products such as Mondex (owned by MasterCard) up against fully accounted systems in the Visa camp. European initiatives, where purse schemes proliferate, are being consolidated under the <strong>Common Electronic Purse Specification</strong> (CEPS). To date, the 80+ million purse cards in Europe are still only used on average once every six weeks &#8211; a reflection on the current commercial failings of such initiatives.</p>
<p>[ <a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#TOP">Top</a> ]</p>
<p><strong><a name="ats"></a>Alternatives to smart cards</strong></p>
<p>Smart card chips are the essential operational components of smart cards, and these also appear in cladding other than credit card-sized plastic tokens. SIMs (Subscriber Identity Modules, initially implemented with simple, single application smart card chips) in a smaller physical format are already incorporated in all GSM handsets, and new developments incorporate smart chips within a variety of other devices such as PDAs and wrist watches.</p>
<p>There are also commercial developments seeking to place e-purse and other similar facilities within software environments in PCs and servers, obviating the need for the deployment of smart cards. It remains to be seen which of these software initiatives will flourish, particularly as it is difficult to ensure their security.</p>
<p>[ <a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#TOP">Top</a> ]</p>
<p><strong><a name="tss"></a>The shifting sands of technology<br />
</strong><br />
We live in a world of fast-moving technical change. This is perhaps particularly relevant and challenging when related to smart cards, where hundreds of thousands of card-reading terminals need to be available, and tens of millions of smart cards need to be deployed, all with a potential life of several years. Forwards compatibility, and cross border and cross scheme interoperability is increasingly difficult to maintain against the background of rapid chip technology development. EEPROM may give way to faster and longer-lived Flash memory. Voltages for powering smart cards are reducing almost annually. Security technologies demand ever-faster processing power. This environment makes it extremely difficult for the confident development, acquisition and deployment of smart cards which, to support any reasonable business case, must be seen as long-term tokens.</p>
<p>[ <a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#TOP">Top</a> ]</p>
<p><strong><a name="foc"></a>Fundamentals of card operation<br />
</strong><br />
Today&#8217;s smart cards need electrical power from outside, plus a way for data to be transmitted to, and read from, the chip (and in a few cases during use of the card, data is only read out, and nothing is transmitted to the chip). The cards need a timing signal (the clock) to synchronise data transmission (so that the data transmitter and receiver run at the same speed), and many microprocessor-based cards also use that timing signal to drive the microprocessor. Also, many cards (particularly <strong>contact cards</strong> &#8211; see below) have a reset line (just like the Reset button on a PC: only to be used under certain controlled circumstances if trouble is to be avoided).</p>
<p>[ <a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#TOP">Top</a> ]</p>
<p><strong><a name="cca"></a>Contact, contactless and combi interfaces</strong></p>
<p>Perhaps unfortunately, but as a result of the historical development path of this technology, there are two types of electrical interface between smart cards and their associated card readers, as follows:</p>
<p>Traditionally, for use at the retail point of sale or in the banking environment, or as the GSM SIM card in the mobile &#8216;phone, the card has a set of gold- plated electrical contacts embedded in the surface of the plastic on one side. This <strong>contact card technology</strong> is operated by inserting the card (in the correct orientation) into a slot in a card reader, which has electrical contacts that connect to the contacts on the card face.</p>
<p>For use in a mass transit environment, or wherever the cardholder is in motion at the moment of the transaction, radio frequency technology is used to transmit power from the reader to the card, and data is similarly transmitted over an air-gap of up to 10cms. This <strong>contactless card technology</strong> utilises an aerial coil laminated into the card, and allows communication even whilst the card is retained within a wallet or handbag. The same activation method applies to watches, pendants, baggage tags and buttons. No electrical contacts, and therefore &#8220;contactless&#8221;.</p>
<p>Furthermore, in more recent developments, there are now cards with both a contact and a contactless interface (<strong>dual-interface</strong> or <strong>combi-cards</strong>). These may incorporate two non-communicating chips &#8211; one for each interface &#8211; but preferably have a single, dual-interface chip providing the many advantages of a single e-purse, single operating architecture, etc.</p>
<p>Contactless and combi-card architectures have many advantages, but it will be several years before the main and traditional contact card-based schemes start to migrate to these technologies.</p>
<p>[ <a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#TOP">Top</a> ]</p>
<p><strong><a name="tco"></a>The challenge of interoperability</strong></p>
<p>In practice, and perhaps unfortunately for the card scheme owners and managers, different cards are usually not interchangeable. Memory cards usually have different interface characteristics from microprocessor cards: different data formats and/or electrical signals across the interface between card and terminal. Even amongst cards that appear similar, interchangeability is rare. The UK EMV bank debit/credit card scheme demands interchangeability from its various suppliers &#8211; and gets it at the level at which the cards are used by the cardholder &#8211; but this is a rare example of an attempt at interoperability. It is still uncertain whether this will extend to international emanations of EMV.</p>
<p>The challenge is to provide the different mixes of applications that various types of cardholder will want, while at the same time satisfying scheme and application owners. At the moment in the western hemisphere, bankers will not accept the use of a contactless interface for cash withdrawal and debit/credit payment functions. Public transport will not accept contact cards for reliability reasons, and thus the card designers have allied high data transmission speed, for high volume and cost-effective cards, only with a contactless interface. Public transport thus gets only a low security electronic purse (e-purse), suitable for closed schemes (schemes where most of the spending is directly related to the major business of the scheme owners).</p>
<p>[ <a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#TOP">Top</a> ]</p>
<p><strong><a name="atc"></a>Authenticating the cardholder</strong></p>
<p>Whilst properly designed smart cards cannot in practice be counterfeited, little progress has been made to ensure that it is the accredited cardholder who is using the genuine card. This problem is particularly acute in the e-world, where consumers are transacting business at terminals without operators able to conduct adequate verification routines.</p>
<p>The most common method used for cardholder verification at present is to give the cardholder a PIN (<strong>Personal Identification Number</strong>) which he or she has to remember: the cardholder has to type in the PIN at each request for signing a message, or perhaps only once per session (e.g. when the card is inserted in the card reader). PINs, however, have several disadvantages, including the risk of being stolen or abused. The only truly effective method of <strong>Cardholder Verification</strong> is the measurement of a physiological characteristic unique to an individual and incapable of fraudulent replication or abuse. Such <strong>biometrics</strong> include Iris and Retinal scans, Face or Hand geometry, and of course DNA, but the most likely and most acceptable attribute is the fingerprint. In production systems using fingerprint recognition, the fingerprint sensor is in the terminal, but the fingerprint profile data may be either in the terminal side of the card-to-terminal interface, or preferably held within the card itself (a fingerprint profile takes up only a few hundred bytes of data space). Prototype cards where the fingerprint sensor is on the card surface are now in development and may one day be a commercial proposition. In the meantime, a number of major national schemes around the world are incorporating fingerprint biometrics using optical or proximity readers associated with keyboards, mice and point-of-sale terminals.</p>
<p>[ <a href="http://universalpaymentsolution.wordpress.com/index.php?About_Smart_Cards#TOP">Top</a> ]</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/universalpaymentsolution.wordpress.com/18/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/universalpaymentsolution.wordpress.com/18/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/universalpaymentsolution.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/universalpaymentsolution.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/universalpaymentsolution.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/universalpaymentsolution.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/universalpaymentsolution.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/universalpaymentsolution.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/universalpaymentsolution.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/universalpaymentsolution.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/universalpaymentsolution.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/universalpaymentsolution.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/universalpaymentsolution.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/universalpaymentsolution.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/universalpaymentsolution.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/universalpaymentsolution.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=18&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://universalpaymentsolution.wordpress.com/2007/11/28/overview-smartcard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19d3af9e420cb6b94803283bbc3b57d7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">univ</media:title>
		</media:content>
	</item>
		<item>
		<title>Handling Acquirer-side Reversals</title>
		<link>http://universalpaymentsolution.wordpress.com/2007/11/20/handling-acquirer-side-reversals/</link>
		<comments>http://universalpaymentsolution.wordpress.com/2007/11/20/handling-acquirer-side-reversals/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 08:19:01 +0000</pubDate>
		<dc:creator>universalpaymentsolution.wordpress.com</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://universalpaymentsolution.wordpress.com/2007/11/20/handling-acquirer-side-reversals/</guid>
		<description><![CDATA[Handling Acquirer-side Reversals in a Payment Switch This is a write-up I did about the various reversal scenarios you can encounter on the acquiring side of a payment switch implementation.  I&#8217;ve gone through and genericized this piece a bit for &#8230; <a href="http://universalpaymentsolution.wordpress.com/2007/11/20/handling-acquirer-side-reversals/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=17&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3 class="entry-header">Handling Acquirer-side Reversals in a Payment Switch</h3>
<p class="entry-content">
<p class="entry-body">This is a write-up I did about the various reversal scenarios you can encounter on the acquiring side of a payment switch implementation.  I&#8217;ve gone through and genericized this piece a bit for distribution.  Please feel free contact me wtih any specific implementation queries.  [Note that these four Reversal scenario desingations aren't the result of any industry-specific lingo.  It's a nomenclature I invented to try to get these categorizations straight in my head and adopt a shared language with my clients and co-workers.  You may find it handy as well.]</p>
<p>Anyway, here&#8217;s the write-up (imagine your application in the middle taking transactions from a store-based POS device population and fowarding to a debit and/or credit gateway provider):</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p style="margin-bottom:6pt;line-height:150%;text-align:justify;" class="MsoBodyText"><span style="font-family:Arial;">There are four different reversal scenarios in play on any transaction acquiring environment. Each must be considered and accounted for separately. If you visualize a transaction path as starting with a customer on left, your payment switch in the middle, and the authorizing endpoint on the right, then you can think of the following “reversal points” as being presented to the reader from right to left: </span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Symbol;">·<span style="font:7pt 'Times New Roman';"> </span></span><strong><span style="font-family:Arial;">Reversal Scenario Class “R”: Remote endpoint time-out</span></strong></p>
<p style="line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Arial;">In this scenario, the payment switch:</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">a)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Sends original transaction request to the endpoint.</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">b)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Does not receive response back from the authorizer prior to the pre-determined timeout period.</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">c)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Formats and sends a ‘timeout reversal’ to the endpoint (note that some credit card-only application models do not require use of reversals of credit card-initiated transactions; consult with your authorization provider and their specs).</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">d)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Sets the internal error code on the original transaction to “Application Route Timeout” and puts it into the tran log.</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">e)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Formats and sends a terminal response to the store system with appropriate non-zero response code value and corresponding display message.</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Symbol;">·<span style="font:7pt 'Times New Roman';"> </span></span><strong><span style="font-family:Arial;">Reversal Scenario Class “C”: Store System – Payment Engine Communication Rupture</span></strong></p>
<p style="line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Arial;">In this scenario, the payment switch:</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">a)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Sends original transaction request to the endpoint.</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">b)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Receives a response back from the authorizer prior to the pre-determined timeout period.</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">c)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Sets internal error code on the original transaction to the appropriate value and puts it into the tran log.</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">d)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Formats and sends a terminal response to the store system with appropriate response code value and corresponding display message.</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">e)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">At this point in the scenario, the payment switch determines it is unable to send a reply back to the Store System origination point. The following steps should then take place:</span></p>
<p style="line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">If Internal Result Code for the original transaction is EQUAL to TRAN_APPROVED (i.e., a zero error code), then the payment switch:</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.75in;" class="MsoBodyText"><span style="font-family:Arial;">1)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Formats the reversal transaction that corresponds to the original.</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:12pt 0 6pt 0.75in;" class="MsoBodyText"><span style="font-family:Arial;">2)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Formats and sends a reversal to the endpoint (note that some credit card-only application models do not require use of reversals of credit card-initiated transactions; consult with your authorization provider and their specs).</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.75in;" class="MsoBodyText"><span style="font-family:Arial;">3)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Sets the internal error code on the xxxx1 reversal transaction to TRAN_APPROVED and puts it into the tran log.</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.75in;" class="MsoBodyText"><span style="font-family:Arial;">4)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Updates the original transaction in the tran_log by marking it as reversed.</span></p>
<p style="line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">If the payment switch internal result code for the original transaction is NOT EQUAL to TRAN_APPROVED, then no further action is required. </span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Symbol;">·<span style="font:7pt 'Times New Roman';"> </span></span><strong><span style="font-family:Arial;">Reversal Scenario Class “T”: Timeout reversal spawned by Store System</span></strong></p>
<p style="line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Arial;">Timeout reversals are overtly generated by the point-of-sale device (or the “store system”) when the origination point does not receive a reply within a pre-specified timeout period. For the reversal process to work end-to-end, each of the authorizing endpoints specifies “match-up criteria” that allow it to locate the original on its logs. </span></p>
<p style="line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Arial;">Upon receipt of a Timeout Reversal transaction, the payment switch will execute a transaction of reversal scenario class “T.” The application must check its transaction logs to locate the corresponding original transaction. If the following conditions are true…</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:'Courier New';">o<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Original transaction is located </span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:'Courier New';">o<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Internal Result Code = TRAN_APPROVED</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:'Courier New';">o<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Original transaction was not already reversed</span></p>
<p style="line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Arial;">…then the payment switch will execute the following sequence of steps:</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">a)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Formats and sends a reversal to the endpoint (note that some credit card-only application models do not require use of reversals of credit card-initiated transactions; consult with your authorization provider and their specs).</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">b)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Sets the internal error code on the reversal transaction to TRAN_APPROVED and puts it into the tran log.</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">c)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Formats and sends a terminal response to the store system with an approval response code value and corresponding display message. [<strong>NOTE</strong>: If a Reversal Class “C” scenario is encountered at this point, do not attempt to “reverse the reversal.”]</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">d)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Updates the original transaction in the tran_log by marking it as reversed.</span></p>
<p style="line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Arial;">If the original item cannot be located on the logs, the payment switch:</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">a)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Sets the internal error code on the reversal transaction to “Original Not Found” and puts it into the tran log.</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">b)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Formats and sends a terminal response to the store system with an approval response code value and corresponding display message. [<strong>NOTE</strong>: If a Reversal Class “C” scenario is encountered at this point, do not attempt to “reverse the reversal.”]</span></p>
<p style="line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Arial;">If the original item is located, but the Internal Result Code &lt;&gt; TRAN_APPROVED, the payment switch:</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">a)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Sets the internal error code on the reversal transaction to “Original Rejected” and puts it into the tran log.</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">b)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Formats and sends a terminal response to the store system with an approval response code value and corresponding display message. [<strong>NOTE</strong>: If a Reversal Class “C” scenario is encountered at this point, do not attempt to “reverse the reversal.”]</span></p>
<p style="line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Arial;">If the original item is located, but was already reversed, the payment switch:</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">a)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Sets the internal error code on the reversal transaction to “Original Already Reversed” and puts it into the tran log.</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">b)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Formats and sends a terminal response to the store system with an approval response code value and corresponding display message. [<strong>NOTE</strong>: If a Reversal Class “C” scenario is encountered at this point, do not attempt to “reverse the reversal.”]</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Symbol;">·<span style="font:7pt 'Times New Roman';"> </span></span><strong><span style="font-family:Arial;">Reversal Scenario Class “V”: In-store personnel generates Void of previous transaction</span></strong></p>
<p style="line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Arial;">The Void is typically performed very close time-wise to its corresponding original, so for all intents and purposes it is a reversal, albeit a human-generated one. </span></p>
<p style="line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Arial;">To initiate the execution of a transaction of reversal scenario class “V,” the payment switch must check its transaction logs to locate the corresponding original transaction. If the following conditions are true…</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:'Courier New';">o<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Original transaction is located </span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:'Courier New';">o<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Internal Result Code = TRAN_APPROVED</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:'Courier New';">o<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Original transaction was not already reversed</span></p>
<p style="line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Arial;">…then the payment switch will execute the following sequence of steps:</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">a)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Formats and sends a void-based reversal to the endpoint (note that some credit card-only application models do not require use of reversals of credit card-initiated transactions; consult with your authorization provider and their specs).</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">b)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Sets the internal error code on the reversal transaction to TRAN_APPROVED and puts it into the tran log </span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">c)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Formats and sends a terminal response to the store system with an approval response code value and corresponding display message. [<strong>NOTE</strong>: If a Reversal Class “C” scenario is encountered at this point, do not attempt to “reverse the reversal.”]</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">d)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Updates the original transaction in the tran_log by marking it as reversed.</span></p>
<p style="line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Arial;">If the original item cannot be located on the logs, the payment switch:</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">a)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Sets the internal error code on the reversal transaction “Original Not Found” and puts it into the tran log.</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">b)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Formats and sends a terminal response to the store system with an approval response code value and corresponding display message. [<strong>NOTE</strong>: If a Reversal Class “C” scenario is encountered at this point, do not attempt to “reverse the reversal.”]</span></p>
<p style="line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Arial;">If the original item is located, but the Internal Result Code &lt;&gt; TRAN_APPROVED, the payment switch:</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">a)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Sets the internal error code on the reversal transaction “Original Rejected” and puts it into the tran log.</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">b)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Formats and sends a terminal response to the store system with an approval response code value and corresponding display message. [<strong>NOTE</strong>: If a Reversal Class “C” scenario is encountered at this point, do not attempt to “reverse the reversal.”]</span></p>
<p style="line-height:150%;text-align:justify;margin:0 0 6pt 0.25in;" class="MsoBodyText"><span style="font-family:Arial;">If the original item is located, but was already reversed, the payment switch:</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">a)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Sets the internal error code on the reversal transaction “Original Already Reversed” and puts it into the tran log.</span></p>
<p style="text-indent:-0.25in;line-height:150%;text-align:justify;margin:0 0 6pt 0.5in;" class="MsoBodyText"><span style="font-family:Arial;">b)<span style="font:7pt 'Times New Roman';"> </span></span><span style="font-family:Arial;">Formats and sends a terminal response to the store system with an approval response code value and corresponding display message. [<strong>NOTE</strong>: If a Reversal Class “C” scenario is encountered at this point, do not attempt to “reverse the reversal.”]</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/universalpaymentsolution.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/universalpaymentsolution.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/universalpaymentsolution.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/universalpaymentsolution.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/universalpaymentsolution.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/universalpaymentsolution.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/universalpaymentsolution.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/universalpaymentsolution.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/universalpaymentsolution.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/universalpaymentsolution.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/universalpaymentsolution.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/universalpaymentsolution.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/universalpaymentsolution.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/universalpaymentsolution.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/universalpaymentsolution.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/universalpaymentsolution.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=17&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://universalpaymentsolution.wordpress.com/2007/11/20/handling-acquirer-side-reversals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19d3af9e420cb6b94803283bbc3b57d7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">univ</media:title>
		</media:content>
	</item>
		<item>
		<title>Implementing Thales 8000</title>
		<link>http://universalpaymentsolution.wordpress.com/2007/11/20/implementing-thales-8000/</link>
		<comments>http://universalpaymentsolution.wordpress.com/2007/11/20/implementing-thales-8000/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 04:11:28 +0000</pubDate>
		<dc:creator>universalpaymentsolution.wordpress.com</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://universalpaymentsolution.wordpress.com/2007/11/20/implementing-thales-8000/</guid>
		<description><![CDATA[Wednesday, May 02, 2007 Implementing a Thales HSM 8000 Adapter &#8211; PIN Translation In my blog, I have a lot of posts about the Thales HSM 8000 and how we implemented an adapter for it in OLS.Switch, our jPOS-based payment &#8230; <a href="http://universalpaymentsolution.wordpress.com/2007/11/20/implementing-thales-8000/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=16&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2 class="date-header">Wednesday, May 02, 2007</h2>
<p class="entry">
<h3 class="entry-header">Implementing a Thales HSM 8000 Adapter &#8211; PIN Translation</h3>
<p class="entry-content">
<p class="entry-body"><span style="font-size:10pt;font-family:'Arial';">In my blog, I have a lot of posts about the Thales HSM 8000 and how we implemented an adapter for it in OLS.Switch, our <a href="http://jpos.org/"><strong><font color="#ff9966">jPOS<img src="http://i.ixnp.com/images/v3.3.1/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.3.1/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></font></strong></a>-based payment system.  In two recent posts, I discussed <a href="http://andyorrock.typepad.com/paymentsystems/2006/08/implementing_th.html"><strong><font color="#ff9966">how to use jPOS&#8217; FSDMsg facility to implement the Thales command set<img src="http://i.ixnp.com/images/v3.3.1/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.3.1/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></font></strong></a>, and a suggestion on how to start your integration efforts &#8211; <a href="http://andyorrock.typepad.com/paymentsystems/2007/04/implementing_a_.html"><strong><font color="#ff9966">by implementing the Thales Diagnostic<img src="http://i.ixnp.com/images/v3.3.1/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.3.1/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></font></strong></a> command (the &#8216;NC/ND&#8217;) as Step One.  I also have a post breaking down the command (&#8216;CI/CJ&#8217;), the one that does &#8220;<a href="http://andyorrock.typepad.com/paymentsystems/2006/04/doing_pin_trans.html"><strong><font color="#ff9966">Single DES BDK to Interchange Key Translation<img src="http://i.ixnp.com/images/v3.3.1/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.3.1/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></font></strong></a>.&#8221;  [Make sure you read through the comments on that post, too.]  </span></p>
<p><span style="font-size:10pt;font-family:'Arial';">Recently, we were asked to augment our PIN Translation capabilities in order to support a population of PIN Pads that generate PIN blocks using either Single and Triple DES BDKs.  I mentioned briefly in other posts that there&#8217;s a separate command to do &#8220;Triple DES BDK to Interchange Key Translation&#8221; &#8211; the G0/G1.  In this particular situation, the devices could only support double-length keys (Triple-length keys are an option when working with Triple DES BDKs), so our keys configuration file was going to have all double-length BDKs.  We couldn&#8217;t use cryptogram length to signal what&#8217;s what to our program, so we needed some type of indicator.  So, we came up with the idea of these &#8217;1des&#8217; and &#8217;3des&#8217; tags in the file to act as identifiers, like this (where &#8217;129908&#8242; and &#8217;184402&#8242; are examples of KSIs &#8211; the first six positions of the KSN in this particular implementation&#8230;read that Single DES BDK&#8230;&#8221; post referenced above for more details):<br />
</span></p>
<p><span style="font-size:9pt;font-family:'Courier New';">bdk.129908=1des:99BF6A880305B37775AE1E129676E421<br />
bdk.184402=1des:80B7F397139F99A01266394CA96384D9</span></p>
<p><span style="font-size:10pt;font-family:'Arial';"></span><span style="font-size:10pt;font-family:'Arial';">Then, we have our translatePinblk code in our adapter.  We modified it to handle both key types and generate &#8216;CI&#8217; or &#8216;G0&#8242; commands (for Single or Triple DES BDK Translation respectively).  Behind the scenes, what makes this code work is the jPOS FSDMsg facility.  We&#8217;ve got the &#8216;CI&#8217; and &#8216;G0&#8242; structures defined, and that bolded line there fills in the key value (the &#8216;command&#8217; field).  You can see that the &#8216;G0&#8242; has one extra field in its message format:</p>
<p><span style="font-size:9pt;font-family:'Courier New';">    public FSDMsg translatePinblk (<br />
        String bdk, String zpk, String ksnDescriptor,<br />
        String ksn, String pinblk, String accountNumber)<br />
    {<br />
        boolean threeDesBdk = false;<br />
        if (bdk.startsWith (&#8220;3des:&#8221;)) {<br />
            threeDesBdk = true;<br />
            bdk = bdk.substring(5);<br />
        } else if (bdk.startsWith (&#8220;1des:&#8221;)) {<br />
            bdk = bdk.substring(5);<br />
        }<br />
<strong>        FSDMsg r = createRequest (threeDesBdk ? &#8220;G0&#8243; : &#8220;CI&#8221;);</strong><br />
        r.set (&#8220;bdk-type&#8221;, &#8220;U&#8221;);<br />
        r.set (&#8220;bdk&#8221;, bdk);<br />
        r.set (&#8220;zpk-type&#8221;, &#8220;U&#8221;);<br />
        r.set (&#8220;zpk&#8221;, zpk);<br />
        r.set (&#8220;ksn-descriptor&#8221;, ksnDescriptor);<br />
        r.set (&#8220;ksn&#8221;, ksn);<br />
        r.set (&#8220;pinblk&#8221;, pinblk);<br />
        r.set (&#8220;destination-pinblk-format&#8221;, &#8220;01&#8243;);  // ANSI<br />
        r.set (&#8220;account-number&#8221;, accountNumber);<br />
        if (threeDesBdk)<br />
            r.set (&#8220;source-pinblk-format&#8221;, &#8220;01&#8243;); </p>
<p>        return command (r);<br />
    }</span></p>
<p>Now, here are some resulting traces ; I turned on tracing to the test HSM, so you can see all six legs (not presented in order, but you&#8217;ll get the idea):</p>
<ul>
<li>Request from the device</li>
<li>Request to the Thales (The Single DES example is first, followed by the Triple DES example).</li>
<li>Response from the Thales</li>
<li>Request to the Debit/EBT Gateway (the Translated PIN block goes into Field 52 on the outgoing message &#8211; the &#8216;FFFFFF&#8217; in the middle is a mask applied for tracing purposes only).</li>
<li>Response from the Debit/EBT Gateway</li>
<li>Response to the device</li>
</ul>
<p><span style="font-size:10pt;font-family:'Arial';"></span><span style="font-size:10pt;font-family:'Arial';"><span style="font-size:9pt;font-family:'Courier New';"></span><span style="font-size:9pt;font-family:'Courier New';">&lt;log realm=&#8221;org.jpos.security.thales.ThalesAdapter&#8221; at=&#8221;Tue Apr 24 16:09:45 EDT 2007.378&#8243;&gt;<br />
  &lt;trace&gt;<br />
    &lt;fsdmsg schema=&#8217;file:cfg/hsm-base&#8217;&gt;<br />
<strong>      command: &#8216;CI&#8217;</strong><br />
      bdk: &#8217;3A796910699174AEEF512C5A489AB008&#8242;<br />
      zpk-type: &#8216;U&#8217;<br />
      zpk: &#8216;C6087BAD7B9827F553DDF858709E7030&#8242;<br />
      ksn-descriptor: &#8217;605&#8242;<br />
      ksn: &#8217;0407030000200016&#8242;<br />
      pinblk: &#8217;32D23493EC13C57F&#8217;<br />
      destination-pinblk-format: &#8217;01&#8242;<br />
      account-number: &#8217;777999999901&#8242;<br />
    &lt;/fsdmsg&gt;<br />
     request: &#8216;CI3A796910699174AEEF512C5A489AB008UC6087BAD7B9827F553DDF<br />
               858709E7030605040703000020001632D23493EC13C57F01777999999901&#8242;<br />
    response: &#8216;CJ0004D354D87634C043FE01&#8242;<br />
     elapsed: 156ms<br />
    &lt;fsdmsg schema=&#8217;file:cfg/hsm-resp-base&#8217;&gt;<br />
      response: &#8216;CJ&#8217;<br />
      error: &#8217;00&#8242;<br />
      pin-length: &#8217;04&#8242;<br />
      pinblk: &#8216;D354D87634C043FE&#8217;<br />
    &lt;/fsdmsg&gt;<br />
  &lt;/trace&gt;<br />
&lt;/log&gt;<br />
&lt;log realm=&#8221;Debug&#8221; at=&#8221;Tue Apr 24 16:09:45 EDT 2007.909&#8243;&gt;<br />
  &lt;commit&gt;<br />
    &lt;id&gt;9&lt;/id&gt;<br />
    &lt;context&gt;<br />
     &lt;transient&gt;<br />
      &lt;entry key=&#8221;PROFILER&#8221;&gt;<br />
       &lt;profiler&gt;<br />
         open [0/0]<br />
         parse-request [0/0]<br />
         create-debit-tranlog [15/15]<br />
         populate-debit-tranlog [16/31]<br />
         validate-terminal [16/47]<br />
         find-duplicate [15/62]<br />
         translate-pin [172/234]<br />
         create-fdr-request [16/250]<br />
         query-host-or-reverse [453/703]<br />
         prepare-debit-response [0/703]<br />
         close [62/765]<br />
         send-response [0/765]<br />
         end [765/765]<br />
       &lt;/profiler&gt;<br />
      &lt;/entry&gt;<br />
      &lt;entry key=&#8221;DB&#8221;&gt;org.jpos.ee.DB@e47e9b&lt;/entry&gt;<br />
      &lt;entry key=&#8221;REQUEST&#8221;&gt;<br />
       &lt;fsdmsg schema=&#8217;file:cfg/v2-base&#8217;&gt;<br />
         header: &#8217;94538660&#8242;<br />
         record-format: &#8216;G&#8217;<br />
         application-type: &#8217;0&#8242;<br />
         field-sep-1: &#8216;.&#8217;<br />
         acquirer-bin: &#8217;628702&#8242;<br />
         message-version: &#8217;02&#8242;<br />
         shift-number: &#8217;00006&#8242;<br />
         merchant-number: &#8217;0010&#8242;<br />
         store-number: &#8217;01856&#8242;<br />
         terminal-number: &#8217;0001&#8242;<br />
         category-code: &#8217;4444&#8242;<br />
         country-code: &#8217;987&#8242;<br />
         city-code: &#8217;97208&#8242;<br />
         timezone-differential: &#8217;010&#8242;<br />
         transaction-code: &#8217;93&#8242;<br />
         terminal-serial-number: &#8217;12345678&#8242;<br />
         encryption-indicator: &#8217;3&#8242;<br />
         transaction-sequence-number: &#8217;2480&#8242;<br />
         card-id-source: &#8216;A&#8217;<br />
         account-entry-mode: &#8216;D&#8217;<br />
         magnetic-strip-info: &#8217;401777______9011=_________________&#8217;<br />
         cid-device-attached: &#8216;X&#8217;<br />
         pin-action-code: &#8216;F&#8217;<br />
         pin-function-code: &#8217;0&#8242;<br />
         pin-length: &#8217;00&#8242;<br />
         pin-block: &#8217;00&#8242;<br />
         encrypted-pin-block: &#8217;32D234______C57F&#8217;<br />
         pin-dukpt-ksn: &#8217;040703______0016&#8242;<br />
         amount: &#8217;322&#8242;<br />
         additional-amount: &#8217;0&#8242;<br />
         register-number: &#8217;04&#8242;<br />
         tran-id: &#8217;0000276&#8242;<br />
         tender-attempt-indicator: &#8217;1&#8242;<br />
         tender-number: &#8217;0001&#8242;<br />
         tender-attempt: &#8217;0203&#8242;<br />
       &lt;/fsdmsg&gt;<br />
      &lt;/entry&gt;<br />
      &lt;entry key=&#8221;switch-key&#8221;&gt;G.93&lt;/entry&gt;<br />
      &lt;entry<br />
       key=&#8221;TRANLOG&#8221;&gt;org.jpos.ee.DebitTranLog@1b98775[id=1987442]&lt;/entry&gt;<br />
      &lt;entry key=&#8221;AUDIT&#8221;&gt;true&lt;/entry&gt;<br />
      &lt;entry key=&#8221;MERCHANT&#8221;&gt;org.jpos.ee.Merchant@46e3f0[id=0010]&lt;/entry&gt;<br />
      &lt;entry key=&#8221;TERMINAL&#8221;&gt;org.jpos.ee.Terminal@1b8be78[id=1]&lt;/entry&gt;<br />
      &lt;entry key=&#8221;STORE&#8221;&gt;org.jpos.ee.Store@72ca69[id=01856]&lt;/entry&gt;<br />
      &lt;entry key=&#8221;RESPONSE&#8221;&gt;<br />
       &lt;fsdmsg schema=&#8217;file:cfg/v2-debit-resp-base&#8217;&gt;<br />
         header: &#8217;94538660&#8242;<br />
         record-format: &#8217;0&#8242;<br />
         terminal-serial-number: &#8217;12345678&#8242;<br />
         encryption-indicator: &#8217;3&#8242;<br />
         transaction-sequence-number: &#8217;2480&#8242;<br />
         magnetic-strip-info: &#8217;401777______9011=_________________&#8217;<br />
         register-number: &#8217;04&#8242;<br />
         tran-id: &#8217;0000276&#8242;<br />
         tender-attempt-indicator: &#8217;1&#8242;<br />
         tender-number: &#8217;0001&#8242;<br />
         tender-attempt: &#8217;0203&#8242;<br />
         response-code: &#8216;AA&#8217;<br />
         display-message: &#8216;APPROVAL&#8217;<br />
         approval-number: &#8217;210220&#8242;<br />
         date: &#8217;042407&#8242;<br />
         capture-date: &#8217;042407&#8242;<br />
       &lt;/fsdmsg&gt;<br />
      &lt;/entry&gt;<br />
     &lt;/transient&gt;<br />
     &lt;persistent&gt;<br />
      &lt;entry key=&#8221;TIMESTAMP&#8221;&gt;Tue Apr 24 16:09:45 EDT 2007&lt;/entry&gt;<br />
      &lt;entry key=&#8221;OUTSTANDING&#8221;&gt;0&lt;/entry&gt;<br />
      &lt;entry key=&#8221;TRANLOG_ID&#8221;&gt;1987442&lt;/entry&gt;<br />
      &lt;entry key=&#8221;CAPTURE_DATE&#8221;&gt;Tue Apr 24 00:00:00 EDT 2007&lt;/entry&gt;<br />
      &lt;entry key=&#8221;ISO_REQUEST&#8221;&gt;<br />
       &lt;isomsg direction=&#8221;outgoing&#8221;&gt;<br />
         &lt;field id=&#8221;0&#8243; value=&#8221;0200&#8243;/&gt;<br />
         &lt;field id=&#8221;3&#8243; value=&#8221;009000&#8243;/&gt;<br />
         &lt;field id=&#8221;4&#8243; value=&#8221;322&#8243;/&gt;<br />
         &lt;field id=&#8221;7&#8243; value=&#8221;0424200945&#8243;/&gt;<br />
         &lt;field id=&#8221;11&#8243; value=&#8221;003716&#8243;/&gt;<br />
         &lt;field id=&#8221;12&#8243; value=&#8221;160945&#8243;/&gt;<br />
         &lt;field id=&#8221;13&#8243; value=&#8221;0424&#8243;/&gt;<br />
         &lt;field id=&#8221;18&#8243; value=&#8221;5912&#8243;/&gt;<br />
         &lt;field id=&#8221;22&#8243; value=&#8221;901&#8243;/&gt;<br />
         &lt;field id=&#8221;24&#8243; value=&#8221;001&#8243;/&gt;<br />
         &lt;field id=&#8221;25&#8243; value=&#8221;00&#8243;/&gt;<br />
         &lt;field id=&#8221;35&#8243; value=&#8221;401777______9011=_________________&#8221;/&gt;<br />
         &lt;field id=&#8221;37&#8243; value=&#8221;711401856480&#8243;/&gt;<br />
         &lt;field id=&#8221;41&#8243; value=&#8221;00389999&#8243;/&gt;<br />
         &lt;field id=&#8221;42&#8243; value=&#8221;000452002888888&#8243;/&gt;<br />
         &lt;field id=&#8221;49&#8243; value=&#8221;840&#8243;/&gt;<br />
         &lt;field id=&#8221;52&#8243; value=&#8221;D354D8FFFFFF43FE&#8221; type=&#8221;binary&#8221;/&gt;<br />
       &lt;/isomsg&gt;<br />
      &lt;/entry&gt;<br />
      &lt;entry key=&#8221;ISO_RESPONSE&#8221;&gt;<br />
       &lt;isomsg direction=&#8221;incoming&#8221;&gt;<br />
         &lt;field id=&#8221;0&#8243; value=&#8221;0210&#8243;/&gt;<br />
         &lt;field id=&#8221;3&#8243; value=&#8221;009000&#8243;/&gt;<br />
         &lt;field id=&#8221;4&#8243; value=&#8221;000000000322&#8243;/&gt;<br />
         &lt;field id=&#8221;7&#8243; value=&#8221;0424200945&#8243;/&gt;<br />
         &lt;field id=&#8221;11&#8243; value=&#8221;003716&#8243;/&gt;<br />
         &lt;field id=&#8221;12&#8243; value=&#8221;160945&#8243;/&gt;<br />
         &lt;field id=&#8221;13&#8243; value=&#8221;0424&#8243;/&gt;<br />
         &lt;field id=&#8221;24&#8243; value=&#8221;001&#8243;/&gt;<br />
         &lt;field id=&#8221;25&#8243; value=&#8221;00&#8243;/&gt;<br />
         &lt;field id=&#8221;37&#8243; value=&#8221;711401856480&#8243;/&gt;<br />
         &lt;field id=&#8221;38&#8243; value=&#8221;210220&#8243;/&gt;<br />
         &lt;field id=&#8221;39&#8243; value=&#8221;00&#8243;/&gt;<br />
         &lt;field id=&#8221;41&#8243; value=&#8221;<span style="font-size:10pt;font-family:'Arial';"><span style="font-size:10pt;font-family:'Arial';"><span style="font-size:10pt;font-family:'Courier New';">00389999</span></span></span>&#8220;/&gt;<br />
         &lt;field id=&#8221;63&#8243; value=&#8221;415050524F56414C2020202020202020&#8243; type=&#8221;binary&#8221;/&gt;<br />
       &lt;/isomsg&gt;<br />
      &lt;/entry&gt;<br />
      &lt;entry key=&#8221;RC&#8221;&gt;0000&lt;/entry&gt;<br />
     &lt;/persistent&gt;<br />
    &lt;/context&gt;<br />
  &lt;/commit&gt;<br />
&lt;/log&gt;</p>
<p>&lt;log realm=&#8221;org.jpos.security.thales.ThalesAdapter&#8221; at=&#8221;Wed Apr 25 09:49:55 EDT 2007.56&#8243;&gt;<br />
  &lt;trace&gt;<br />
    &lt;fsdmsg schema=&#8217;file:cfg/hsm-base&#8217;&gt;<br />
<strong>      command: &#8216;G0&#8242;</strong><br />
      bdk: &#8216;D76FCCC0AB5F4A74875B39B9ADE6E900&#8242;<br />
      zpk-type: &#8216;U&#8217;<br />
      zpk: &#8216;B381A477B49A67C9581DFC81E9CA404C&#8217;<br />
      ksn-descriptor: &#8217;605&#8242;<br />
      ksn: &#8217;3D07040000000003&#8242;<br />
      pinblk: &#8217;661C4571C8A88998&#8242;<br />
      destination-pinblk-format: &#8217;01&#8242;<br />
      account-number: &#8217;765111111111&#8242;<br />
      source-pinblk-format: &#8217;01&#8242;<br />
    &lt;/fsdmsg&gt;<br />
     request: &#8216;G0D76FCCC0AB5F4A74875B39B9ADE6E900UB381A477B49A67C9581DFC81E9<br />
               CA404C6053D07040000000003661C4571C8A889980101765111111111&#8242;<br />
    response: &#8216;G1000449FDE47BE6B24C1F01&#8242;<br />
     elapsed: 94ms<br />
    &lt;fsdmsg schema=&#8217;file:cfg/hsm-resp-base&#8217;&gt;<br />
      response: &#8216;G1&#8242;<br />
      error: &#8217;00&#8242;<br />
      pin-length: &#8217;04&#8242;<br />
      pinblk: &#8217;49FDE47BE6B24C1F&#8217;<br />
    &lt;/fsdmsg&gt;<br />
  &lt;/trace&gt;<br />
&lt;/log&gt;<br />
&lt;log realm=&#8221;Debug&#8221; at=&#8221;Wed Apr 25 09:49:55 EDT 2007.369&#8243;&gt;<br />
  &lt;commit&gt;<br />
    &lt;id&gt;12&lt;/id&gt;<br />
    &lt;context&gt;<br />
     &lt;transient&gt;<br />
      &lt;entry key=&#8221;PROFILER&#8221;&gt;<br />
       &lt;profiler&gt;<br />
         open [0/0]<br />
         parse-request [0/0]<br />
         create-debit-tranlog [16/16]<br />
         populate-debit-tranlog [15/31]<br />
         validate-terminal [16/47]<br />
         find-duplicate [15/62]<br />
         translate-pin [94/156]<br />
         create-fdr-request [16/172]<br />
         query-host-or-reverse [281/453]<br />
         prepare-debit-response [0/453]<br />
         close [16/469]<br />
         send-response [0/469]<br />
         end [469/469]<br />
       &lt;/profiler&gt;<br />
      &lt;/entry&gt;<br />
      &lt;entry key=&#8221;DB&#8221;&gt;org.jpos.ee.DB@10457b4&lt;/entry&gt;<br />
      &lt;entry key=&#8221;REQUEST&#8221;&gt;<br />
       &lt;fsdmsg schema=&#8217;file:cfg/v2-base&#8217;&gt;<br />
         header: &#8217;3F0FD3C0&#8242;<br />
         record-format: &#8216;G&#8217;<br />
         application-type: &#8217;0&#8242;<br />
         field-sep-1: &#8216;.&#8217;<br />
         acquirer-bin: &#8217;628702&#8242;<br />
         message-version: &#8217;02&#8242;<br />
         shift-number: &#8217;00006&#8242;<br />
         merchant-number: &#8217;0010&#8242;<br />
         store-number: &#8217;01856&#8242;<br />
         terminal-number: &#8217;0001&#8242;<br />
         category-code: &#8217;4444&#8242;<br />
         country-code: &#8217;987&#8242;<br />
         city-code: &#8217;97208&#8242;<br />
         timezone-differential: &#8217;010&#8242;<br />
         transaction-code: &#8217;93&#8242;<br />
         terminal-serial-number: &#8217;12345678&#8242;<br />
         encryption-indicator: &#8217;3&#8242;<br />
         transaction-sequence-number: &#8217;2500&#8242;<br />
         card-id-source: &#8216;A&#8217;<br />
         account-entry-mode: &#8216;D&#8217;<br />
         magnetic-strip-info: &#8217;421765______1119=____________________&#8217;<br />
         cid-device-attached: &#8216;X&#8217;<br />
         pin-action-code: &#8216;F&#8217;<br />
         pin-function-code: &#8217;0&#8242;<br />
         pin-length: &#8217;00&#8242;<br />
         pin-block: &#8217;00&#8242;<br />
         encrypted-pin-block: &#8217;661C45______8998&#8242;<br />
         pin-dukpt-ksn: &#8217;3D0704______0003&#8242;<br />
         amount: &#8217;2500&#8242;<br />
         additional-amount: &#8217;2000&#8242;<br />
         register-number: &#8217;04&#8242;<br />
         tran-id: &#8217;0000300&#8242;<br />
         tender-attempt-indicator: &#8217;1&#8242;<br />
         tender-number: &#8217;0003&#8242;<br />
         tender-attempt: &#8217;0203&#8242;<br />
         magnetic-strip-info-encrypted: &#8216;kOGgk2__________________IsD+&#8217;<br />
       &lt;/fsdmsg&gt;<br />
      &lt;/entry&gt;<br />
      &lt;entry key=&#8221;switch-key&#8221;&gt;G.93&lt;/entry&gt;<br />
      &lt;entry   <br />
       key=&#8221;TRANLOG&#8221;&gt;org.jpos.ee.DebitTranLog@1fc68f[id=1987462]&lt;/entry&gt;<br />
      &lt;entry key=&#8221;AUDIT&#8221;&gt;true&lt;/entry&gt;<br />
      &lt;entry key=&#8221;MERCHANT&#8221;&gt;org.jpos.ee.Merchant@1cd36a5[id=0010]&lt;/entry&gt;<br />
      &lt;entry key=&#8221;TERMINAL&#8221;&gt;org.jpos.ee.Terminal@1c914c3[id=1]&lt;/entry&gt;<br />
      &lt;entry key=&#8221;STORE&#8221;&gt;org.jpos.ee.Store@2e0ecb[id=01856]&lt;/entry&gt;<br />
      &lt;entry key=&#8221;RESPONSE&#8221;&gt;<br />
       &lt;fsdmsg schema=&#8217;file:cfg/v2-debit-resp-base&#8217;&gt;<br />
         header: &#8217;3F0FD3C0&#8242;<br />
         record-format: &#8217;0&#8242;<br />
         terminal-serial-number: &#8217;12345678&#8242;<br />
         encryption-indicator: &#8217;3&#8242;<br />
         transaction-sequence-number: &#8217;2500&#8242;<br />
         magnetic-strip-info: &#8217;421765______1119=____________________&#8217;<br />
         register-number: &#8217;04&#8242;<br />
         tran-id: &#8217;0000300&#8242;<br />
         tender-attempt-indicator: &#8217;1&#8242;<br />
         tender-number: &#8217;0003&#8242;<br />
         tender-attempt: &#8217;0203&#8242;<br />
         response-code: &#8216;AA&#8217;<br />
         display-message: &#8216;APPROVAL&#8217;<br />
         approval-number: &#8217;312521&#8242;<br />
         date: &#8217;042507&#8242;<br />
         capture-date: &#8217;042507&#8242;<br />
       &lt;/fsdmsg&gt;<br />
      &lt;/entry&gt;<br />
     &lt;/transient&gt;<br />
     &lt;persistent&gt;<br />
      &lt;entry key=&#8221;TIMESTAMP&#8221;&gt;Wed Apr 25 09:49:54 EDT 2007&lt;/entry&gt;<br />
      &lt;entry key=&#8221;OUTSTANDING&#8221;&gt;0&lt;/entry&gt;<br />
      &lt;entry key=&#8221;TRANLOG_ID&#8221;&gt;1987462&lt;/entry&gt;<br />
      &lt;entry key=&#8221;CAPTURE_DATE&#8221;&gt;Wed Apr 25 00:00:00 EDT 2007&lt;/entry&gt;<br />
      &lt;entry key=&#8221;ISO_REQUEST&#8221;&gt;<br />
       &lt;isomsg direction=&#8221;outgoing&#8221;&gt;<br />
         &lt;field id=&#8221;0&#8243; value=&#8221;0200&#8243;/&gt;<br />
         &lt;field id=&#8221;3&#8243; value=&#8221;099000&#8243;/&gt;<br />
         &lt;field id=&#8221;4&#8243; value=&#8221;2500&#8243;/&gt;<br />
         &lt;field id=&#8221;7&#8243; value=&#8221;0425134954&#8243;/&gt;<br />
         &lt;field id=&#8221;11&#8243; value=&#8221;003730&#8243;/&gt;<br />
         &lt;field id=&#8221;12&#8243; value=&#8221;094954&#8243;/&gt;<br />
         &lt;field id=&#8221;13&#8243; value=&#8221;0425&#8243;/&gt;<br />
         &lt;field id=&#8221;18&#8243; value=&#8221;5912&#8243;/&gt;<br />
         &lt;field id=&#8221;22&#8243; value=&#8221;901&#8243;/&gt;<br />
         &lt;field id=&#8221;24&#8243; value=&#8221;001&#8243;/&gt;<br />
         &lt;field id=&#8221;25&#8243; value=&#8221;00&#8243;/&gt;<br />
         &lt;field id=&#8221;35&#8243; value=&#8221;421765______1119=____________________&#8221;/&gt;<br />
         &lt;field id=&#8221;37&#8243; value=&#8221;711501856500&#8243;/&gt;<br />
         &lt;field id=&#8221;41&#8243; value=&#8221;<span style="font-size:10pt;font-family:'Arial';"><span style="font-size:10pt;font-family:'Arial';"><span style="font-size:10pt;font-family:'Courier New';">00389999</span></span></span>&#8220;/&gt;<br />
         &lt;field id=&#8221;42&#8243; value=&#8221;000452002888888&#8243;/&gt;<br />
         &lt;field id=&#8221;49&#8243; value=&#8221;840&#8243;/&gt;<br />
         &lt;field id=&#8221;52&#8243; value=&#8221;49FDE4FFFFFF4C1F&#8221; type=&#8221;binary&#8221;/&gt;<br />
         &lt;field id=&#8221;54&#8243; value=&#8221;2000&#8243;/&gt;<br />
       &lt;/isomsg&gt;<br />
      &lt;/entry&gt;<br />
      &lt;entry key=&#8221;ISO_RESPONSE&#8221;&gt;<br />
       &lt;isomsg direction=&#8221;incoming&#8221;&gt;<br />
         &lt;field id=&#8221;0&#8243; value=&#8221;0210&#8243;/&gt;<br />
         &lt;field id=&#8221;3&#8243; value=&#8221;099000&#8243;/&gt;<br />
         &lt;field id=&#8221;4&#8243; value=&#8221;000000002500&#8243;/&gt;<br />
         &lt;field id=&#8221;7&#8243; value=&#8221;0425135031&#8243;/&gt;<br />
         &lt;field id=&#8221;11&#8243; value=&#8221;003730&#8243;/&gt;<br />
         &lt;field id=&#8221;12&#8243; value=&#8221;094954&#8243;/&gt;<br />
         &lt;field id=&#8221;13&#8243; value=&#8221;0425&#8243;/&gt;<br />
         &lt;field id=&#8221;24&#8243; value=&#8221;001&#8243;/&gt;<br />
         &lt;field id=&#8221;25&#8243; value=&#8221;00&#8243;/&gt;<br />
         &lt;field id=&#8221;37&#8243; value=&#8221;711501856500&#8243;/&gt;<br />
         &lt;field id=&#8221;38&#8243; value=&#8221;312521&#8243;/&gt;<br />
         &lt;field id=&#8221;39&#8243; value=&#8221;00&#8243;/&gt;<br />
         &lt;field id=&#8221;41&#8243; value=&#8221;<span style="font-size:10pt;font-family:'Arial';"><span style="font-size:10pt;font-family:'Arial';"><span style="font-size:10pt;font-family:'Courier New';">00389999</span></span></span>&#8220;/&gt;<br />
         &lt;field id=&#8221;63&#8243; value=&#8221;415050524F56414C2020202020202020&#8243; type=&#8221;binary&#8221;/&gt;<br />
       &lt;/isomsg&gt;<br />
      &lt;/entry&gt;<br />
      &lt;entry key=&#8221;RC&#8221;&gt;0000&lt;/entry&gt;<br />
     &lt;/persistent&gt;<br />
    &lt;/context&gt;<br />
  &lt;/commit&gt;<br />
&lt;/log&gt;</p>
<p></span></span></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/universalpaymentsolution.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/universalpaymentsolution.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/universalpaymentsolution.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/universalpaymentsolution.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/universalpaymentsolution.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/universalpaymentsolution.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/universalpaymentsolution.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/universalpaymentsolution.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/universalpaymentsolution.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/universalpaymentsolution.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/universalpaymentsolution.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/universalpaymentsolution.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/universalpaymentsolution.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/universalpaymentsolution.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/universalpaymentsolution.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/universalpaymentsolution.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=16&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://universalpaymentsolution.wordpress.com/2007/11/20/implementing-thales-8000/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19d3af9e420cb6b94803283bbc3b57d7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">univ</media:title>
		</media:content>

		<media:content url="http://i.ixnp.com/images/v3.3.1/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.3.1/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.3.1/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.3.1/t.gif" medium="image" />
	</item>
		<item>
		<title>Dynamic Key Exchange Models</title>
		<link>http://universalpaymentsolution.wordpress.com/2007/11/20/dynamic-key-exchange-models/</link>
		<comments>http://universalpaymentsolution.wordpress.com/2007/11/20/dynamic-key-exchange-models/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 02:58:59 +0000</pubDate>
		<dc:creator>universalpaymentsolution.wordpress.com</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://universalpaymentsolution.wordpress.com/2007/11/20/dynamic-key-exchange-models/</guid>
		<description><![CDATA[Dynamic Key Exchange Models I&#8217;ve had a number of people ask me recently about how to implement Dynamic Key Exchange models within jPOS.   Specifically, I&#8217;m talking here about ISO8583-based financial payment gateways.  This post pertains to situations where you&#8217;re acting &#8230; <a href="http://universalpaymentsolution.wordpress.com/2007/11/20/dynamic-key-exchange-models/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=15&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3 class="entry-header">Dynamic Key Exchange Models</h3>
<p class="entry-content">
<p class="entry-body">I&#8217;ve had a number of people ask me recently about how to implement Dynamic Key Exchange models within <a href="http://jpos.org/"><strong><font color="#ff9966">jPOS<img src="http://i.ixnp.com/images/v3.3.1/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.3.1/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></font></strong></a>.   Specifically, I&#8217;m talking here about ISO8583-based financial payment gateways.  This post pertains to situations where you&#8217;re acting either as the Card Issuer (in which case you&#8217;re receiving payment transaction requests from the gateway) or the transaction acquirer (in which case you&#8217;re sending payment transaction requests to the gateway in order that they route it for appropriate authorization decisioning).</p>
<p>There&#8217;s some terminology to square away first:</p>
<p><strong>Local Master Key (&#8216;LMK&#8217;)</strong> &#8211; This is the key you store in the HSM in order to encrypt and do software-based storage of the current Working Keys (and Base Derivation Keys if you&#8217;re using DUKPT).  Also called the Master File Key (&#8216;MFK&#8217;)</p>
<p><strong>Zone PIN Key (</strong>&#8216;<strong>ZPK&#8217;)</strong> &#8211; The ZPK is what&#8217;s used to encrypt the PIN blocks that traverse the wires between institutions.  Also referred to as the &#8216;Working Key.&#8217;  <em><strong>This is the key that the Dynamic Key Exchange is acting upon</strong></em>.  You&#8217;re obligated to change the Working Key at agreed-upon intervals (I typically advocate every 12 hours).</p>
<p><strong>Zone Master Key (&#8216;ZMK&#8217;)</strong> -  Think of the ZMK as the key transportation vehicle.  It&#8217;s the key that the two parties use to encrypt and exchange new ZPKs.  This key is established via a key ceremony.  You keep a copy of the ZMK encrypted under the LMK in a file somewhere (you&#8217;ll see how it&#8217;s used here further down this post).  Also called the Key Exchange Key (&#8216;KEK&#8217;).</p>
<p>Now, I&#8217;ll pass along some hard-earned &#8216;lessons learned&#8217; (<a href="http://jpos.org/blog"><strong><font color="#ff9966">Alejandro<img src="http://i.ixnp.com/images/v3.3.1/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.3.1/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></font></strong></a> and I have the scars on our backs to prove it):</p>
<ol>
<li>From the moment you start planning discussions with the gateway, establish RIGHT AWAY that you want field-by-field level specifics of how the Dynamic Key Exchange is to be performed.  It&#8217;ll be within the context of some  Network Message Exchange (e.g., 0800/0810), but that&#8217;s not granular enough &#8211; you need to know the thing down to the field-content level.</li>
<li>Scour the documentation you&#8217;ve been provided to see if those details are in there.  I&#8217;ve done two different gateway projects recently, and in both cases the Key Exchange details were notably absent from the doc.  But, that doc exists somewhere within the gateway institution.  Track it down.  Get your hands on it. </li>
<li>Knowledge of the Key Exchange model is &#8211; by design &#8211; not widespread throughout the gateway provider&#8217;s project personnel.  Insist on getting their expert in on at least one of the planning calls.  Make note of this person&#8217;s name and contact details.  Establish that information channel.  This is a critically important point to your success.</li>
</ol>
<p>At a high level, there are two models:</p>
<ul>
<li>You request a new ZPK from the gateway, and they provide it in the response.  [I call this the '<strong>Pull</strong>' model (for obvious reasons - you pull the key from them).]</li>
<li>The gateway sends you a new ZPK and you respond with a message indicating success or failure.  [This, by contrast is the '<strong>Push</strong>' model.]</li>
</ul>
<p>Your implementation will be one of those.</p>
<p>Now, I&#8217;ll provide two examples, one push, one pull.  In both cases, I&#8217;ll reference some files that I prepared that will show you the model explained as implemented in fine detail. </p>
<p><a href="http://andyorrock.typepad.com/keyexchange/PushToIssuer.pdf"><strong><font color="#ff9966">Here&#8217;s the push model<img src="http://i.ixnp.com/images/v3.3.1/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.3.1/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></font></strong></a>.  [I've done some annotating there within Acrobat.]  We&#8217;re the Issuer in this example.  The gateway sends us a new key every 12 hours.  Behind the scenes in this example we&#8217;re using a <a href="http://keyup.biz/products.html"><strong><font color="#ff9966">Key-Up II box from IDS<img src="http://i.ixnp.com/images/v3.3.1/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.3.1/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></font></strong></a> as our HSM.   The sequence of events is:</p>
<ol>
<li>The gateway sends us a new ZPK (under ZMK) in an 0800 (MTI) Network Request.</li>
<li>We obtain the ZMK (under LMK) from our files.</li>
<li>We use the cryptograms from Steps 1 and 2 to create the appropriate command to the Key-Up (here, a &#8217;12&#8242;)</li>
<li>We get the response from the Key-Up (the &#8217;13&#8242;) and validate that the Check Digits match those provided by the Issuer.</li>
<li>Assuming the check in Step 4 is okay, we store the result (the ZPK under LMK) as the new Working Key.</li>
<li>We send an 0810 (MTI) Network Response back to the Issuer (Note that Field 39 on our response is &#8217;00&#8242; &#8211; indicating success). </li>
</ol>
<p>There&#8217;s so much detail here worthy of comment.  I&#8217;ll touch on a few things (these are the types of detail you want to bring to the surface in your reviews):</p>
<ul>
<li>This gateway uses &#8217;162&#8242; in Field 70 to tip to us that it&#8217;s a Key Exchange in play.</li>
<li>Note how we have to pluck the incoming cryptogram out of the esoteric morass of Field 123.</li>
<li>We have to construct an equally cryptic Field 123 on our response.</li>
</ul>
<p>For reference &#8211; the push example provided here is a working model for Genpass (now called <a href="http://www.elanfinancialservices.com/efs/index.jsp"><strong><font color="#ff9966">Elan Financial Services<img src="http://i.ixnp.com/images/v3.3.1/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.3.1/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></font></strong></a> &#8211; a division of US Bank) interface.  Nice people!</p>
<p><a href="http://andyorrock.typepad.com/keyexchange/PullFromGateway.pdf"><strong><font color="#ff9966">Here&#8217;s the pull model<img src="http://i.ixnp.com/images/v3.3.1/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.3.1/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></font></strong></a>.  [Here, I had to do a did a bit of redacting in Acrobat.  The redactions don't spoil the flow.]  I won&#8217;t go into too much detail in-line here, because you&#8217;ll see I&#8217;ve provided entirely TMI (Too Much Information!) in the file.  The flow here is:</p>
<ol>
<li>We request a new key from the Gateway in an 0800.</li>
<li>The new key (ZPK under ZMK) comes back in an 0810.</li>
<li>We fire off an &#8216;FA&#8217; to the Thales 8000.</li>
<li>We get the &#8216;FB&#8217; back and validate the check digits.</li>
<li>If okay, we store the result (the ZPK under LMK) as the new Working Key.</li>
</ol>
<p>Now, since we&#8217;re the initiator here we have to have a way to determine when to trigger the exchange request.  We do that through a channel Logon Manager.  Here&#8217;s a 30_fdr_logon_mgr.xml we have defined:</p>
<p><span style="font-size:0.9em;"><font size="2">&lt;fdr-logon-mgr class=&#8221;org.jpos.fdr.LogonManager&#8221; logger=&#8221;Q2&#8243;&gt;<br />
&lt;property name=&#8221;persistent-space&#8221; value=&#8221;jdbm:fdrlogon:log/fdrlogon&#8221; /&gt;<br />
&lt;property name=&#8221;mux&#8221;            value=&#8221;fdr-mux&#8221; /&gt;<br />
&lt;property name=&#8221;channel-ready&#8221;  value=&#8221;fdr.ready&#8221; /&gt;<br />
&lt;property name=&#8221;timeout&#8221;        value=&#8221;900000&#8243; /&gt;<br />
&lt;property name=&#8221;echo-interval&#8221;  value=&#8221;600000&#8243; /&gt;<br />
&lt;property name=&#8221;logon-interval&#8221; value=&#8221;43200000&#8243; /&gt;<br />
&lt;property name=&#8221;pseudo-tid&#8221;     value=&#8221;00599999&#8243; /&gt;<br />
&lt;property name=&#8221;pseudo-mid&#8221;     value=&#8221;000452009999999&#8243; /&gt;<br />
&lt;property name=&#8221;sm&#8221;             value=&#8221;Thales&#8221; /&gt;<br />
&lt;property file=&#8221;cfg/keys.cfg&#8221; /&gt;<br />
&lt;property name=&#8221;initial-delay&#8221;  value=&#8221;5000&#8243; /&gt;<br />
&lt;/fdr-logon-mgr&gt;</font></span></p>
<p>You can see the &#8216;logon-interval&#8217;  &#8211; 43,200,000 milliseconds is every 12 hours  (behind the scenes, our logon sequence does a logon exchange <strong>and</strong> a key exchange.]</p>
<p>For reference, the pull example provided here is a working model for the FDR North interface.</p>
<p>You get the idea, I hope!  Nail down all those details in order to maximize your chances of success.  Otherwise, feel free to beat your head against a wall, because that&#8217;s what will happen if you don&#8217;t get this information.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/universalpaymentsolution.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/universalpaymentsolution.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/universalpaymentsolution.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/universalpaymentsolution.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/universalpaymentsolution.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/universalpaymentsolution.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/universalpaymentsolution.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/universalpaymentsolution.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/universalpaymentsolution.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/universalpaymentsolution.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/universalpaymentsolution.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/universalpaymentsolution.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/universalpaymentsolution.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/universalpaymentsolution.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/universalpaymentsolution.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/universalpaymentsolution.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=15&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://universalpaymentsolution.wordpress.com/2007/11/20/dynamic-key-exchange-models/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19d3af9e420cb6b94803283bbc3b57d7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">univ</media:title>
		</media:content>

		<media:content url="http://i.ixnp.com/images/v3.3.1/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.3.1/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.3.1/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.3.1/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.3.1/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.3.1/t.gif" medium="image" />
	</item>
		<item>
		<title>Session and transactions</title>
		<link>http://universalpaymentsolution.wordpress.com/2007/11/10/session-and-transactions/</link>
		<comments>http://universalpaymentsolution.wordpress.com/2007/11/10/session-and-transactions/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 17:45:17 +0000</pubDate>
		<dc:creator>universalpaymentsolution.wordpress.com</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://universalpaymentsolution.wordpress.com/2007/11/10/session-and-transactions/</guid>
		<description><![CDATA[Sessions and transactions This page explains common techniques to deal with the Session and transactions in Hibernate applications. Refer to the Hibernate reference documentation and the &#8220;Transactions and Concurrency&#8221; chapter for more information. This page describes Hibernate 3.1.x and code &#8230; <a href="http://universalpaymentsolution.wordpress.com/2007/11/10/session-and-transactions/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=14&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>Sessions and transactions</h1>
<p>This page explains common techniques to deal with the <tt>Session</tt> and transactions in Hibernate applications. Refer to the Hibernate reference documentation and the &#8220;Transactions and Concurrency&#8221; chapter for more information. This page describes Hibernate 3.1.x and code shown here does not work in older versions.</p>
<ul>
<li><a href="http://hibernate.org/42.html#A2">Unit of Work</a></li>
<li><a href="http://hibernate.org/42.html#A3">Transactions</a></li>
<li><a href="http://hibernate.org/42.html#A4">The scope of a unit of work</a></li>
<li><a href="http://hibernate.org/42.html#A5">Transaction demarcation with JTA</a></li>
<li><a href="http://hibernate.org/42.html#A6">Transaction demarcation with plain JDBC</a></li>
<li><a href="http://hibernate.org/42.html#A7">Transaction demarcation with EJB/CMT</a></li>
<li><a href="http://hibernate.org/42.html#A8">Custom transaction interceptors</a></li>
<li><a href="http://hibernate.org/42.html#A9">Implementing long Conversations</a></li>
<li><a href="http://hibernate.org/42.html#A10">Implementing data access objects (DAOs)</a></li>
<li><a href="http://hibernate.org/42.html#A11">What about the <tt>SessionFactory</tt>?</a></li>
<li><a href="http://hibernate.org/42.html#A12">This is all very difficult, can&#8217;t this be done easier?</a></li>
</ul>
<p><a name="A2"></a></p>
<h2>Unit of Work</h2>
<p>A particular unit of work is grouping data access operations. We usually refer to the Hibernate <tt>Session</tt> as a unit of work because the scope of a <tt>Session</tt> is exactly that, in almost all cases. (The <tt>Session</tt> is also many other things, for example, a cache and a primary API.) To begin a unit of work you open a <tt>Session</tt>. To end a unit of work you close a <tt>Session</tt>. Usually you also <tt>flush</tt> a <tt>Session</tt> at the end of a unit of work to execute the SQL DML operations (UPDATE, INSERT, DELETE) that synchronize the in-memory <tt>Session</tt> state with the database. A <tt>Session</tt> executes also SQL queries, whenever the developer triggers a query with the API or through loading on demand (lazy loading). Alternatively, think of the <tt>Session</tt> as a gateway to your database, a map of managed entity instances that are automatically dirty checked, and a queue of SQL DML statements that are created and flushed by Hibernate automatically.</p>
<p><a name="A3"></a></p>
<h2>Transactions</h2>
<p>Transactions also group data access operations, in fact, every SQL statement, be it queries or DML, has to execute inside a database transaction. There can be no communication with a database outside of a database transaction. (Note that there are such things as <em>read-only transactions</em>, that can be used to improve cleanup time in a database engine if it is not smart enough to optimize its own operations.)</p>
<p>One approach is the auto-commit mode, where every single SQL statement is wrapped in a very short transaction. This mode is never appropriate for an application, but only for ad-hoc execution of SQL with an operator console. Hibernate disables or expects the environment (in J2EE/JEE) to disable auto-commit mode, as applications are not executing ad-hoc SQL but a planned sequence of statements. (There are ways to enable auto-commit behavior in Hibernate but it is by definition slower than regular transactions and less safe. If you want to know more about auto-commit mode, read <a href="http://hibernate.org/403.html">this</a>.)</p>
<p>The right approach is to define clear transaction boundaries in your application by beginning and committing transactions either programmatically, or if you have the machinery to do this, declaratively (e.g. on service/command methods). If an exception occurs the transaction has to be rolled back (or declaratively, is rolled back).</p>
<p><a name="A4"></a></p>
<h2>The scope of a unit of work</h2>
<p>A single Hibernate <tt>Session</tt> might have the same scope as a single database transaction.</p>
<p><img border="0" width="173" src="http://hibernate.org/hib_images/community/session_request.png" height="79" style="display:block;margin-left:auto;margin-right:auto;" />This is the most common programming model used for the <em>session-per-request</em> implementation pattern. A single <tt>Session</tt> and a single database transaction implement the processing of a particular request event (for example, a Http request in a web application). Do <em>never</em> use the <em>session-per-operation</em> anti-pattern! (There are extremely rare exceptions when session-per-operation might be appropriate, you will not encounter these if you are just learning Hibernate.)</p>
<p>Another programming model is that of long Conversations, e.g. an application that implements a multi-step dialog, for example a <em>wizard dialog</em>, to interact with the user in several request/response cycles.</p>
<p>One way to implement this is the <em>session-per-request-with-detached-objects</em> pattern. Once persistent objects are considered <em>detached</em> during user think-time and have to be reattached to a new <tt>Session</tt> after they have been modified.</p>
<p><img border="0" width="372" src="http://hibernate.org/hib_images/community/session_detachedobjects.png" height="151" style="display:block;margin-left:auto;margin-right:auto;" />The <em>session-per-conversation</em> pattern is however recommended. In this case a single <tt>Session</tt> has a bigger scope than a single database transaction and it might span several database transactions. Each request event is processed in a single database transaction, but flushing of the <tt>Session</tt> would be delayed until the end of the conversation and the last database transaction, to make the conversation atomic. The <tt>Session</tt> is held in disconnected state, with no open database connection, during user think-time. Hibernate&#8217;s automatic optimistic concurrency control (with versioning) is used to provide conversation isolation.</p>
<p><img border="0" width="341" src="http://hibernate.org/hib_images/community/session_conversation.png" height="169" style="display:block;margin-left:auto;margin-right:auto;" />Hibernate supports several convenience APIs that make implementation of all transaction and conversation strategies easier, with any transaction processing system you might deploy on.</p>
<p><a name="A5"></a></p>
<h2>Transaction demarcation with JTA</h2>
<p>Hibernate works in any environment that uses JTA, in fact, we recommend to use JTA whenever possible as it is the standard Java transaction interface. You get JTA built-in with all J2EE/JEE application servers, and each <tt>Datasource</tt> you use in such a container is automatically handled by a JTA <tt>TransactionManager</tt>. But this is not the only way to get JTA, you can use a standalone implementation (e.g. <a href="http://jotm.objectweb.org/">JOTM</a>) in any plain JSE environment. Another example is <a href="http://www.jboss.com/products/seam">JBoss Seam</a>, it comes bundled with a demo application that uses an embeddable version of the JBoss JCA/JTA/JNDI services, hence provides JTA in any deployment situation.</p>
<p>Hibernate can automatically bind the &#8220;current&#8221; <tt>Session</tt> to the current JTA transaction. This enables an easy implementation of the <em>session-per-request</em> strategy with the <tt>getCurrentSession()</tt> method on your <tt>SessionFactory</tt>:</p>
<pre>try {     UserTransaction tx = (UserTransaction)new InitialContext()                             .lookup("java:comp/UserTransaction");                                  tx.begin();      // Do some work     factory.getCurrentSession().load(...);     factory.getCurrentSession().persist(...);      tx.commit(); } catch (RuntimeException e) {     tx.rollback();     throw e; // or display error message }</pre>
<p>The advantage of the built-in support should become clear as soon as you write non-trivial applications: you can separate the transaction demarcation code from your data access code. The &#8220;current session&#8221; refers to a Hibernate <tt>Session</tt> bound by Hibernate behind the scenes, to the transaction scope. A <tt>Session</tt> is opened when <tt>getCurrentSession()</tt> is called for the first time and closed when the transaction ends. It is also flushed automatically before the transaction commits. You can call <tt>getCurrentSession()</tt> as often and anywhere you want as long as the transaction runs. To enable this strategy in your Hibernate configuration:</p>
<ul>
<li>set <em>hibernate.transaction.manager_lookup_class</em> to a lookup strategy for your JEE container</li>
<li>set <em>hibernate.transaction.factory_class</em> to <tt>org.hibernate.transaction.JTATransactionFactory</tt></li>
</ul>
<p>See the Hibernate reference documentation for more configuration details.</p>
<p>This does not mean that all Hibernate Sessions are closed when a transaction is committed! Only the Session that you obtained with <tt>sf.getCurrentSession()</tt> is flushed and closed automatically. If you decide to use <tt>sf.openSession()</tt> and manage the <tt>Session</tt> yourself, you have to <tt>flush()</tt> and <tt>close()</tt> it. So a less convenient alternative, without any &#8220;current&#8221; <tt>Session</tt>, is this:</p>
<pre>UserTransaction tx = (UserTransaction)new InitialContext()                             .lookup("java:comp/UserTransaction");  Session session = factory.openSession();  try {     tx.begin();      // Do some work     session.load(...);     session.persist(...);      session.flush();      tx.commit(); } catch (RuntimeException e) {     tx.rollback();     throw e; // or display error message } finally {     session.close(); }</pre>
<p>If you manage the <tt>Session</tt> yourself, code is more difficult to layer. You can&#8217;t easily move data access operations into a different layer than transaction and <tt>Session</tt> demarcation.</p>
<p><a name="A6"></a></p>
<h2>Transaction demarcation with plain JDBC</h2>
<p>If you don&#8217;t have JTA and don&#8217;t want to deploy it along with your application, you will usually have to fall back to JDBC transaction demarcation. Instead of calling the JDBC API you better use Hibernate&#8217;s <tt>Transaction</tt> and the built-in <em>session-per-request</em> functionality:</p>
<pre>try {     factory.getCurrentSession().beginTransaction();      // Do some work     factory.getCurrentSession().load(...);     factory.getCurrentSession().persist(...);      factory.getCurrentSession().getTransaction().commit(); } catch (RuntimeException e) {     factory.getCurrentSession().getTransaction().rollback();     throw e; // or display error message }</pre>
<p>Because Hibernate can&#8217;t bind the &#8220;current session&#8221; to a transaction, as it does in a JTA environment, it binds it to the current Java thread. It is opened when <tt>getCurrentSession()</tt> is called for the first time, but in a &#8220;proxied&#8221; state that doesn&#8217;t allow you to do anything except start a transaction. When the transaction ends, either through commit or roll back, the &#8220;current&#8221; <tt>Session</tt> is closed automatically. The next call to <tt>getCurrentSession()</tt> starts a new proxied <tt>Session</tt>, and so on. In other words, the session is bound to the thread behind the scenes, but scoped to a transaction, just like in a JTA environment. This thread-bound strategy works in every JSE application &#8211; note that you should use JTA and a transaction-bound strategy in a JEE environment (or install JTA with your JSE application, this is a modular service).</p>
<p>To enable the thread-bound strategy in your Hibernate configuration:</p>
<ul>
<li>set <em>hibernate.transaction.factory_class</em> to <tt>org.hibernate.transaction.JDBCTransactionFactory</tt></li>
<li>set <em>hibernate.current_session_context_class</em> to <tt>thread</tt></li>
</ul>
<p>This does not mean that all Hibernate Sessions are closed when a transaction is committed! Only the Session that you obtained with <tt>sf.getCurrentSession()</tt> is flushed and closed automatically. If you decide to use <tt>sf.openSession()</tt> and manage the <tt>Session</tt> yourself, you have to <tt>close()</tt> it. So a less convenient alternative, without any &#8220;current&#8221; <tt>Session</tt>, is this:</p>
<pre>Session session = factory.openSession(); Transaction tx = null; try {     tx = session.beginTransaction();      // Do some work     session.load(...);     session.persist(...);      tx.commit(); // Flush happens automatically } catch (RuntimeException e) {     tx.rollback();     throw e; // or display error message } finally {     session.close(); }</pre>
<p>If you manage the <tt>Session</tt> yourself, code is more difficult to layer. You can&#8217;t easily move data access operations into a different layer than transaction and <tt>Session</tt> demarcation.</p>
<p><a name="A7"></a></p>
<h2>Transaction demarcation with EJB/CMT</h2>
<p>Our goal really is to remove any transaction demarcation code from the data access code:</p>
<pre>@TransactionAttribute(TransactionAttributeType.REQUIRED) public void doSomeWork() {     // Do some work     factory.getCurrentSession().load(...);     factory.getCurrentSession().persist(...); }</pre>
<p>Instead of coding the begin, commit, and rollback of your transactions into your application you could use a declarative approach. For example, you might declare that some of your service or command methods require a database transaction to be started when they are called. The transaction ends when the method returns; if an exception is thrown, the transaction will be rolled back. The Hibernate &#8220;current&#8221; <tt>Session</tt> has the some scope as the transaction (flushed and closed at commit) and is internally also bound to the transaction. It propagates into all components that are called in one transactions.</p>
<p>Declarative transaction demarcation is a standard feature of EJB, also known as container-managed transactions (CMT). In EJB 2.x you would use XML deployment descriptors to create your transaction assembly. In EJB 3.x you can use JDK 5.0 annotation metadata directly in your source code, a much less verbose approach. To enable CMT transaction demarcation for EJBs in Hibernate configuration:</p>
<ul>
<li>set <em>hibernate.transaction.manager_lookup_class</em> to a lookup strategy for your JEE container</li>
<li>set <em>hibernate.transaction.factory_class</em> to <tt>org.hibernate.transaction.CMTTransactionFactory</tt></li>
</ul>
<p><a name="A8"></a></p>
<h2>Custom transaction interceptors</h2>
<p>To remove transaction demarcation from your data access code you might want to write your own interceptor that can begin and end a transaction programmatically (or even declaratively). This is a lot easier than it sounds, after all, you only have to move three methods into a different piece of code that runs every time a request has to be processed. Of course more sophisticated solutions would also need to handle transaction propagation, e.g. if one service method calls another one. Typical interceptors are a servlet filter, or an AOP interceptor that can be applied to any Java method or class.</p>
<p>For an implementation with a servlet filter see <a href="http://hibernate.org/43.html">Open Session in View</a>.</p>
<p>For an implementation with JBoss AOP see <a href="http://hibernate.org/391.html">Session handling with AOP</a>.</p>
<p><a name="A9"></a></p>
<h2>Implementing long Conversations</h2>
<p>If you&#8217;d like to design your application with a <em>session-per-conversation</em> strategy, you need to <tt>manage</tt> the &#8220;current&#8221; <tt>Session</tt> yourself. An example with a servlet filter is shown with the <a href="http://hibernate.org/43.html">Open Session in View</a> pattern.</p>
<p><a name="A10"></a></p>
<h2>Implementing data access objects (DAOs)</h2>
<p>Writing DAOs that call Hibernate is incredibly easy and trivial. You don&#8217;t need a framework. You don&#8217;t need to extend some &#8220;DAOSupport&#8221; superclass from a proprietary library. All you need to do is keep your transaction demarcation (begin and commit) as well as any Session handling code outside of the DAO implementation. For example, a <tt>ProductDAO</tt> class has a <tt>setCurrentSession()</tt> method or constructor, or it looks up the &#8220;current&#8221; Hibernate <tt>Session</tt> internally. Where this current <tt>Session</tt> comes from is <em>not</em> the responsibility of the DAO! How a transaction begins and ends is <em>not</em> the responsibility of the DAO! All the data access object does is use the current <tt>Session</tt> to execute some persistence and query operations. For a pattern that follows these rules, see <a href="http://hibernate.org/328.html">Generic Data Access Objects</a>.</p>
<p><a name="A11"></a></p>
<h2>What about the <tt>SessionFactory</tt>?</h2>
<p>In the examples above you can see access to the <tt>SessionFactory</tt>. How do you get access to the factory everywhere in your code? Again, if you run in a JEE environment, or use an embedded service in JSE, you could simply look it up from JNDI, where Hibernate can bind it on startup. Another solution is to keep it in a global static singleton after startup. You can in fact solve both the problem of <tt>SessionFactory</tt> lookup and Hibernate startup with the same piece of code, a trivial helper class (this is from the tutorial in chapter 1, Hibernate reference documentation):</p>
<pre>public class HibernateUtil {      private static final SessionFactory sessionFactory;      static {         try {             // Create the SessionFactory from hibernate.cfg.xml             sessionFactory = new Configuration().configure().buildSessionFactory();         } catch (Throwable ex) {             // Make sure you log the exception, as it might be swallowed             System.err.println("Initial SessionFactory creation failed." + ex);             throw new ExceptionInInitializerError(ex);         }     }      public static SessionFactory getSessionFactory() {         return sessionFactory;     }  }</pre>
<p>A more sophisticated version if <tt>HibernateUtil</tt> that can also switch automatically between JNDI and static singleton can be found in <a href="http://caveatemptor.hibernate.org/">the CaveatEmptor demo application</a>.</p>
<p><em>Note: There are many variations of much more complex HibernateUtil classes floating around the net. However, for Hibernate 3.1, the code shown above is the only code that is needed. If you use JNDI you might want to have a look at HibernateUtil in the latest CaveatEmptor. Every other HibernateUtil is obsolete for Hibernate 3.1.</em></p>
<p><a name="A12"></a></p>
<h2>This is all very difficult, can&#8217;t this be done easier?</h2>
<p>Hibernate can only do so much as a persistence service, managing the persistence service is however the responsibility of the application infrastructure, or framework. The EJB3 programming model makes transaction and persistence context management very easy, use the <a href="http://entitymanager.hibernate.org/">Hibernate EntityManager</a> to get this API. Either run your EJBs inside a full J2EE application server (previews available from several vendors) or in a lightweight embeddable EJB3 container, <a href="http://www.jboss.com/products/ejb3">JBoss Embeddable EJB3</a>, in any Java environment. The <a href="http://www.jboss.com/products/seam">JBoss Seam</a> framework has built-in support for automatic context management, including persistence and conversations, with only a few annotations in your source code.</p>
<p><!-- End Body --></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/universalpaymentsolution.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/universalpaymentsolution.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/universalpaymentsolution.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/universalpaymentsolution.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/universalpaymentsolution.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/universalpaymentsolution.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/universalpaymentsolution.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/universalpaymentsolution.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/universalpaymentsolution.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/universalpaymentsolution.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/universalpaymentsolution.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/universalpaymentsolution.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/universalpaymentsolution.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/universalpaymentsolution.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/universalpaymentsolution.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/universalpaymentsolution.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=14&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://universalpaymentsolution.wordpress.com/2007/11/10/session-and-transactions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19d3af9e420cb6b94803283bbc3b57d7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">univ</media:title>
		</media:content>

		<media:content url="http://hibernate.org/hib_images/community/session_request.png" medium="image" />

		<media:content url="http://hibernate.org/hib_images/community/session_detachedobjects.png" medium="image" />

		<media:content url="http://hibernate.org/hib_images/community/session_conversation.png" medium="image" />
	</item>
		<item>
		<title>Thoughts on jPOS and SQL Databases</title>
		<link>http://universalpaymentsolution.wordpress.com/2007/11/10/thoughts-on-jpos-and-sql-databases/</link>
		<comments>http://universalpaymentsolution.wordpress.com/2007/11/10/thoughts-on-jpos-and-sql-databases/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 17:19:32 +0000</pubDate>
		<dc:creator>universalpaymentsolution.wordpress.com</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://universalpaymentsolution.wordpress.com/2007/11/10/thoughts-on-jpos-and-sql-databases/</guid>
		<description><![CDATA[Thoughts on jPOS and SQL Databases In legacy payment systems, the &#8216;databases&#8217; employed tend to be esoteric, closed, proprietary subsystems hard-wired into the application itself.  For example, in ON/2 (running on the Stratus VOS platform) the database is an internal &#8230; <a href="http://universalpaymentsolution.wordpress.com/2007/11/10/thoughts-on-jpos-and-sql-databases/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=13&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3 class="entry-header">Thoughts on jPOS and SQL Databases</h3>
<p class="entry-content">
<p class="entry-body">In legacy payment systems, the &#8216;databases&#8217; employed tend to be esoteric, closed, proprietary subsystems hard-wired into the application itself.  For example, in ON/2 (running on the Stratus VOS platform) the database is an internal sub-system called &#8216;DBI.&#8217;  This makes sense: when ON/2 was first rolled out (1982!), SQL was in its infancy (I think Larry Ellison was still on his first wife) and OLTP vendors were &#8216;rolling their own&#8217; to meet very specific database needs.</p>
<p>And let&#8217;s be clear here:  those internal inventions have stood the test of time.  &#8216;dbi&#8217; is approaching 25 years and is still serviceable.  There are some serious shortcomings to the approach though:</p>
<ul>
<li>The transaction log &#8211; nominally a database table &#8211; is, in fact, just a log.  This fact greatly and unnecessarily complicates (note: this is a personal opinion I&#8217;m expressing here) some of the very critical touchpoints of your financial switch: namely, how you implement &#8216;multi-part&#8217; transactions like reversals and completions (of pre-auths).</li>
<li>It&#8217;s very esoteric and akin to a black art.   The great thing about the SQL world is that everything is standards-based.  Our clients have deep bench strength in the SQL vendor offering they&#8217;ve selected (e.g., Oracle, MS SQL Server, etc.) and they can contribute all of their expertise withough having to have internal knowledge of the jPOS application or even a general knowledge of payment systems.  This is huge.  A talented DBA is a very important part of a successful jPOS implementation.  I know this from experience.</li>
<li>It completely wipes out any flexbility you have in terms of dropping that application (as is) onto another operating platform.  Continuing with the &#8216;dbi&#8217; example, that&#8217;s a Stratus VOS construct pure and simple.  You&#8217;re tied to that thing like a boat anchor.  With a SQL-based approach, you&#8217;ve got flexbility.  Assuming your app is written in Java and &#8216;talks&#8217; to a SQL DB via JDBC (that accurately describes jPOS), then you can be (as an example) Windows/SQL Server today and Linux/MySQL next week (we&#8217;ve actually done it on the same day).  That&#8217;s a pipe dream in the legacy world.</li>
</ul>
<p>So, now we have this jPOS world where we can take advantage of SQL databases.  But, as a jPOS implementer, you have some important responsibilities that go along with that shift in deployment models.   Here are the practices that you absolutely must get established:</p>
<ul>
<li><strong>Backup nightly</strong>:  All defined tables ought to be backed-up as part of an overnight operation.</li>
<li><strong>Replicate real-time</strong>:  There are a sub-set of tables where a nightly backup isn’t sufficient enough protection from the results of an unexpected loss of data.  These tables are dynamic – they can be expected to change constantly throughout the day.  These tables need to be replicated on a real-time basis to a copy located on a separate server.  Ideally, all user and system tables in the primary database should be replicated to a failover database machine.</li>
<li><strong>Cull older days</strong>:  In older ‘legacy’ systems, a new file was created to house transactions associated with each specific capture date.  While this made file maintenance a nightmare, it had the positive effect of limiting the size of any file (and its associated indices) to a single day’s worth of transactions, meaning that performance of the transaction engine would remain relatively constant over time (assuming all other factors remained unchanged).  In a jPOS-based approach, the authorization engine makes use of SQL technology to facilitate its underlying DB requirements.  The advantages of employing SQL technology are dramatic: development, test, support, reporting and offline integration efforts are probably 2 to 3x easier (and surely far less esoteric) with SQL underpinnings vs. the proprietary approaches of the past. <br />
However, using SQL technology does raise the bar in terms of proactively ensuring that the application does not inexorably lose its performance edge over time.  Namely, the transaction log houses all activity from all capture dates.  This log must not be allowed to hold an ever-increasing number of days of activity.  Otherwise, the high standards of performance demonstrated during user acceptance testing will slowly ebb away.  It stands to reason that an online system that has to fight through indices reflecting (e.g.) one year’s worth of production traffic will be hard pressed to perform at an acceptable speed.  The number of days to keep online (i.e., within the confines of the TranLog) will vary according to processing power and transaction volume.  Older data ought to be moved to a separate table location, where it can be accessed for historical query purposes and not negatively encumber online processing speed. <br />
In conclusion, the size of the tranLog needs to be proactively managed each evening through automated, scheduled routines that cull each day as it falls of the end of the online range.</li>
</ul>
<ul>
<li><strong>Defragment Indices</strong>:  From experience, we know that regular execution of index defragmentation will result in faster performance, compact indices and a re-establishment of ‘target’ fill factors. </li>
</ul>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/universalpaymentsolution.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/universalpaymentsolution.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/universalpaymentsolution.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/universalpaymentsolution.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/universalpaymentsolution.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/universalpaymentsolution.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/universalpaymentsolution.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/universalpaymentsolution.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/universalpaymentsolution.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/universalpaymentsolution.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/universalpaymentsolution.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/universalpaymentsolution.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/universalpaymentsolution.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/universalpaymentsolution.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/universalpaymentsolution.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/universalpaymentsolution.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=13&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://universalpaymentsolution.wordpress.com/2007/11/10/thoughts-on-jpos-and-sql-databases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19d3af9e420cb6b94803283bbc3b57d7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">univ</media:title>
		</media:content>
	</item>
		<item>
		<title>Building the team (part2)</title>
		<link>http://universalpaymentsolution.wordpress.com/2007/11/10/building-the-team-part2/</link>
		<comments>http://universalpaymentsolution.wordpress.com/2007/11/10/building-the-team-part2/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 17:13:26 +0000</pubDate>
		<dc:creator>universalpaymentsolution.wordpress.com</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://universalpaymentsolution.wordpress.com/2007/11/10/building-the-team-part2/</guid>
		<description><![CDATA[Building the team (part 2) In part 1, I reviewed &#8220;the critical skills that team members should have in order to succeed at a jPOS-based project.&#8221; To recap briefly, Alejandro said those were (in loose order of importance): O-O Programming; &#8230; <a href="http://universalpaymentsolution.wordpress.com/2007/11/10/building-the-team-part2/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=12&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3 class="entry-header">Building the team (part 2)</h3>
<p class="entry-content">
<p class="entry-body">In <a href="http://andyorrock.typepad.com/paymentsystems/2006/09/building_the_te.html"><strong><font color="#ff9966">part 1<img src="http://i.ixnp.com/images/v3.2/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.2/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></font></strong></a>, I reviewed &#8220;the critical skills that team members should have in order to succeed at a <a href="http://jpos.org/"><strong><font color="#ff9966">jPOS<img src="http://i.ixnp.com/images/v3.2/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.2/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></font></strong></a>-based project.&#8221; To recap briefly, Alejandro said those were (in loose order of importance): O-O Programming; Java; Open Systems Projects; Hibernate; and jPOS itself.  [I added general SQL knowledge to the list.]</p>
<p>Now, the fact of the matter is, in a real-life project not every team member is going to meet the hurdle of this &#8216;ideal&#8217; profile.  But you can still construct a very effective team.  Here are some thoughts on a good team based on some recent experiences.</p>
<ol>
<li>There&#8217;s no getting around the fact that you need at least one lead developer that possesses all those talents (from my original list).  In fact, I&#8217;d go one step further and state that this person needs to have some additional skills in the kitbag: first, they ought to know about Online Transaction Processing (&#8216;OLTP&#8217; &#8211; inherently different from and more challenging than batch coding) <strong>and</strong> (optimally) they should have previous experience with payment systems (a.k.a., &#8216;financial switches&#8217;).  The litmus test on that last item is: is this person familiar with the ISO8583 standard?  If so, that&#8217;s your leader.  This person needs to do (or, head up) the implementation of the project&#8217;s core OLTP aspects.</li>
<li>Now, you might have a second person (or group) that comes close talent-wise, but is a bit junior to the person described in item 1 above.  Perhaps they possess many of the original skill list items, but are less experienced in OLTP or are brand-new to the payment systems world.  These people can be very effective by helping on the batch aspects of the project.  <strong>Don&#8217;t underestimate your offline needs.</strong>  Yeah, it&#8217;s sexy and cool to work on the OLTP stuff, but you&#8217;re not going to rollout until you&#8217;ve successfully built extract (settlement) files, created reports for key user constituencies, and built access/status screens for operations.  Don&#8217;t leave these tasks until the end of the project.  Get this part of the team working in conjunction with the team members from point #1.  In our projects, we make OLTP implementation decisions every day that have some type of impact on batch processing.  In an ideal world, you&#8217;ve got these two efforts going side-by-side.  The side benefit is that Team #2 learns a bit more about OLTP and Payment Systems every day the joint efforts go on.</li>
<li>Unlike legacy payment systems, jPOS is SQL-based.  As you saw in my previous post, I feel very strongly that having generic SQL knowledge is invaluable in these projects (I tacked the skill onto the end of Alejandro&#8217;s critical skill list).   I mention &#8216;generic&#8217; here.  What I mean by that adjective is that this person doesn&#8217;t need to be an administrator.  [You must have access to a DBA to do the project and maintain performance levels, but not as a full-time project member.  See more thoughts on DBAs <a href="http://andyorrock.typepad.com/paymentsystems/2006/08/thoughts_on_jpo.html"><strong><font color="#ff9966">here<img src="http://i.ixnp.com/images/v3.2/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.2/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></font></strong></a>.  The DBA is your best friend on a jPOS project.]  Instead, what I mean is that you need a full-time project team member who is comfortable devising, implementing and performing SQL-based tasks (in the DB of choice, e.g., MS SQL Server, MySQL etc.).  This person can be invaluable resource.  They can set up specific test conditions, allow iterative testing of new or changed functionality, assist in priming and maintaining production databases, and &#8211; most importantly (in my book) &#8211; allow Teams 1 and 2 (from above) to focus on the coding implementation.  That defines a nice &#8216;point of intersection&#8217; where the coders produce the incremental schema additions/changes (out of Hibernate) and it&#8217;s up to Person #3 here to implement the schema and populate it.</li>
<li><em><strong>[Now, we go out a bit from the core technical circle of the project...]</strong></em>  Next, you need someone to write specifications.  This is a critically important role.  [And this isn't simply because I write the specs on our projects.]  Here&#8217;s why: when you get these specs from organizations like FDR, AMEX, Discover (etc.), you quickly see that they need to be all things to all people.  They&#8217;ve got every possible type of option and implementation &#8216;mode&#8217; defined.  Most times, <strong>maybe</strong> 20% (or less) of that content will apply to you.  It&#8217;s not fair to leave it to the coders to weed through the other 80% to figure out what&#8217;s &#8216;in play.&#8217;  My goal in these jPOS projects is that I always that I produce and provide a spec that eliminates any need for the technical team members to refer to the original source spec.  If they&#8217;re having to look through doc from AMEX to figure out an unclear point regarding the implementation, then my spec isn&#8217;t good enough.   These specs should synthesize all aspects of the project and leave nothing to guessing.</li>
<li>You also want to have someone in charge of communicating to third-parties.  Especially on these big projects where you&#8217;re building interfaces to three or more external organizations (not uncommon if you&#8217;re putting in Debit/EBT, Credit and one or more Stored Value links), the communication alone can roll down the hill like a growing snowball.  It&#8217;s important that a team member be designated to handle that communication and protect the others from ad-hoc and random communication attempts. </li>
<li>You also need one or more testers.  I&#8217;m referring here to testers that are engaged <strong>before</strong> you have the users take a whack at it.  Typically, projects like this run pretty tight on manpower basis, so you often don&#8217;t have the luxury of a separate test team.  I know we typically don&#8217;t, so the spec writers (the people who really know the expected results the best) and the Third-Party communication person (from my points #5 and #6 above) may need to pull double-duty here.</li>
<li>One last point is about telecommunications, which typically manifests itself when you&#8217;re setting up connections to the third-parties (e.g., an online interface to First Data).  Now, the good part of this point is that with the standardization of everything onto TCP/IP (thank god), a full-time comm expert on your team isn&#8217;t a prerequisite.  [<strong>NOTE</strong>: if someone suggests anything but TCP/IP for connectivity, push back like a madman.  I'm serious.]  Of course, there&#8217;s a bad part, too: telecommunications has become increasingly complex due to security concerns and the overwhelming digitization of (and connecting to) everything.  So, like the DBA, you need to have someone (or a group) in the enterprise that you can call at a moment&#8217;s notice to ask the inevitable question: Why can&#8217;t we connect?</li>
</ol>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/universalpaymentsolution.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/universalpaymentsolution.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/universalpaymentsolution.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/universalpaymentsolution.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/universalpaymentsolution.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/universalpaymentsolution.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/universalpaymentsolution.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/universalpaymentsolution.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/universalpaymentsolution.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/universalpaymentsolution.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/universalpaymentsolution.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/universalpaymentsolution.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/universalpaymentsolution.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/universalpaymentsolution.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/universalpaymentsolution.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/universalpaymentsolution.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=12&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://universalpaymentsolution.wordpress.com/2007/11/10/building-the-team-part2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19d3af9e420cb6b94803283bbc3b57d7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">univ</media:title>
		</media:content>

		<media:content url="http://i.ixnp.com/images/v3.2/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.2/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.2/t.gif" medium="image" />
	</item>
		<item>
		<title>Reversal and Duplicates Scenarios</title>
		<link>http://universalpaymentsolution.wordpress.com/2007/11/08/reversal-and-duplicates-scenarios/</link>
		<comments>http://universalpaymentsolution.wordpress.com/2007/11/08/reversal-and-duplicates-scenarios/#comments</comments>
		<pubDate>Thu, 08 Nov 2007 07:57:47 +0000</pubDate>
		<dc:creator>universalpaymentsolution.wordpress.com</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://universalpaymentsolution.wordpress.com/2007/11/08/reversal-and-duplicates-scenarios/</guid>
		<description><![CDATA[Entirely TMI on Reversals and Duplicates Readers of this blog know that I spend a lot of time talking about the intricacies of the various payment processing (acquirer-side) reversal scenarios and the importance of getting the reversal model right.  Here&#8217;s &#8230; <a href="http://universalpaymentsolution.wordpress.com/2007/11/08/reversal-and-duplicates-scenarios/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=11&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3 class="entry-header">Entirely TMI on Reversals and Duplicates</h3>
<p class="entry-body">Readers of this blog know that I spend a lot of time talking about the intricacies of the <a href="http://andyorrock.typepad.com/paymentsystems/2006/04/handling_acquir.html"><strong><font color="#ff9966">various payment processing (acquirer-side) reversal scenarios<img src="http://i.ixnp.com/images/v3.0/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.0/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></font></strong></a> and the importance of <a href="http://andyorrock.typepad.com/paymentsystems/2006/08/get_the_reversa.html"><strong><font color="#ff9966">getting the reversal model right<img src="http://i.ixnp.com/images/v3.0/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.0/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></font></strong></a>. </p>
<p>Here&#8217;s another take at reversal processing &#8211; entirely TMI (Too Much Information) as the title of this piece suggests, plus some other thoughts on a &#8216;close cousin&#8217; of reversal processing: finding and quashing duplicate transactions that could be tossed your way from the transaction&#8217;s origination point.</p>
<p>jPOS implementations can efficiently support the reversal and ‘find duplicate’ models of our clients. <br />
On the reversal side of an implementation, Acquirers need to support both host- and terminal-based reversals.  The host-based reversal side follows a very standard approach:</p>
<ol>
<li>A timeout parameter is applied to all remote queries.</li>
<li>If no response is received prior to the expiration of the timeout, a reversal is generated (only if required – credit interfaces rely on settlement files to post and typically do not want to see reversals…even of the ‘courtesy’ variety).</li>
<li>The transaction is logged to the jPOS application’s ‘tranlog’ with a non-zero internal result code (‘irc’) and a ‘reversal indicator’ of ‘H’ reflecting a host-based reversal.</li>
</ol>
<p>To show how this is implemented within a jPOS Transaction Manager, we provide here an example of two participants used to perform a ‘query host or reverse’ operation from an Acquirer to an FDR Debit/EBT financial gateway:</p>
<p><span style="font-size:0.9em;"><font size="2">  &lt;participant class=&#8221;org.jpos.ev.QueryHost&#8221;<br />
     logger=&#8221;Q2&#8243; realm=&#8221;query-remote-host&#8221;&gt;<br />
   &lt;property name=&#8221;mux&#8221;     value=&#8221;fdr-mux&#8221; /&gt;<br />
   &lt;property name=&#8221;saf&#8221;     value=&#8221;saf&#8221; /&gt;<br />
   &lt;property name=&#8221;timeout&#8221; value=&#8221;25000&#8243;   /&gt;<br />
   &lt;property name=&#8221;threshold&#8221; value=&#8221;12000&#8243;   /&gt;<br />
   &lt;property name=&#8221;checkpoint&#8221; value=&#8221;query-host-or-reverse&#8221; /&gt;<br />
   &lt;property name=&#8221;reverse-on-timeout&#8221; value=&#8221;<strong>true</strong>&#8221; /&gt;<br />
  &lt;/participant&gt;</font></span><span style="font-size:0.9em;"><font size="2">  &lt;participant class=&#8221;org.jpos.ev.FlagReversal&#8221;&gt;<br />
   &lt;property name=&#8221;reversal-class&#8221; value=&#8221;H&#8221; /&gt;<br />
  &lt;/participant&gt; </p>
<p></font></span>Terminal-based reversal processing is more of a challenge because the jPOS processing engine must be aligned to match up to the proprietary reversal model used by our customers.  We urge our clients to get their terminal-based reversal model details on the table Day 1 so we can get all the nuances worked out right away.  This means getting ‘origination point’ systems personnel to explain how they expect a reversal to be tied an original and then propagating that model into your jPOS implementation. </p>
<p>We make special note of this point in order to pass along a tough lesson learned recently&#8230;our standard &#8216;point of acquisition&#8217; timeout reversal model implementation assumed that the Primary Account Number (&#8216;PAN&#8217;) was the linchpin around which we should base our reversal logic.  That turned out to be a faulty assumption; the store systems folks explained their front-end implementation and described a rather logical sequence of events where one card could be substituted for another (within the same customer session), the result being that a reversal may in fact have a different card number.</p>
<p>The important thing is that this isn&#8217;t a discussion on whether that front-end model is right, wrong, flawed, etc.  The reality is:  it&#8217;s reflective of a specific business model; it&#8217;s typically been proven right and improved/hardened over time; and &#8211; most importantly &#8211; the goal of any financial switch implementation should be to get into production without inflicting any type of change on a store systems implementation.  Since store systems changes most often manifest themselves in chain-wide rollouts, they should be avoided at all costs.</p>
<p>The terminal-based reversal is implemented via a ‘FindOriginal’ participant.  For example, here is the group of participants called at one jPOS client location for a terminal-based Debit Reversal transaction:</p>
<p><span style="font-size:0.9em;"><font size="2">&lt;group name=&#8221;DebitSaleReversal&#8221;&gt;<br />
  &lt;participant class=&#8221;org.jpos.ev.PopulateDebitTranLog&#8221;<br />
     logger=&#8221;Q2&#8243; realm=&#8221;populate-debit-tranlog&#8221;&gt;<br />
   &lt;property name=&#8221;itc&#8221; value=&#8221;05301&#8243; /&gt;<br />
   &lt;property name=&#8221;cardType&#8221; value=&#8221;DB&#8221; /&gt;<br />
   &lt;property name=&#8221;checkpoint&#8221; value=&#8221;populate-debit-tranlog&#8221; /&gt;<br />
  &lt;/participant&gt;</font></span></p>
<p><span style="font-size:0.9em;"><font size="2">  &amp;validate_terminal;</font></span></p>
<p><span style="font-size:0.9em;"><font size="2">  &lt;participant class=&#8221;org.jpos.ev.FindOriginal&#8221;&gt;<br />
   &lt;property name=&#8221;original-itc&#8221; value=&#8221;05300&#8243; /&gt;<br />
   &lt;property name=&#8221;original-card-type&#8221; value=&#8221;DB&#8221; /&gt;<br />
   &lt;property name=&#8221;reversal-window&#8221; value=&#8221;86400&#8243; /&gt;<br />
  &lt;/participant&gt;<br />
  &lt;participant class=&#8221;org.jpos.ev.CreateFDRRequest&#8221;<br />
     logger=&#8221;Q2&#8243; realm=&#8221;create-fdr-request&#8221;&gt;<br />
   &lt;property name=&#8221;mti&#8221;        value=&#8221;0400&#8243; /&gt;<br />
   &lt;property name=&#8221;pcode&#8221;      value=&#8221;009000&#8243; /&gt;<br />
   &lt;property name=&#8221;template&#8221;   value=&#8221;cfg/fdr-template.xml&#8221; /&gt;<br />
   &lt;property name=&#8221;space&#8221;      value=&#8221;jdbm:fdr-stan&#8221; /&gt;<br />
   &lt;property name=&#8221;checkpoint&#8221; value=&#8221;create-fdr-request&#8221; /&gt;<br />
  &lt;/participant&gt;</font></span></p>
<p><span style="font-size:0.9em;"><font size="2">  &amp;store_and_forward;</font></span></p>
<p><span style="font-size:0.9em;"><font size="2">  &lt;participant class=&#8221;org.jpos.ev.FlagReversal&#8221;&gt;<br />
   &lt;property name=&#8221;reversal-class&#8221; value=&#8221;T&#8221; /&gt;<br />
  &lt;/participant&gt;<br />
  &amp;force_approval;<br />
  &amp;debit_response;<br />
&lt;/group&gt;</font></span></p>
<p>In that participant flow (noting highlights here only)…</p>
<ul>
<li>The Debit Reversal (identified in a ‘switch’ participant prior to the flow shown here) is assigned an internal tran code (‘itc’) of 05301.  [NOTE:  These itc values aren't a jPOS standard; it's a Transaction Code numbering scheme I invented and have propagated throughout various jPOS-based solution implementations.]</li>
<li>FindOriginal searches the tranlog for a corresponding original (making use of tranlog indices put in place by DBAs in support of this specific, important action).</li>
<li>If an original was located, a reversal (0400 in this implementation) is formatted and placed into the appropriate store and forward (‘SAF’) queue.</li>
<li>If an original was located, the FlagReversal participant tags the original with a ‘T’ (to signify a terminal-based reversal) in the Reversal Indicator field and cross-links the original and reversal in the tranlog.</li>
<li>The ‘force_approval’ step ensures that if a corrupt, non-processable reversal is received from the origination point, we respond with an Approval in order to prevent a hard loop between terminal and host.</li>
<li>The ‘debit_response’ step formats a message back to the origination point.  We take special care to respond to all reversal attempts – regardless of the internal result – with an Approval.  To do anything else is to invite the possibility of endless loops and, ultimately, manual intervention and queue clearance at the origination point.</li>
</ul>
<p>In order to be reversed by FindOriginal:</p>
<ul>
<li>There needs to be a match (between an original and a reversal) on the fields designated by the implementer as the “reversal match-up fields.”  For example, at one jPOS/OLS.Switch client location, this match-up logic is implemented via a Hibernate call like this:</li>
</ul>
<blockquote><p><span style="font-size:0.9em;"><font size="2">Criteria crit = db.session().createCriteria (DebitTranLog.class).<br />
    add (Expression.eq (&#8220;storeNumber&#8221;, rev.getStoreNumber())).<br />
    add (Expression.eq (&#8220;registerNumber&#8221;, rev.getRegisterNumber())).<br />
    add (Expression.eq (&#8220;registerTranId&#8221;, rev.getRegisterTranId())).<br />
    add (Expression.eq (&#8220;tenderNumber&#8221;, rev.getTenderNumber())).<br />
    add (Expression.eq (&#8220;internalTranCode&#8221;, originalTranCode)).<br />
    add (Expression.eq (&#8220;internalResultCode&#8221;, TRAN_APPROVED)).<br />
    add (Expression.eq (&#8220;reconId&#8221;, new Long (0L))).<br />
    add (Expression.isNull (&#8220;revInd&#8221;)).<br />
    addOrder (Order.desc (&#8220;id&#8221;)).<br />
    setMaxResults (1);</font></span></p></blockquote>
<ul>
<li>The original transaction must have been approved.</li>
<li>The original transaction must not have already been reversed.</li>
<li>The original transaction must not have already been extracted in the nightly reconciliation process.</li>
</ul>
<p>For further reading on reversal challenges and our team’s real-world experiences in this area, please refer to the following in-depth discussions…</p>
<p><a href="http://andyorrock.typepad.com/paymentsystems/2006/04/handling_acquir.html"><font color="#ff9966"><strong>Handling Acquirer-side Reversals in a Payment Switch<img src="http://i.ixnp.com/images/v3.0/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.0/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></strong></font></a></p>
<p><a href="http://andyorrock.typepad.com/paymentsystems/2006/08/get_the_reversa.html"><font color="#ff9966"><strong>Get the Reversal Model right<img src="http://i.ixnp.com/images/v3.0/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.0/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></strong></font></a></p>
<p><a href="http://andyorrock.typepad.com/paymentsystems/2006/08/linking_origina.html"><strong><font color="#ff9966">Linking Originals and Reversals<img src="http://i.ixnp.com/images/v3.0/t.gif" style="background-position:-787px 0;display:inline;font-weight:normal;left:auto;float:none;background-image:url('http://i.ixnp.com/images/v3.0/theme/orange/palette.gif');visibility:visible;vertical-align:top;width:14px;line-height:normal;background-repeat:no-repeat;font-style:normal;font-family:'trebuchet ms', arial, helvetica, sans-serif;position:static;top:auto;height:12px;background-color:transparent;text-decoration:none;border-width:0;margin:0;padding:1px 0 0;" class="snap_preview_icon" /></font></strong></a></p>
<p>The action of filtering out duplicates can be seen as a very ‘close cousin’ of the terminal-based reversal.  In both cases, the host implementation bears the responsibility of doing a “FindOriginal.”  In reversal processing, it is a reversal that prompts a look for an original (i.e., a financial request like a Purchase/Sale or Merchandise Return).  By contrast, in a ‘dup-check’ implementation every financial request will perform a FindOriginal-like step. </p>
<p>For example, in the Debit Sale (Purchase), we execute (at one client site) this flow of participants:</p>
<p><span style="font-size:0.9em;"><font size="2">&lt;group name=&#8221;DebitSale&#8221;&gt;<br />
  &lt;participant class=&#8221;org.jpos.ev.PopulateDebitTranLog&#8221;<br />
     logger=&#8221;Q2&#8243; realm=&#8221;populate-debit-tranlog&#8221;&gt;<br />
   &lt;property name=&#8221;itc&#8221; value=&#8221;05300&#8243; /&gt;<br />
   &lt;property name=&#8221;cardType&#8221; value=&#8221;DB&#8221; /&gt;<br />
   &lt;property name=&#8221;checkpoint&#8221; value=&#8221;populate-debit-tranlog&#8221; /&gt;<br />
  &lt;/participant&gt;</font></span></p>
<p><span style="font-size:0.9em;"><font size="2">  &amp;validate_terminal;</font></span></p>
<p><span style="font-size:0.9em;"><font size="2">  &lt;participant class=&#8221;org.jpos.ev.FindDuplicate&#8221;&gt;<br />
   &lt;property name=&#8221;itc&#8221; value=&#8221;05300&#8243; /&gt;<br />
   &lt;property name=&#8221;checkpoint&#8221; value=&#8221;find-duplicate&#8221; /&gt;<br />
  &lt;/participant&gt;<br />
  &lt;participant class=&#8221;org.jpos.ev.HasEntry&#8221;&gt;<br />
   &lt;property name=&#8221;name&#8221; value=&#8221;DUPLICATE_TRANLOG&#8221; /&gt;<br />
   &lt;property name=&#8221;yes&#8221;  value=&#8221;DuplicateDebitResponse LogAndReply&#8221; /&gt;<br />
   &lt;property name=&#8221;no&#8221;   value=&#8221;DebitSale_Response LogAndReply&#8221; /&gt;<br />
  &lt;/participant&gt;<br />
&lt;/group&gt;</font></span></p>
<p><span style="font-size:0.9em;"><font size="2">&lt;group name=&#8221;DebitSale_Response&#8221;&gt;<br />
  &amp;translate_pin;</font></span></p>
<p><span style="font-size:0.9em;"><font size="2">  &lt;participant class=&#8221;org.jpos.ev.CreateFDRRequest&#8221;<br />
     logger=&#8221;Q2&#8243; realm=&#8221;create-fdr-request&#8221;&gt;<br />
   &lt;property name=&#8221;mti&#8221;        value=&#8221;0200&#8243; /&gt;<br />
   &lt;property name=&#8221;pcode&#8221;      value=&#8221;009000&#8243; /&gt;<br />
   &lt;property name=&#8221;template&#8221;   value=&#8221;cfg/fdr-template.xml&#8221; /&gt;<br />
   &lt;property name=&#8221;space&#8221;      value=&#8221;jdbm:fdr-stan&#8221; /&gt;<br />
   &lt;property name=&#8221;checkpoint&#8221; value=&#8221;create-fdr-request&#8221; /&gt;<br />
  &lt;/participant&gt;<br />
  &amp;query_fdr_host_or_reverse;<br />
  &amp;debit_response;<br />
&lt;/group&gt;</font></span></p>
<p>Behind the scenes, that ‘FindDuplicate’ participant is modeled very closely on ‘FindOriginal.’  The logic is very easy to follow here:</p>
<p>If ‘FindDuplicate’ locates a previous attempt (one that was approved and not subsequently reversed), it places a “DUPLICATE TRANLOG” entry into the transaction context.  The ‘HasEntry’ participant re-directs the transaction flow based upon whether the transaction in flight is determined to be a duplicate.  If it is not, the transactions proceeds as intended (here, the PIN is translated and external authorization is sought).  If it is, the transaction is given an internal result code (‘irc’) to reflect it as a Duplicate.  Of course, the origination point is told this transaction is an approval (the internal logic provides the approval code from the original).</p>
<p>For the record, the DuplicateDebitResponse participant is the referenced example looks like this: </p>
<p><span style="font-size:0.9em;"><font size="2">&lt;group name=&#8221;DuplicateDebitResponse&#8221;&gt;<br />
  &lt;participant class=&#8221;org.jpos.ev.SetRC&#8221; logger=&#8221;Q2&#8243; realm=&#8221;duplicate-debit-response-set-rc&#8221;&gt;<br />
   &lt;property name=&#8221;rc&#8221; value=&#8221;4001&#8243; /&gt;<br />
  &lt;/participant&gt;<br />
  &amp;debit_response;<br />
&lt;/group&gt;</font></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/universalpaymentsolution.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/universalpaymentsolution.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/universalpaymentsolution.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/universalpaymentsolution.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/universalpaymentsolution.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/universalpaymentsolution.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/universalpaymentsolution.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/universalpaymentsolution.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/universalpaymentsolution.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/universalpaymentsolution.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/universalpaymentsolution.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/universalpaymentsolution.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/universalpaymentsolution.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/universalpaymentsolution.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/universalpaymentsolution.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/universalpaymentsolution.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=universalpaymentsolution.wordpress.com&amp;blog=1921529&amp;post=11&amp;subd=universalpaymentsolution&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://universalpaymentsolution.wordpress.com/2007/11/08/reversal-and-duplicates-scenarios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19d3af9e420cb6b94803283bbc3b57d7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">univ</media:title>
		</media:content>

		<media:content url="http://i.ixnp.com/images/v3.0/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.0/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.0/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.0/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.0/t.gif" medium="image" />
	</item>
	</channel>
</rss>
