<%@ Language="VBScript" %> <% ' ***************************************************************************** ' ' info/custommerchant.order.info6.asp ' ' GoLive design-time support for CustomMerchant order forms. ' ' ' ADOBE SYSTEMS INCORPORATED ' Copyright 2001-2002 Adobe Systems Incorporated. All Rights Reserved. ' ' NOTICE: Notwithstanding the terms of the Adobe GoLive End User ' License Agreement, Adobe permits you to reproduce and distribute this ' file only as an integrated part of a web site created with Adobe ' GoLive software and only for the purpose of enabling your client to ' display their web site. All other terms of the Adobe license ' agreement remain in effect. ' ----------------------------------------------------------------------------- ' Return an XML document containing information about the CustomMerchant order ' form datasources available. Valid requests are: ' ' custommerchant.order.info6.asp?datasources= ' return a list of e-commerce cart providers ' ex) .../custommerchant.order.info6.asp?datasources=all ' ex) .../custommerchant.order.info6.asp?datasources=distinct ' ' custommerchant.order.info6.asp?provider= ' return the schema of an order form from a specific provider ' ex) .../custommerchant.order.info6.asp?provider=Adobe RejectUnauthorizedCallers Response.ContentType = "text/xml" if not RuntimeDebug then on error resume next end if if IsEmpty(Request("provider")) then WriteProviders(Request("datasources") = "all") elseif Not IsEmpty(Request("test")) then ' must come before WriteOrderFormSchema WriteTestOrderForm Request("provider") else WriteOrderFormSchema Request("provider") end if if Err then WriteError end if ' ----------------------------------------------------------------------------- ' Write out the list of available providers. XML format: ' ' ' [...]* function WriteProviders(all) dim fileSystem dim folder dim file dim baseName dim prevName set fileSystem = CreateObject("Scripting.FileSystemObject") set folder = fileSystem.GetFolder(GetDataSourcePath()) Response.Write "" & vbCrLf for each file in folder.files if ucase(fileSystem.GetExtensionName(file)) = "ECP" then baseName = fileSystem.GetBaseName(file) if all then Response.Write " " & baseName & ".ecp" & vbCrLf elseif baseName <> prevName then Response.Write " " & baseName & "" & vbCrLf prevName = baseName end if end if next Response.Write "" & vbCrLf end function ' ----------------------------------------------------------------------------- ' Write out the the schema of an order form. XML format: ' ' ' [ ' ... ' [...]? ' ]* function WriteOrderFormSchema(provider) set providerInfo = GetProviderInfo(provider) query = "action=get-order-schema&merchant-id=" & providerInfo.merchantId set dom = GetHTTPResults(providerInfo.url, query) Response.Write dom.documentElement.firstChild.xml end function ' ----------------------------------------------------------------------------- ' Write out a test order form. XML format: ' ' ' [ ' [columnvalue]* ' ]* function WriteTestOrderForm(provider) set xform = GetTransform() set providerInfo = GetProviderInfo(provider) query = "action=get-order-form&merchant-id=" & providerInfo.merchantId & "&shopper-id=test" set dom = GetHTTPResults(providerInfo.url, query) Response.Write dom.transformNode(xform) end function ' ----------------------------------------------------------------------------- ' Write out an error message as XML. function WriteError dim qt qt = chr(34) Response.Write "" & vbCrLf end function %>