<%@ Language=VBScript %> <% '************************************************************************* ' DO NOT MODIFY THIS SCRIPT IF YOU WANT UPDATES TO WORK! ' Function : Authorize.Net payment form ' Product : CandyPress Store Administration ' Version : 2.5 ' Modified : February 2004 ' Copyright: Copyright (C) 2004 CandyPress.Com ' 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 webmaster@candypress.com '************************************************************************* Option explicit Response.Buffer = true const adminLevel = 1 %> <% 'Work Fields dim mySQL, cn, rs dim authNetDemo dim returnURL 'cartHead dim idOrder dim idCust dim orderDate dim Total dim name dim lastName dim customerCompany dim phone dim email dim address dim city dim locState dim locCountry dim zip dim paymentType dim cardType dim cardNumber dim cardExpMonth dim cardExpYear dim cardVerify dim cardName dim orderStatus '************************************************************************* 'Open Database Connection call openDB() 'Store Configuration if loadConfig() = false then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Could not load Store Configuration settings.") end if 'Get idOrder idOrder = trim(Request.QueryString("recId")) if len(idOrder) = 0 then idOrder = trim(Request.Form("recId")) end if if idOrder = "" or not isNumeric(idOrder) then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Invalid Record ID.") end if 'Are we in demo mode? if demoMode = "Y" then authNetDemo = "TRUE" else authNetDemo = "FALSE" end if 'Determine return page URL returnURL = lcase(trim(request.servervariables("SERVER_NAME")) & trim(request.servervariables("SCRIPT_NAME"))) returnURL = replace(returnURL,"sa_authnet.asp","sa_authnet_exec.asp") if LCase(Request.ServerVariables("HTTPS")) = "on" then returnURL = "https://" & returnURL else returnURL = "http://" & returnURL end if %>

Authorize.Net Payment Form

<% 'Get cartHead Record mySQL = "SELECT idCust,orderDate,total,name,lastName,customerCompany," _ & " phone,email,address,city,locState,locCountry,zip," _ & " paymentType,cardType,cardNumber,cardExpMonth," _ & " cardExpYear,cardVerify,cardName,orderStatus " _ & "FROM cartHead " _ & "WHERE idOrder=" & idOrder set rs = openRSexecute(mySQL) if rs.eof then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Invalid Record ID.") else idCust = rs("idCust") orderDate = rs("orderDate") Total = rs("Total") Name = trim(rs("name")) LastName = trim(rs("LastName")) CustomerCompany = trim(rs("CustomerCompany")) Phone = trim(rs("Phone")) Email = trim(rs("Email")) Address = trim(rs("Address")) City = trim(rs("City")) locState = trim(rs("locState")) locCountry = trim(rs("locCountry")) Zip = trim(rs("Zip")) paymentType = trim(rs("paymentType")) cardType = trim(rs("cardType")) cardNumber = trim(EnDeCrypt(Hex2Ascii(rs("cardNumber")),rc4Key)) cardExpMonth = trim(rs("cardExpMonth")) cardExpYear = trim(rs("cardExpYear")) cardVerify = trim(rs("cardVerify")) cardName = trim(rs("cardName")) orderStatus = trim(rs("orderStatus")) end if call closeRS(rs) %> Authorize Payment  <%call maintNavLinks()%>

<%call InsertFP(authNetLogin,authNetTxKey,moneyD(total),idOrder,authNetCurrCode)%> "> "> <% if isEmpty(cardExpMonth) or isnull(cardExpMonth) then %> <% else %> <% end if %>
Authorize Payment
Order Number  <%=pOrderPrefix & "-" & idOrder%>
Order Date  <%=formatTheDate(orderDate)%>
Order Status  <%=orderStatusDesc(orderStatus)%>
Payment Type  <%=paymentType%>
Card Type  <%=cardType%>
Card Name  <%=cardName%>
Amount  <%=moneyD(total) & " (" & authNetCurrCode & ")"%>
Card Number 
CVV 
Card Expire   (MMYY)">  (MMYY)
First Name 
Last Name 
Address 
City 
Zip/PCode 
State/Province 
Country 
Company 
Phone 



Update Order Status to Paid
After authorizing the payment and viewing the response from the Authorize.Net you can update the order status to PAID if the payment was accepted and approved.

Email Customer.
Adjust Stock Levels.




Help and Instructions :
General - This function allows you to process credit card payments for an order using Authorize.Net. This is typically only necessary if the payment was not authorized and processed during the checkout process, as in the case of Offline payments. If you use Authorize.Net in your Storefront for payments then the payment would already have been authorized and processed during the checkout process.

Most of the fields are pre-entered for your convenience. Note that changing the information on this form only affects the information sent to Authorize.Net. The information on the order will remain unchanged. If you want to modify the fields on the order itself, you must use the "Edit Order" function.

Currency Code - If the currency code shown next to the amount is incorrect, then you will need to enter the correct code in your store's configurations. If you don't know what this value should be, contact Authorize.Net for more information.

Authorization Code - Upon successful authorization of the transaction, Authorize.Net will provide you with an Authorization Code and some other usefull information such as the Authorization Date etc. We advise you to copy this information into the "Private Comments" field (Click on "Edit Order") so that you don't have to refer to confirmation emails from Authorize.Net, or your Authorize.Net account, for this this information.

<% call closedb() %> <% '********************************************************************* 'Create Navigation Links '********************************************************************* sub maintNavLinks() %> [ List Orders | Edit | View | Delete ] <% end sub %>