<?xml version="1.0" encoding="utf-8"?>

			<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">

			<channel>
			<title>Glyn Jackson&apos;s Web Design and ColdFusion Blog - Sage Pay</title>
			<link>http://www.cfcoffee.co.uk/index.cfm</link>
			<description>Glyn Jackson&apos;s ColdFusion, Web Design and Web Development Blog. Award Winning Web Design in Staffordshire and Manchester, UK.</description>
			<language>en-gb</language>
			<pubDate>Sat, 04 Sep 2010 20:40:04 +0100</pubDate>
			<lastBuildDate>Sun, 21 Jun 2009 21:09:00 +0100</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>cfsparky@gmail.com</managingEditor>
			<webMaster>cfsparky@gmail.com</webMaster>
			<itunes:subtitle></itunes:subtitle>
			<itunes:summary></itunes:summary>
			<itunes:category text="Technology" />
			<itunes:category text="Technology">
				<itunes:category text="Podcasting" />
			</itunes:category>
			<itunes:category text="Technology">
				<itunes:category text="Tech News" />
			</itunes:category>
			<itunes:keywords></itunes:keywords>
			<itunes:author></itunes:author>
			<itunes:owner>
				<itunes:email>cfsparky@gmail.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			
			<itunes:explicit>no</itunes:explicit>
			
			
			
			
			
			<item>
				<title>ColdBox - SagePay VSP Driect Plugin</title>
				<link>http://www.cfcoffee.co.uk/index.cfm/2009/6/21/ColdBox--SagePay-VSP-Driect-Plugin</link>
				<description>
				
				&lt;p&gt;Now I am getting more to grips with CB I have recreated an ecommerce site using the framework. I have also created a simple plugin for the Coldbox Framework that allows you to integrate SagePay VSP Direct payment system in your website. It seems to work very well the site I used it on has been running the new plugin for few days, taking transactions with no errors.&lt;/p&gt;

&lt;p&gt;In case you don&apos;t know, SagePay VSP Direct is a method of processing a transaction through the Sage Pay gateway using server to server communication with the customer remaining on your website throughout the whole process. &lt;/p&gt;

&lt;p&gt;This plugin will setup, send and handle the response from their gateway. You will need an understanding of Sagepay and a SSL cert to use this plugin. Sage Pay only support UK merchants at the moment!&lt;/p&gt;
 
&lt;p&gt;I will be adding some example of the handler, checkout forms, and cart to a zip download soon at the moment all I have included the plugin CFC code below.&lt;/p&gt;
				 [More]
				</description>
				
				
				<category>Sage Pay</category>
				
				<category>ColdBox</category>
				
				<category>ColdFusion 8</category>
				
				<category>Frameworks</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Sun, 21 Jun 2009 21:09:00 +0100</pubDate>
				<guid>http://www.cfcoffee.co.uk/index.cfm/2009/6/21/ColdBox--SagePay-VSP-Driect-Plugin</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Sage Pay CFC</title>
				<link>http://www.cfcoffee.co.uk/index.cfm/2009/5/28/Sage-Pay-CFC-for-new</link>
				<description>
				
				&lt;p&gt;Below is a quick update on the old &apos;&lt;strong&gt;protx.cfc&lt;/strong&gt;&apos; now &apos;&lt;strong&gt;sagepay.cfc&lt;/strong&gt;&apos;.  It&apos;s a little messy and there are a few things I would have done different if I  had more time, but I didn&apos;t. I wanted to share will you my new CFC because as you may know &lt;strong&gt;Sage  Pay&lt;/strong&gt; don&apos;t seem to have a &lt;strong&gt;ColdFusion VSP Direct integration Kit anymore! Anyhow &lt;/strong&gt;below will help  jump start anyone wanting to integration the gatway using the VSP Direct service they offer.&lt;/p&gt;

&lt;p&gt;First make sure you have read their integration guides @&#xa0;sagepay.com and you will need have a test or simulation account to test first. If you don&apos;t have one you can sign up for a &lt;a href=&quot;https://support.sagepay.com/apply/RequestSimAccount.aspx&quot; target=&quot;_blank&quot;&gt; free simulation  account here.&lt;/a&gt; You can get a live account by clicking &lt;a href=&quot;https://support.sagepay.com/apply/Default.aspx?PartnerID={7A2FD354-AD2B-4060-A1DF-2A8A4E0481D6}&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Download the &lt;a href=&quot;http://www.newebia.co.uk/blog/downloads/sagepay.rar&quot;&gt;sagepay.cfc&lt;/a&gt; (.rar file 3KB)&lt;/p&gt;
				 [More]
				</description>
				
				
				<category>Sage Pay</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Thu, 28 May 2009 16:43:00 +0100</pubDate>
				<guid>http://www.cfcoffee.co.uk/index.cfm/2009/5/28/Sage-Pay-CFC-for-new</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>New Protx (Sage Pay) VSP Direct URL&apos;s</title>
				<link>http://www.cfcoffee.co.uk/index.cfm/2009/4/22/New-Protx-Sage-Pay-VSP-Direct-URLs</link>
				<description>
				
				&lt;p&gt;If you are using my CFC for Protx &lt;a href=&quot;http://www.newebia.co.uk/blog/index.cfm/2008/9/29/ColdFusion-and-Protx-VSP-Direct&quot; title=&quot;VSP Direct CFC&apos;s&quot;&gt;VSP Direct Integration &lt;/a&gt; (now sage pay) you will need to change the live and testing URL&apos;s. SagePay told us that the old Live URL&apos;s would still work, however the way they are just forwarding in the system means they don&apos;t work correctly with CFHTTP calls. The replacement code with the new URL&apos;s is below.&lt;/p&gt; 

&lt;code&gt;
&lt;cffunction name=&quot;SetGateway&quot; access=&quot;public&quot;  hint=&quot;set which gateway is to be used, simulator, test or live&quot; returntype=&quot;struct&quot;&gt;
  &lt;!--- Set up local scope. ---&gt;
  &lt;cfset  GatewaySettings = StructNew() /&gt;
  &lt;cfif #SimulatorSite# is &quot;1&quot; &gt;
   &lt;cfscript&gt;
 StructInsert(GatewaySettings, &quot;Verify&quot;, &quot;false&quot;);
 StructInsert(GatewaySettings, &quot;PurchaseURL&quot;, &quot;https://test.sagepay.com/Simulator/VSPDirectGateway.asp&quot;);
 StructInsert(GatewaySettings, &quot;RefundURL&quot;, &quot;https://test.sagepay.com/Simulator/VSPServerGateway.asp?Service=VendorRefundTx&quot;);
 StructInsert(GatewaySettings, &quot;ReleaseURL&quot;, &quot;https://test.sagepay.com/Simulator/VSPServerGateway.asp?Service=VendorReleaseTx&quot;);
 StructInsert(GatewaySettings, &quot;RepeatURL&quot;, &quot;https://test.sagepay.com/Simulator/VSPServerGateway.asp?Service=VendorRepeatTx&quot;);
 StructInsert(GatewaySettings, &quot;callbackURL&quot;, &quot;https://test.sagepay.com/Simulator/VSPDirectCallback.asp&quot;);
&lt;/cfscript&gt;
  &lt;/cfif&gt;
  &lt;cfif #TestSite# is &quot;1&quot;&gt;
    &lt;cfscript&gt;
 StructInsert(GatewaySettings, &quot;Verify&quot;, &quot;false&quot;);
 StructInsert(GatewaySettings, &quot;PurchaseURL&quot;, &quot;https://test.sagepay.com/gateway/service/vspdirect-register.vsp&quot;);
 StructInsert(GatewaySettings, &quot;RefundURL&quot;, &quot;https://test.sagepay.com/gateway/service/refund.vsp&quot;);
 StructInsert(GatewaySettings, &quot;ReleaseURL&quot;, &quot;https://test.sagepay.com/gateway/service/release.vsp&quot;);
 StructInsert(GatewaySettings, &quot;RepeatURL&quot;, &quot;https://test.sagepay.com/gateway/service/repeat.vsp&quot;);
 StructInsert(GatewaySettings, &quot;callbackURL&quot;, &quot;https://test.sagepay.com/gateway/service/direct3dcallback.vsp&quot;);
&lt;/cfscript&gt;
    &lt;!---https://ukvpstest.protx.com/showpost/showpost.asp---&gt;
  &lt;/cfif&gt;
  &lt;cfif #LiveSite# is &quot;1&quot;&gt;
  &lt;cfscript&gt;
 StructInsert(GatewaySettings, &quot;Verify&quot;, &quot;false&quot;);
 StructInsert(GatewaySettings, &quot;PurchaseURL&quot;, &quot;https://live.sagepay.com/gateway/service/vspdirect-register.vsp&quot;);
 StructInsert(GatewaySettings, &quot;RefundURL&quot;, &quot;https://live.sagepay.com/gateway/service/refund.vsp&quot;);
 StructInsert(GatewaySettings, &quot;ReleaseURL&quot;, &quot;https://live.sagepay.com/gateway/service/release.vsp&quot;);
 StructInsert(GatewaySettings, &quot;RepeatURL&quot;, &quot;https://live.sagepay.com/gateway/service/repeat.vsp&quot;);
 StructInsert(GatewaySettings, &quot;callbackURL&quot;, &quot;https://live.sagepay.com/gateway/service/direct3dcallback.vsp&quot;);
&lt;/cfscript&gt;
  &lt;/cfif&gt;
  &lt;cfreturn GatewaySettings&gt;
&lt;/cffunction&gt;
&lt;/code&gt;
				
				</description>
				
				
				<category>Sage Pay</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Wed, 22 Apr 2009 09:49:00 +0100</pubDate>
				<guid>http://www.cfcoffee.co.uk/index.cfm/2009/4/22/New-Protx-Sage-Pay-VSP-Direct-URLs</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Protx rebrands now it&apos;s Sage Pay</title>
				<link>http://www.cfcoffee.co.uk/index.cfm/2009/4/16/Protx-rebrands-now-its-Sage-Pay</link>
				<description>
				
				&lt;img src=&quot;http://www.newebia.co.uk/blog/images//protx-partner[1].jpg&quot; style=&quot;float:right&quot;&gt;
&lt;p&gt;Protx, the UK&apos;s leading payment gateway provider as you may well be aware was purchased by Sage last year. Well another change, as of the 21st of April Protx will be rebranded as &apos;Sage Pay&apos;. Since the buyout I must comment that Sage Pay (Protx) support and their services have improved significantly.&lt;/p&gt;

&lt;p&gt;As we are Sage Pay partners we will still be offering the same services as before and customers who use our services will not have to do a thing! Your API and SalesMaxx Cart will be updated for you. For anyone who is not with us or is a developer remember to change your logos. No news yet about the VSP Direct URL&apos;s, I assume they will still work and they will let us know if they change them also.&lt;/p&gt;

&lt;p&gt;Hopefully this change means in the future we could have closer integration with Sage itself, although  you can now use Sage Pay within Sage, the other way, in as always has been a little more tricky.&lt;/p&gt;
				
				</description>
				
				
				<category>Chit Chat and Reviews</category>
				
				<category>Sage Pay</category>
				
				<pubDate>Thu, 16 Apr 2009 16:52:00 +0100</pubDate>
				<guid>http://www.cfcoffee.co.uk/index.cfm/2009/4/16/Protx-rebrands-now-its-Sage-Pay</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>IIS&apos;s compression scheme incompatible with CFHTTP</title>
				<link>http://www.cfcoffee.co.uk/index.cfm/2008/12/5/IISs-compression-scheme-incompatible-with-CFHTTP</link>
				<description>
				
				&lt;p&gt;Today some of our sites that make CFHTTP calls to Protx&apos;s VSP Direct Server stopped working! The CFHTTP response I was getting back was &quot;&lt;b&gt;Connection Failure: Status code unavailable&lt;/b&gt;&quot;.&lt;/p&gt;

&lt;p&gt;A quick search one the Net and I came across this post:  &lt;a href=&quot;http://www.talkingtree.com/blog/index.cfm/2004/7/28/20040729&quot; target=&quot;_blank&quot; title=&quot;talkingtree&quot; rel=&quot;nofollow&quot;&gt;Workaround for CFHTTP and Compressed HTTP Response from IIS&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Basically it&apos;s to do with the HTTP Compression in IIS. CFHTTP couldn&apos;t read the compressed header. This is due to IIS&apos;s compression scheme being incompatible with CFHTTP, so I have read.&lt;/p&gt;

&lt;p&gt;The quick fix was to add the following CFHTTPPARAM to the CFHTTP post so the header is sent back uncompressed.&lt;/p&gt;

&lt;code&gt;
&lt;cfhttpparam type=&quot;Header&quot; name=&quot;Accept-Encoding&quot; value=&quot;deflate;q=0&quot;&gt;
&lt;cfhttpparam type=&quot;Header&quot; name=&quot;TE&quot; value=&quot;deflate;q=0&quot;&gt;
&lt;/code&gt;

&lt;p&gt;This resolved the problem, however this issue according to some other blog posts I read was resolved in MX7 Cumulative Hot Fix back in 9/10/2007, however I am running CF 8.01 maybe this needs addressing again?&lt;/p&gt;
				
				</description>
				
				
				<category>Sage Pay</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Fri, 05 Dec 2008 16:24:00 +0100</pubDate>
				<guid>http://www.cfcoffee.co.uk/index.cfm/2008/12/5/IISs-compression-scheme-incompatible-with-CFHTTP</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>ColdFusion and Protx VSP Direct</title>
				<link>http://www.cfcoffee.co.uk/index.cfm/2008/9/29/ColdFusion-and-Protx-VSP-Direct</link>
				<description>
				
				&lt;p&gt;Protx no longer have examples of how to integrate ColdFusion with their VSP Direct Payment Gateway. Protx are one of the UK&apos;s biggest gateway providers and one would expect an integration kit in ColdFusion. They have told me they have no plans to add one now or in the near future. The old kit was ok but had no examples of the new 3D Secure system, and because it was way out date they took it off the site. &lt;/p&gt;

&lt;p&gt;Basically here is a reverse engineered version I did from there ASP.NET example which very works well. I know its a little messy at the mo, but it will give anyone who knowns CF and Protx a good starting template. The idea is when i have time to create a custom tag.&lt;/p&gt; 

&lt;p&gt;If you want to have a go yourself here is the guide to work from: &lt;a href=&quot;http://www.protx.com/downloads/docs/VSPDirectProtocolandIntegrationGuideline.pdf&quot; rel=&quot;nofollow&quot;&gt;VSP Guide&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My example already assumes you have created the payment details page with all the necessary form fields and have a understanding of Protx. The code also has some of my cart vars in which you would need to create or replace with your own.&lt;/p&gt;

&lt;p&gt;First create a component called gateway-protx.cfc&lt;/p&gt; 
&lt;code&gt;
&lt;cfcomponent&gt;
&lt;cfscript&gt;
SimulatorSite =&quot;0&quot;;
TestSite =&quot;0&quot;;
LiveSite =&quot;1&quot;;
&lt;/cfscript&gt;

&lt;cffunction name=&quot;SetGateway&quot; access=&quot;public&quot;  hint=&quot;set which gateway is to be used, simulator, test or live&quot; returntype=&quot;struct&quot;&gt;
  &lt;!--- Set up local scope. ---&gt;
  &lt;cfset  GatewaySettings = StructNew() /&gt;
  &lt;cfif #SimulatorSite# is &quot;1&quot; &gt;
   &lt;cfscript&gt;
 StructInsert(GatewaySettings, &quot;Verify&quot;, &quot;false&quot;);
 StructInsert(GatewaySettings, &quot;PurchaseURL&quot;, &quot;https://ukvpstest.protx.com/VSPSimulator/VSPDirectGateway.asp&quot;);
 StructInsert(GatewaySettings, &quot;RefundURL&quot;, &quot;https://ukvpstest.protx.com/VSPSimulator/VSPServerGateway.asp?Service=VendorRefundTx&quot;);
 StructInsert(GatewaySettings, &quot;ReleaseURL&quot;, &quot;https://ukvpstest.protx.com/VSPSimulator/VSPServerGateway.asp?Service=VendorReleaseTx&quot;);
 StructInsert(GatewaySettings, &quot;RepeatURL&quot;, &quot;https://ukvpstest.protx.com/VSPSimulator/VSPServerGateway.asp?Service=VendorRepeatTx&quot;);
 StructInsert(GatewaySettings, &quot;callbackURL&quot;, &quot;https://ukvpstest.protx.com/VSPSimulator/VSPDirectCallback.asp&quot;);
&lt;/cfscript&gt;
  &lt;/cfif&gt;
  &lt;cfif  #TestSite# is &quot;1&quot;&gt;
    &lt;cfscript&gt;
 StructInsert(GatewaySettings, &quot;Verify&quot;, &quot;false&quot;);
 StructInsert(GatewaySettings, &quot;PurchaseURL&quot;, &quot;https://ukvpstest.protx.com/vspgateway/service/vspdirect-register.vsp&quot;);
 StructInsert(GatewaySettings, &quot;RefundURL&quot;, &quot;https://ukvpstest.protx.com/vspgateway/service/refund.vsp&quot;);
 StructInsert(GatewaySettings, &quot;ReleaseURL&quot;, &quot;https://ukvpstest.protx.com/vspgateway/service/release.vsp&quot;);
 StructInsert(GatewaySettings, &quot;RepeatURL&quot;, &quot;https://ukvpstest.protx.com/vspgateway/service/repeat.vsp&quot;);
 StructInsert(GatewaySettings, &quot;callbackURL&quot;, &quot;https://ukvpstest.protx.com/vspgateway/service/direct3dcallback.vsp&quot;);
&lt;/cfscript&gt;
    &lt;!---https://ukvpstest.protx.com/showpost/showpost.asp---&gt;
  &lt;/cfif&gt;
  &lt;cfif #LiveSite# is &quot;1&quot;&gt;
    &lt;cfscript&gt;
 StructInsert(GatewaySettings, &quot;Verify&quot;, &quot;false&quot;);
 StructInsert(GatewaySettings, &quot;PurchaseURL&quot;, &quot;https://ukvps.protx.com/vspgateway/service/vspdirect-register.vsp&quot;);
 StructInsert(GatewaySettings, &quot;RefundURL&quot;, &quot;https://ukvps.protx.com/vspgateway/service/refund.vsp&quot;);
 StructInsert(GatewaySettings, &quot;ReleaseURL&quot;, &quot;https://ukvps.protx.com/vspgateway/service/release.vsp&quot;);
 StructInsert(GatewaySettings, &quot;RepeatURL&quot;, &quot;https://ukvps.protx.com/vspgateway/service/repeat.vsp&quot;);
 StructInsert(GatewaySettings, &quot;callbackURL&quot;, &quot;https://ukvps.protx.com/vspgateway/service/direct3dcallback.vsp&quot;);
&lt;/cfscript&gt;
  &lt;/cfif&gt;
  &lt;cfreturn GatewaySettings&gt;
&lt;/cffunction&gt;

&lt;!--- 
&apos;****************************************************************************************
&apos; Protx HTTP Call
&apos;**************************************************************************************** 
---&gt;
&lt;cffunction name=&quot;gatewaySend&quot; access=&quot;public&quot;  hint=&quot;checkes form dedtails&quot; returntype=&quot;struct&quot;&gt;
   &lt;cfargument name=&quot;PurchaseURL&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt;
  &lt;cfargument name=&quot;ProtocolVersion&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt;
  &lt;cfargument name=&quot;Vendor&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt;
  &lt;cfargument name=&quot;VendorTxCode&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt;
  &lt;cfargument name=&quot;DefaultCurrency&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt;
  &lt;cfargument name=&quot;DefaultDescription&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt;
  &lt;cfargument name=&quot;DefaultApplyAVSCV2&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt;
  

  &lt;cfargument name=&quot;DeliveryAddress&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt;
  &lt;cfargument name=&quot;DeliveryPostCode&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt;
 
  &lt;cfargument name=&quot;CardNumber&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt; 
  &lt;cfargument name=&quot;CardHolder&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt; 
  &lt;cfargument name=&quot;Amount&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt; 
  &lt;cfargument name=&quot;StartDate&quot; type=&quot;string&quot; required=&quot;no&quot;&gt;
  &lt;cfargument name=&quot;ExpiryDate&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt;
  &lt;cfargument name=&quot;Basket&quot; type=&quot;string&quot; required=&quot;no&quot;&gt;

  &lt;cfargument name=&quot;CustomerName&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt;
  &lt;cfargument name=&quot;BillingAddress&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt;
  &lt;cfargument name=&quot;BillingPostCode&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt;
  &lt;cfargument name=&quot;ContactNumber&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt;
  &lt;cfargument name=&quot;ContactFax&quot; type=&quot;string&quot; required=&quot;no&quot;&gt;
  &lt;cfargument name=&quot;CustomerEmail&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt;
 
  &lt;cfargument name=&quot;ClientIPAddress&quot; type=&quot;string&quot; required=&quot;yes&quot;&gt;
	
  
  &lt;cfargument name=&quot;XID&quot; type=&quot;string&quot; required=&quot;no&quot;&gt;
  &lt;cfargument name=&quot;ECI&quot; type=&quot;string&quot; required=&quot;no&quot;&gt;
  &lt;cfargument name=&quot;DSecureStatus&quot; type=&quot;string&quot; required=&quot;no&quot;&gt; 
  &lt;cfargument name=&quot;CV2&quot; type=&quot;string&quot; required=&quot;no&quot;&gt;
  &lt;cfargument name=&quot;CAVV&quot; type=&quot;string&quot; required=&quot;no&quot;&gt;
  
  &lt;cfargument name=&quot;IssueNumber&quot; type=&quot;string&quot; required=&quot;no&quot;&gt;
  
  
  
  &lt;!---Get the contents of the post from the previous page and split out the variables for sending---&gt;
  &lt;cfset RequestData = GetHttpRequestData()&gt;
  &lt;cfset Response = StructNew()&gt;
  &lt;cfloop list=&quot;#RequestData.content#&quot; index=&quot;line&quot; delimiters=&quot;&amp;&quot;&gt;
    &lt;cfset line = Trim( line )&gt;
    &lt;cfset StructInsert( Response, Trim( ListFirst( line, &quot;=&quot; ) ), URLDecode(Trim(Mid(line,Find(&quot;=&quot;,line)+1,len(line)) )) )&gt;
  &lt;/cfloop&gt;
  
  
  &lt;!---Set the required outgoing properties for the initial HTTPS post to the VPS---&gt;
  &lt;!---******************HERE IS WHERE THE ORDER GETS SENT TO PROTX VIA HTTPS*********************** ---&gt;
    &lt;cfhttp url=&quot;#PurchaseURL#&quot; method=&quot;post&quot; delimiter=&quot;,&quot; resolveurl=&quot;no&quot; throwonerror=&quot;yes&quot; timeout=&quot;20&quot; charset=&quot;windows-1252&quot;&gt;
    &lt;cfhttpparam name=&quot;VPSProtocol&quot; value=&quot;#ProtocolVersion#&quot; type=&quot;formfield&quot;&gt;
    &lt;cfhttpparam name=&quot;TxType&quot; value=&quot;#Response.TxType#&quot; type=&quot;formfield&quot;&gt;
    &lt;cfhttpparam name=&quot;Vendor&quot; value=&quot;#Vendor#&quot; type=&quot;formfield&quot;&gt;
    &lt;cfhttpparam name=&quot;VendorTxCode&quot; value=&quot;#VendorTxCode#&quot; type=&quot;formfield&quot;&gt;
    &lt;cfhttpparam name=&quot;Currency&quot; value=&quot;#DefaultCurrency#&quot; type=&quot;formfield&quot;&gt;
    &lt;cfhttpparam name=&quot;Description&quot; value=&quot;#DefaultDescription#&quot; type=&quot;formfield&quot;&gt;
    &lt;cfhttpparam name=&quot;Amount&quot; value=&quot;#Amount#&quot; type=&quot;formfield&quot;&gt;
    &lt;cfhttpparam name=&quot;CardHolder&quot; value=&quot;#CardHolder#&quot; type=&quot;formfield&quot;&gt;
    &lt;cfhttpparam name=&quot;CardNumber&quot; value=&quot;#CardNumber#&quot; type=&quot;formfield&quot;&gt;
    &lt;cfhttpparam name=&quot;GiftAidPayment&quot; value=&quot;0&quot; type=&quot;formfield&quot;&gt;
    &lt;cfhttpparam name=&quot;ApplyAVSCV2&quot; value=&quot;#DefaultApplyAVSCV2#&quot; type=&quot;formfield&quot;&gt;
    
    &lt;cfhttpparam name=&quot;Basket&quot; value=&quot;#Basket#&quot; type=&quot;formfield&quot;&gt;
    
	&lt;cfif #StartDate# is not &quot;&quot;&gt;
      &lt;cfhttpparam name=&quot;StartDate&quot; value=&quot;#StartDate#&quot; type=&quot;formfield&quot;&gt;
    &lt;/cfif&gt;
    &lt;cfif #ExpiryDate# is not &quot;&quot;&gt;
      &lt;cfhttpparam name=&quot;ExpiryDate&quot; value=&quot;#ExpiryDate#&quot; type=&quot;formfield&quot;&gt;
    &lt;/cfif&gt;
    
    &lt;cfif #DeliveryAddress# is not &quot;&quot;&gt;
      &lt;cfhttpparam name=&quot;DeliveryAddress&quot; value=&quot;#DeliveryAddress#&quot; type=&quot;formfield&quot;&gt;
    &lt;/cfif&gt;
     &lt;cfhttpparam name=&quot;BillingAddress&quot; value=&quot;#BillingAddress#&quot; type=&quot;formfield&quot;&gt;
    
    &lt;cfif #IssueNumber# is not &quot;&quot;&gt;
      &lt;cfhttpparam name=&quot;IssueNumber&quot; value=&quot;#IssueNumber#&quot; type=&quot;formfield&quot;&gt;
    &lt;/cfif&gt;
    &lt;cfhttpparam name=&quot;CV2&quot; value=&quot;#CV2#&quot; type=&quot;formfield&quot;&gt;
   
    &lt;cfhttpparam name=&quot;CardType&quot; value=&quot;#CardType#&quot; type=&quot;formfield&quot;&gt;
   
    &lt;cfhttpparam name=&quot;BillingPostCode&quot; value=&quot;#BillingPostCode#&quot; type=&quot;formfield&quot;&gt;
    
    &lt;cfif #DeliveryPostCode# is not &quot;&quot;&gt;
      &lt;cfhttpparam name=&quot;DeliveryPostCode&quot; value=&quot;#DeliveryPostCode#&quot; type=&quot;formfield&quot;&gt;
    &lt;/cfif&gt;
    
    &lt;cfhttpparam name=&quot;CustomerName&quot; value=&quot;#CustomerName#&quot; type=&quot;formfield&quot;&gt;
    
	&lt;cfif #ContactNumber# is not &quot;&quot;&gt;
      &lt;cfhttpparam name=&quot;ContactNumber&quot; value=&quot;#ContactNumber#&quot; type=&quot;formfield&quot;&gt;
    &lt;/cfif&gt;
    &lt;cfif #ContactFax# is not &quot;&quot;&gt;
      &lt;cfhttpparam name=&quot;ContactFax&quot; value=&quot;#ContactFax#&quot; type=&quot;formfield&quot;&gt;
    &lt;/cfif&gt;

    &lt;cfhttpparam name=&quot;CustomerEmail&quot; value=&quot;#CustomerEmail#&quot; type=&quot;formfield&quot;&gt;

    &lt;cfif #ClientIPAddress# is not &quot;&quot;&gt;
      &lt;cfhttpparam name=&quot;ClientIPAddress&quot; value=&quot;#ClientIPAddress#&quot; type=&quot;formfield&quot;&gt;
    &lt;/cfif&gt;
    
    
    &lt;cfif #CAVV# is not &quot;&quot;&gt;
      &lt;cfhttpparam name=&quot;CAVV&quot; value=&quot;#CAVV#&quot; type=&quot;formfield&quot;&gt;
    &lt;/cfif&gt;
    &lt;cfif #XID# is not &quot;&quot;&gt;
      &lt;cfhttpparam name=&quot;XID&quot; value=&quot;#XID#&quot; type=&quot;formfield&quot;&gt;
    &lt;/cfif&gt;
    &lt;cfif #ECI# is not &quot;&quot;&gt;
      &lt;cfhttpparam name=&quot;ECI&quot; value=&quot;#ECI#&quot; type=&quot;formfield&quot;&gt;
    &lt;/cfif&gt;
    &lt;cfif #DSecureStatus# is not &quot;&quot;&gt;
      &lt;cfhttpparam name=&quot;3DSecureStatus&quot; value=&quot;#DSecureStatus#&quot; type=&quot;formfield&quot;&gt;
    &lt;/cfif&gt;
    
    
  &lt;/cfhttp&gt;


  &lt;!--- ********************************END OF HTTPS POST TO PROTX******************************************---&gt;
  
  
  &lt;cfset Response = StructNew()&gt;
  &lt;cfloop list=&quot;#CFHTTP.FileContent#&quot; index=&quot;line&quot; delimiters=&quot;#chr(13)#&quot;&gt;
    &lt;cfset line = Trim( line )&gt;
    &lt;cfset StructInsert( Response, Trim( ListFirst( line, &quot;=&quot; ) ), Trim(Mid(line,Find(&quot;=&quot;,line)+1,len(line)) ) )&gt;
  &lt;/cfloop&gt;
  &lt;cfreturn Response&gt;
&lt;/cffunction&gt;
&lt;/cfcomponent&gt;

&lt;/code&gt;


Next I create a page called seek-auth.cfm this is the page you post all you form variables off to, its this page that does all the magic. 

&lt;code&gt;

&lt;!---check you cart session to see if its empty---&gt;
&lt;cfif structisempty(session[&apos;cartItem&apos;])&gt;
  &lt;cflocation addtoken=&quot;no&quot; url=&quot;fielderror.cfm?ErrorCode=003&quot; /&gt;
  &lt;cfabort&gt;
&lt;/cfif&gt;

&lt;!--- 
    &apos;****************************************************************************************
    &apos; validate all your form fields here
    &apos;**************************************************************************************** 
    ---&gt;




&lt;!--- 
    &apos;****************************************************************************************
    &apos; Protx Payment Gateway
    &apos;**************************************************************************************** 
    ---&gt;
&lt;!--- 
    &apos;****************************************************************************************
    &apos; Create cfc
    &apos;**************************************************************************************** 
    ---&gt;
&lt;cfscript&gt;
    cfcProtx = createobject(&quot;component&quot;, &quot;components.gateway-protx&quot;);
    gatewaysetup = cfcProtx.SetGateway();
&lt;/cfscript&gt;
&lt;!--- 
    &apos;****************************************************************************************
    &apos; Protx Create Transaction ID - 
	This needs to be a random so this is what i use but could be made more secure
    &apos;**************************************************************************************** 
    ---&gt;
&lt;cfif IsDefined(&quot;FORM.Amount&quot;) &gt;
  &lt;cfset VendorTxCode = &quot;#randrange(0,999999999)##randrange(0,999999999)#&quot;&gt;
&lt;/cfif&gt;
&lt;!--- 
    &apos;****************************************************************************************
    &apos; Setup new session to store any values we may need for post back etc
    &apos;**************************************************************************************** 
    ---&gt;
&lt;cfif IsDefined(&quot;FORM.Amount&quot;) &gt;
  &lt;cflock timeout=&quot;60&quot; type=&quot;exclusive&quot;&gt;
    &lt;cfset SESSION.protx = structNew()&gt;
    &lt;cfset SESSION.protx.TxCode = #VendorTxCode#&gt;
  &lt;/cflock&gt;
&lt;/cfif&gt;


    
&lt;!--- 
        &apos;****************************************************************************************
        &apos; HTTPS Request to Protx - Uses SETUP PAGE Vars, and Forms Vars
		&apos; PS these are all the form vars need to make a Protx Post
        &apos;**************************************************************************************** 
    ---&gt;
&lt;cfif IsDefined(&quot;FORM.Amount&quot;)&gt;&lt;!--- we only want this to run then we have a post from checkout---&gt;
  &lt;cfparam name=&quot;CustomerName&quot; default=&quot;#form.billname#&quot;&gt;
  &lt;cfparam name=&quot;BillingAddress&quot; default=&quot;#form.billaddress1# #form.billaddress1# #form.billaddress3# #form.billCountry#&quot;&gt;
  &lt;cfparam name=&quot;BillingPostCode&quot; default=&quot;#form.billPostCode#&quot;&gt;
  &lt;cfparam name=&quot;ContactNumber&quot; default=&quot;#form.billTel#&quot;&gt;
  &lt;cfparam name=&quot;ContactFax&quot; default=&quot;#form.billFax#&quot;&gt;
  &lt;cfparam name=&quot;CustomerEmail&quot; default=&quot;#form.email#&quot;&gt;

  &lt;cfset keyList = structkeylist(session[&apos;cartItem&apos;])&gt;
  &lt;cfset subtotal = 0 &gt;
  &lt;cfloop from=&quot;1&quot; to=&quot;#listlen(keyList)#&quot; index=&quot;y&quot;&gt;
    &lt;cfset currentListItemDsp = session[&apos;cartItem&apos;][listgetat(keyList,y)]&gt;
    &lt;cfset itemName = currentListItemDsp[&apos;aName&apos;]&gt;
    &lt;cfset itemQty = currentListItemDsp[&apos;aQty&apos;]&gt;
    &lt;cfset itemPrice = currentListItemDsp[&apos;aPrice&apos;]&gt;
    &lt;cfset totalOutput = itemPrice * itemQty&gt;
    &lt;cfset subtotal = subtotal + totalOutput&gt;

  &lt;/cfloop&gt;
  &lt;cfparam name=&quot;Basket&quot; default=&quot;&quot;&gt;
  &lt;cfparam name=&quot;DeliveryAddress&quot; default=&quot;#form.shipaddress1# #form.shipaddress1# #form.shipaddress3# #form.shipCountry#&quot;&gt;
  &lt;cfparam name=&quot;DeliveryPostCode&quot; default=&quot;#form.shipPostCode#&quot;&gt;
  &lt;cfset form.CardNumber=rereplace(form.CardNumber,&quot;([^[0-9]]*)&quot;,&quot;&quot;,&quot;all&quot;)&gt;
  &lt;cfparam name=&quot;CardNumber&quot; default=&quot;#form.CardNumber#&quot;&gt;
  &lt;cfparam name=&quot;CardHolder&quot; default=&quot;#form.CardHolder#&quot;&gt;
  &lt;cfparam name=&quot;Amount&quot; default=&quot;#form.Amount#&quot;&gt;
  &lt;cfparam name=&quot;StartDate&quot; default=&quot;#form.StartDate1##form.StartDate2#&quot;&gt;
  &lt;cfparam name=&quot;ExpiryDate&quot; default=&quot;#form.ExpiryDate1##form.ExpiryDate2#&quot;&gt;
  &lt;cfparam name=&quot;ClientIPAddress&quot; default=&quot;#CGI.REMOTE_HOST#&quot;&gt;
  &lt;cfparam name=&quot;CAVV&quot; default=&quot;&quot;&gt;
  &lt;cfparam name=&quot;XID&quot; default=&quot;&quot;&gt;
  &lt;cfparam name=&quot;ECI&quot; default=&quot;&quot;&gt;
  &lt;cfparam name=&quot;DSecureStatus&quot; default=&quot;&quot;&gt;
  &lt;cfparam name=&quot;CV2&quot; default=&quot;&quot;&gt;
  &lt;cfparam name=&quot;IssueNumber&quot; default=&quot;#form.issueNumber#&quot;&gt;
  
&lt;!--- 
        &apos;****************************************************************************************
        &apos; Any database store here
		&apos; If you need to store any info in your database do it here
		&apos; Its also a good idea to set a &apos;waiting for authentication&apos; in a file or db here
        &apos;**************************************************************************************** 
    ---&gt;
    
  

&lt;!---if statment ends here---&gt;
&lt;/cfif&gt;


    
    
&lt;!--- 
        &apos;****************************************************************************************
        &apos; 3D Secure - New responce to sort out with 3D Secure info in it. 
        &apos;**************************************************************************************** 
    ---&gt;
&lt;cfif isDefined(&apos;PARes&apos;)&gt;
  &lt;!---re check 3d post back---&gt;
  &lt;cfhttp url=&quot;#callbackURL#&quot; method=&quot;post&quot; delimiter=&quot;,&quot; resolveurl=&quot;no&quot; throwonerror=&quot;yes&quot; timeout=&quot;20&quot; charset=&quot;windows-1252&quot;&gt;
    &lt;cfhttpparam name=&quot;MD&quot; value=&quot;#FORM.MD#&quot; type=&quot;formfield&quot;&gt;
    &lt;cfhttpparam name=&quot;PARes&quot; value=&quot;#FORM.PARes#&quot; type=&quot;formfield&quot;&gt;
  &lt;/cfhttp&gt;
  &lt;cfset Response = StructNew()&gt;
  &lt;cfloop list=&quot;#CFHTTP.FileContent#&quot; index=&quot;line&quot; delimiters=&quot;#chr(13)#&quot;&gt;
    &lt;cfset line = Trim( line )&gt;
    &lt;cfset StructInsert( Response, Trim( ListFirst( line, &quot;=&quot; ) ), Trim(Mid(line,Find(&quot;=&quot;,line)+1,len(line)) ) )&gt;
  &lt;/cfloop&gt;
&lt;/cfif&gt;

&lt;!--- 
        &apos;****************************************************************************************
        &apos;  HTTPS Responce- Determine next action if we have a responce
        &apos;**************************************************************************************** 
    ---&gt;&lt;!---&lt;cfdump var=#response#&gt;&lt;cfabort&gt;---&gt;
&lt;cfif isdefined(&apos;Response&apos;)&gt;
  &lt;!---Payment OK and Charged---&gt;
  &lt;cfif #Response.Status# IS &quot;OK&quot; OR #Response.Status# IS &quot;ATTEMPTONLY&quot; &gt;
    &lt;!---update order db here---&gt;
   
     &lt;!---send user to the tank you page---&gt;
    &lt;cflocation addtoken=&quot;no&quot; url=&quot;thank-you.cfm?txcode=#SESSION.protx.TxCode#&quot;&gt;
  
   &lt;!---Card is on the 3D Secure System ---&gt;
    &lt;cfelseif #Response.Status# IS &quot;3DAUTH&quot;&gt;
    &lt;h1&gt;3D Secure Verification Needed, Loading please wait...&lt;/h1&gt;
    &lt;InvalidTag LANGUAGE=&quot;Javascript&quot;&gt;
        function OnLoadEvent() { document.form.submit(); }
    &lt;/SCRIPT&gt;
    &lt;body OnLoad=&quot;OnLoadEvent();&quot;&gt;
    &lt;cfoutput&gt;
      &lt;form name=&quot;form&quot; action=&quot;#Response.ACSURL#&quot; method=&quot;POST&quot;/&gt;
      &lt;input type=&quot;hidden&quot; name=&quot;PaReq&quot; value=&quot;#Response.PaReq#&quot;/&gt;
      &lt;input type=&quot;hidden&quot; name=&quot;TermUrl&quot; value=&quot;https://#CGI.HTTP_HOST#/seek-auth.cfm&quot;/&gt;
      &lt;input type=&quot;hidden&quot; name=&quot;MD&quot; value=&quot;#Response.MD#&quot;/&gt;
    &lt;/cfoutput&gt;
    &lt;NOSCRIPT&gt;
    &lt;center&gt;
      &lt;p&gt;Please click button below to Authenticate your card&lt;/p&gt;
      &lt;input type=&quot;submit&quot; value=&quot;Go&quot;/&gt;
      &lt;/p&gt;
    &lt;/center&gt;
    &lt;/NOSCRIPT&gt;
    &lt;/form&gt;
    &lt;/body&gt;
    &lt;!---The transaction returned failed!!!!!---&gt;
    &lt;cfelse&gt;
    &lt;cflock scope=&quot;session&quot; timeout=&quot;15&quot;&gt;
     &lt;cfset SESSION.protx.details = #Response.Status# &amp; &quot;&lt;br /&gt;&quot;&amp; #Response.StatusDetail# &gt;
    &lt;/cflock&gt; 
    
    &lt;!---Update database---&gt;	
   

    &lt;!---clean up vars ---&gt;
    
    &lt;cflocation addtoken=&quot;no&quot; url=&quot;auth-error.cfm&quot;&gt;
  &lt;/cfif&gt;
&lt;/cfif&gt;&lt;!---END of if responce is defined---&gt;

&lt;/code&gt;
				
				</description>
				
				
				<category>Sage Pay</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Mon, 29 Sep 2008 17:03:00 +0100</pubDate>
				<guid>http://www.cfcoffee.co.uk/index.cfm/2008/9/29/ColdFusion-and-Protx-VSP-Direct</guid>
				
				
			</item>
			
		 	
			</channel></rss>