New Protx (Sage Pay) VSP Direct URL's

If you are using my CFC for Protx VSP Direct Integration (now sage pay) you will need to change the live and testing URL's. SagePay told us that the old Live URL's would still work, however the way they are just forwarding in the system means they don't work correctly with CFHTTP calls. The replacement code with the new URL's is below.

view plain print about
1<cffunction name="SetGateway" access="public" hint="set which gateway is to be used, simulator, test or live" returntype="struct">
2 <!--- Set up local scope. --->
3 <cfset GatewaySettings = StructNew() />
4 <cfif #SimulatorSite# is "1" >
5 <cfscript>
6 StructInsert(GatewaySettings, "Verify", "false");
7 StructInsert(GatewaySettings, "PurchaseURL", "https://test.sagepay.com/Simulator/VSPDirectGateway.asp");
8
StructInsert(GatewaySettings, "
RefundURL", "https://test.sagepay.com/Simulator/VSPServerGateway.asp?Service=VendorRefundTx");
9
StructInsert(GatewaySettings, "ReleaseURL", "https://test.sagepay.com/Simulator/VSPServerGateway.asp?Service=VendorReleaseTx");
10
StructInsert(GatewaySettings, "
RepeatURL", "https://test.sagepay.com/Simulator/VSPServerGateway.asp?Service=VendorRepeatTx");
11
StructInsert(GatewaySettings, "callbackURL", "https://test.sagepay.com/Simulator/VSPDirectCallback.asp");
12
</cfscript>
13 </cfif>
14 <cfif #TestSite# is "
1">
15 <cfscript>

16 StructInsert(GatewaySettings, "
Verify", "false");
17 StructInsert(GatewaySettings, "
PurchaseURL", "https://test.sagepay.com/gateway/service/vspdirect-register.vsp");
18
StructInsert(GatewaySettings, "RefundURL", "https://test.sagepay.com/gateway/service/refund.vsp");
19
StructInsert(GatewaySettings, "
ReleaseURL", "https://test.sagepay.com/gateway/service/release.vsp");
20
StructInsert(GatewaySettings, "RepeatURL", "https://test.sagepay.com/gateway/service/repeat.vsp");
21
StructInsert(GatewaySettings, "
callbackURL", "https://test.sagepay.com/gateway/service/direct3dcallback.vsp");
22
</cfscript>
23 <!---https://ukvpstest.protx.com/showpost/showpost.asp--->
24 </cfif>
25 <cfif #LiveSite# is "1">
26 <cfscript>
27 StructInsert(GatewaySettings, "Verify", "false");
28 StructInsert(GatewaySettings, "PurchaseURL", "https://live.sagepay.com/gateway/service/vspdirect-register.vsp");
29
StructInsert(GatewaySettings, "
RefundURL", "https://live.sagepay.com/gateway/service/refund.vsp");
30
StructInsert(GatewaySettings, "ReleaseURL", "https://live.sagepay.com/gateway/service/release.vsp");
31
StructInsert(GatewaySettings, "
RepeatURL", "https://live.sagepay.com/gateway/service/repeat.vsp");
32
StructInsert(GatewaySettings, "callbackURL", "https://live.sagepay.com/gateway/service/direct3dcallback.vsp");
33
</cfscript>
34 </cfif>
35 <cfreturn GatewaySettings>
36</cffunction>

Related Blog Entries

TweetBacks
Comments
Joe_SagePay's Gravatar Hi,

If there is any assistance I can offer to you or your clients, please
let me know. I can be contacted through the Sage Pay forum
the link to which is available on the Sage Pay website.

Best wishes,

Joe
Sage Pay
# Posted By Joe_SagePay | 05/05/09 12:46
 

About Me

Glyn Jackson, 28 years old, MD and senior developer of a development firm based in Staffordshire called Newebia Ltd. Academic background in BSc Information System & Internet Commerce. Online marketing expert (EE Ranked) and .NET developer. Has been developing with ColdFusion for 5 years and loves it. "I am not a veteran in ColdFusion but I do work on challenging projects which help me learn more about ColdFusion and if I can contribute to the community in anyway then, it's all good!"

Recommends

  • ColdFusion