<!--- Tag Parameters --->
<CFPARAM NAME="ATTRIBUTES.Processor" TYPE="string">
<CFPARAM NAME="ATTRIBUTES.OrderID" TYPE="numeric">
<CFPARAM NAME="ATTRIBUTES.OrderAmount" TYPE="numeric">
<CFPARAM NAME="ATTRIBUTES.CreditCard" TYPE="string">
<CFPARAM NAME="ATTRIBUTES.CreditExpM" TYPE="string">
<CFPARAM NAME="ATTRIBUTES.CreditExpY" TYPE="string">
<CFPARAM NAME="ATTRIBUTES.CreditName" TYPE="string">
<CFPARAM NAME="ATTRIBUTES.ReturnVariable" TYPE="variableName">


<!--- Depending on the PROCESSOR attribute --->
<CFSWITCH EXPRESSION="#ATTRIBUTES.Processor#">
  <!--- If PROCESSOR="CyberCash" --->
  <CFCASE VALUE="CyberCash">
    <!--- Force expiration into MM and YY format --->
    <CFSET ExpM  = NumberFormat(ATTRIBUTES.CreditExpM, "00")>
    <CFSET ExpY  = NumberFormat(Right(ATTRIBUTES.CreditExpM, 2), "00")>
  
    <!--- Attempt to process the transaction --->
    <CFX_CYBERCASH
      VERSION="3.2"
      CONFIGFILE="C:\mck-3.3.1-NT\test-mck\conf\merchant_conf"
      MO_ORDER_ID="8767767#ATTRIBUTES.OrderID#"
      MO_VERSION="3.3.1"
      MO_PRICE="USD #NumberFormat(ATTRIBUTES.OrderAmount, '9.00')#"
      CPI_CARD_NUMBER="#ATTRIBUTES.CreditCard#"
      CPI_CARD_EXP="#ExpM#/#ExpY#"
      CPI_CARD_NAME="#ATTRIBUTES.CreditName#"
      OUTPUTPOPQUERY="Charge">
   
    <!--- Values to return to calling template --->   
    <CFSET s = StructNew()>
    <!--- Always return IsSuccessful (Boolean) --->
    <CFSET s.IsSuccessful = Charge.STATUS EQ "success">
    <!--- Always return status of transaction --->
    <CFSET s.Status = Charge.STATUS>
    <!--- If Successful, return the Auth Code --->
    <CFIF s.IsSuccessful>
      <CFSET s.AuthCode     = Charge.AUTH_CODE>
      <CFSET s.OrderID      = ATTRIBUTES.ORDERID>
      <CFSET s.OrderAmount  = ATTRIBUTES.OrderAmount>
    <!--- If not successful, return the error --->  
    <CFELSE>
      <CFSET s.ErrorCode    = Charge.ERROR_CODE>
      <CFSET s.ErrorMessage = Charge.ERROR_MESSAGE>
    </CFIF>
    <!--- Return values to calling template --->
    <CFSET "Caller.#ATTRIBUTES.ReturnVariable#" = s>
  </CFCASE>
  
  <!--- If the PROCESSOR attribute is unknown --->
  <CFDEFAULTCASE>
    <CFTHROW MESSAGE="Unknown PROCESSOR attribute.">
  </CFDEFAULTCASE>
</CFSWITCH>
