Current location: Hot Scripts Forums » Programming Languages » ASP.NET » Barclays ePDQ Integration


Barclays ePDQ Integration

Reply
  #11 (permalink)  
Old 06-22-11, 02:09 PM
pezza pezza is offline
Newbie Coder
 
Join Date: Feb 2010
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Pay Return (Thank You) page

Hi,

The code in the Thank You page is as follows:

Code:
<%@ Language=VBScript %>
<%
'*************************************************************************
' DO NOT MODIFY THIS SCRIPT IF YOU WANT UPDATES TO WORK!
' Function : Generic "Thank You" and "Error with Payment" page.
' Product  : CandyPress Store Frontend
' Version  : 4.1

' Modified : May 2007
' Copyright: Copyright (C) 2004 Webs Unlimited, Inc. 
'            See "license.txt" for this product for details regarding 
'            licensing, usage, disclaimers, distribution and general 
'            copyright requirements. If you don't have a copy of this 
'            file, you may request one at http://www.candypress.com
'*************************************************************************
'1. No database updates are performed in this script. 
'2. This script is called upon return from a payment processor.
'3. This script is very "forgiving" in that it only shows the "Error 
'   with Payment" message if explicitly told to do so by the payment 
'   processor. If some of the return values are missing but no error 
'   was reported by the payment processor, the customer will still 
'   see a "Thank You" message, but some of the links will not be 
'   displayed.
'*************************************************************************
'   Date					Description
' 10/23/05	Corrected code so that custom gateway would work
'
'*************************************************************************
Option explicit
Response.Buffer = true
%>
<!--#include file="_INCconfig_.asp"-->
<!--#include file="_INCappDBConn_.asp"-->
<!--#include file="_INCappFunctions_.asp"-->
<!--#include file="_INCupdStatus_.asp"-->
<!--#include file="_INCappEmail_.asp"-->
<%
'Work Fields
dim statusInd
dim qIdOrder
dim qTotal
dim orderStatus
dim payMessage
dim payMessageVar

'Database
dim mySQL
dim conntemp
dim rstemp
dim rstemp2

'Session
dim idOrder
dim idCust

'*************************************************************************

'Open Database Connection
call openDb()

'Store Configuration
if loadConfig() = false then
	call errorDB(LangText("ErrConfig",""),"")
end if


'-->  PayPal IPN
if len(qIdOrder) = 0 then

	'Get Order Number (PayPal Only)
	qIdOrder = trim(Request.Form("item_number"))
	if len(qIdOrder) = 0 then 
		qIdOrder = trim(validHTMl(Request.QueryString("item_number")))
	end if
	
	'Get Order Number
	if len(qIdOrder) = 0 then
		qIdOrder = trim(Request.QueryString("CP_idOrder"))
	end if
	
	'Get Status
	if len(qIdOrder) > 0 then
		statusInd = lCase(trim(validHTML(Request.QueryString("CP_Status"))))
	end if
	
end if

'--> 2Checkout Payments
if len(qIdOrder) = 0 then

	'Get Order Number
	qIdOrder = trim(Request.Form("cart_order_id"))
	
	'Get Status
	if len(qIdOrder) > 0 then
		statusInd = trim(Request.Form("credit_card_processed"))
		if UCase(statusInd) = "Y" then
			statusInd = "success"
		else
			statusInd = "error"
		end if
	end if
	
end if

'--> Authorize.Net SIM Payments
if len(qIdOrder) = 0 then

	'Get Order Number
	qIdOrder = trim(Request.Form("x_invoice_num"))
	
	'Get Status
	if len(qIdOrder) > 0 then
		statusInd = trim(Request.Form("x_response_code"))
		if UCase(statusInd) = "1" then
			statusInd = "success"
		else
			statusInd = "error"
		end if
	end if
	
end if

idCust = sessionCust()

'--> Custom Payments

if len(qIdOrder) = 0 then
	qIdOrder = trim(Request.Form("oid"))
end if


dim formattedDateTime
'Get a Date and Time formatted to the user's specifications
formattedDateTime = formatTheDate(currDateTime("DT",timeOffSet)) & " " & currDateTime("T",timeOffSet)



'--> Set to zero length string if still incorrect
if len(qIdOrder) = 0 or not(IsNumeric(qIdOrder)) then
	qIdOrder  = ""
	statusInd = ""
end if

'--> Retrieve Order Total
if len(qIdOrder) > 0 and IsNumeric(qIdOrder) then
	mySQL = "SELECT total,orderStatus " _
		&   "FROM   " & tablePrefix & "cartHead " _
		&	"WHERE  idOrder = " & validSQL(qIdOrder,"I") & " "
	set rsTemp = openRSexecute(mySQL)
	if not rstemp.eof then
		qTotal = rsTemp("total")
		orderStatus = rsTemp("orderStatus")
	end if
	call closeRS(rsTemp)
end if

%> 
<!--#include file="../UserMods/_INCtemplate_.asp"-->
<%

'Close Database Connection
call closeDB()


'**********************************************************************
'Main Shopping Cart Display Area
'**********************************************************************
sub cartMain()
%>
<!-- Outer Table Cell -->
<table border="0" cellpadding="0" cellspacing="0" width=450><tr><td>

<!-- Heading -->
<table border="0" cellpadding="2" cellspacing="0" width="100%">
	<tr><td nowrap valign=middle class="CPpageHead">
<%		if statusInd = "error" then %>
			<b><font color=red><%=LangText("GenPayErrorHdr","")%></font></b>
<%		else %>
			<b><%=LangText("GenPaySuccessHdr","")%></b>
<%		end if %>
	</td></tr>
</table><br>
<!-- Links -->
<table border="0" cellpadding="2" cellspacing="0" width="100%">
	<tr><td valign=middle class="CPgenHeadings">
<%
		'If Order Total is available, show it
		if len(qTotal) > 0 and IsNumeric(qTotal) then %>
			<b><%=LangText("GenTotal","")%> : <%=moneyS(Exchange(qTotal))%></b>&nbsp;&nbsp;&nbsp;&nbsp;
<%		end if

		'If Order Number is available, link to it
		if len(qIdOrder) > 0 and IsNumeric(qIdOrder) then %>
			&raquo;&nbsp;<b><a href="<%=urlSSL%>custViewOrders.asp?idOrder=<%=qIdOrder%>"><%=LangText("GenOrder","") & " " & pOrderPrefix & "-" & qIdOrder%></a></b>&nbsp;&nbsp;&nbsp;&nbsp;
<%		end if %>
		&raquo;&nbsp;<b><a href="<%=urlSSL%>custListOrders.asp"><%=LangText("GenYourAccount","")%></a></b>&nbsp;&nbsp;&nbsp;&nbsp;
	</td></tr>
</table><br>

<!-- Message -->
<table border="0" cellpadding="2" cellspacing="0" width="100%">
	<tr><td>
<%
		'Get appropriate payment message from database
		select case orderStatus
			case "0"
				payMessageVar = "payPendingMsg_"
			case "1"
				payMessageVar = "paySuccessMsg_"
		end select
		' if error get error message
		if LCase(statusInd) = "error" then payMessageVar = "payErrorMsg_"
		mySQL = "SELECT configValLong " _
			&   "FROM   " & tablePrefix & "storeAdmin " _
			&   "WHERE  configVar='" & payMessageVar & session("language") & "' " _
			&   "AND    adminType='T'"
		set rsTemp = openRSexecute(mySQL)
		if not rstemp.eof then
			payMessage = trim(rsTemp("configValLong"))
		end if
		call closeRS(rsTemp)
		'Check for tags and replace
		payMessage = replace(payMessage,"#STORE#",pCompany)
		payMessage = replace(payMessage,"#SALES#","<a href=""mailto:" & pEmailSales & """>" & pEmailSales & "</a>")
		payMessage = replace(payMessage,"#ERROR#","<a href=""50_paysubmit.asp"">" & trim(Request("RESPMSG")) & "</a>")
		'Display Message
		Response.Write payMessage
		session(storeID & "idOrder") = null
%>
	</td></tr>
</table>

<!-- End Outer Table Cell -->
</td></tr></table>
<br>
<%
end sub
%>
So at the moment, I have taken the #include out of the custom routine and replaced with code to collect the oid returned, but this still doesn't work. The page loads, and just shows a link to "My Account" which when clicked, takes me to all of my orders, BUT I believe that there should also be a section with links with the actual order itself and showing the status and order total. I do get a Thank You message, so parts seem to be working, but not the parts that is coming from the database results.

Is there any way within this code that I could possibly echo out values to see if there are indeed values in the variables? I tried a response.write but this just seems to write whatever i type including the response.write bit

Everything else is working, and emails are correctly being sent advising that the status has been changed to Paid, so I know that the response handler code is working and updating the database, i would just like to get the data and messages displayed on the Thank You page, just for that additional peace of mind, as I believe that it should do this.

Thanks

Andrew
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
any Jobsite script with vbulletin integration? Success General HotScripts Site Discussion 1 03-16-09 08:21 AM
Seeking script integration with vBulletin All4Data Job Offers & Assistance 2 11-21-07 09:52 AM
Barclays ePDQ - How does it work exactly? GO4TF4CE ASP 6 12-30-06 01:40 PM
Thanksgiving offer: TierDeveloper 25% off and get free .Net 2.0 Integration smars General Advertisements 0 11-18-05 04:31 AM
jps client integration superprogrammer Job Offers & Assistance 2 02-06-04 07:39 AM


All times are GMT -5. The time now is 02:42 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.