AuthNetTools.cfc v 1.2
A suite of ColdFusion Component Methods allowing you to take advantage of Authorize.net's Payment Gateway, Customer Information Manager (CIM) and Automated Recurring Billing (ARB) features.
License    Purchase
Some notes about the program. Revisions
Version 1.1: Version 1.2:
Before You Begin...
The following settings must be configured within your authorize.net control center.
Loading AuthNetTools.cfc
Authorize.net Production Server
<cfset AuthNetTools = createObject("component", "AuthNetTools").init()>
Authorize.net Development Server
<cfset AuthNetTools = createObject("component", "AuthNetTools").init(true)>
Methods available in AuthNetTools.cfc
Payment Gateway Customer Information Manager (CIM) Automated Recurring Billing (ARB)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
gatewayTransaction()    [ top ]
Authorize, Capture, Refund, and Void Credit Card transactions through the payment gateway.
Returns a structure containing the following keys: If "error" is blank, the transaction was approved. Please refer to the "transaction response" fields for information about the transaction.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.gatewayTransaction(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The code below can be used as a starting point for all transactions. You may generate your variables as needed.
<cfset args.auth_type = variables.auth_type><!--- AUTH_ONLY, AUTH_CAPTURE, PRIOR_AUTH_CAPTURE, CREDIT, VOID, CAPTURE_ONLY. see addendum 3. --->
<cfset args.testrequest = variables.testrequest><!--- true (or 1) or false (or 0). --->
<cfset args.ipaddress = cgi.remote_addr><!--- don't change this. --->

<cfswitch expression="#args.auth_type#">
<cfcase value = "AUTH_ONLY,AUTH_CAPTURE">

<cfset args.description = variables.description><!--- description of sale/transaction. --->
<cfset args.amount = variables.amount><!--- amount of sale. --->
<cfset args.invoice = variables.invoice><!--- invoice or order number. --->
<cfset args.merchantCustomerId = variables.merchantCustomerId><!--- Merchant assigned customer ID. --->
<!--- billing fields. Some may not be required but all are recommended. --->
<cfset args.firstname = variables.firstname><!--- customer billing info. --->
<cfset args.lastname = variables.lastname><!--- customer billing info. --->
<cfset args.company = variables.company><!--- customer billing info. --->
<cfset args.address = variables.address><!--- customer billing info. --->
<cfset args.city = variables.city><!--- customer billing info. --->
<cfset args.state = variables.state><!--- customer billing info. --->
<cfset args.zip = variables.zip><!--- customer billing info. --->
<cfset args.phoneNumber = variables.phoneNumber><!--- customer billing info. --->
<cfset args.country = variables.country><!--- customer billing info. --->
<!--- pass credit card or eCheck information based on your logic. --->
 <CFIF variables.cardNumber is not "">
<cfset args.cardNumber = variables.cardNumber><!--- credit card number, all digits. --->
<cfset args.expirationDate = variables.expirationDate><!--- MMYY format. --->
<cfset args.cardcode = variables.cardcode><!--- card security code. --->
  <CFIF variables.allowPartialAuth is not ""><cfset args.allowPartialAuth = variables.allowPartialAuth></CFIF>
  <CFIF variables.splitTenderID is not ""><cfset args.splitTenderID = variables.splitTenderID></CFIF>
 <CFELSEIF variables.accountNumber is not "">
<cfset args.customertype = variables.customertype><!--- I (for individual), B (for business). --->
<cfset args.nameonaccount = variables.nameonaccount><!--- name on account. --->
<cfset args.accountNumber = variables.accountNumber><!--- bank account number. --->
<cfset args.accountType = variables.accountType><!--- checking, businessChecking, savings. --->
<cfset args.bankname = variables.bankname><!--- bank name. optional. --->
<cfset args.routingNumber = variables.routingNumber><!--- 9 digit bank routing number. --->
<cfset args.eCheckType = ""><!--- ARC,BOC,CCD,PPD,TEL,WEB (we default to WEB for internet transactions on personal accounts and CCD for internet transactions on business checking accounts). --->
<cfset args.dl_no = variables.dl_no><!--- driver's license for echecks. --->
<cfset args.dl_state = variables.dl_state><!--- driver's license state for echecks. --->
<cfset args.dl_dob = variables.dl_dob><!--- driver's license DOB. --->
<cfset args.ssn = variables.ssn><!--- social security number. --->
 </CFIF>
<!--- shipping fields below not required. --->
<cfset args.ship_lastname = variables.ship_lastname><!--- customer shipping info. --->
<cfset args.ship_firstname = variables.ship_firstname><!--- customer shipping info. --->
<cfset args.ship_company = variables.ship_company><!--- customer shipping info. --->
<cfset args.ship_address = variables.ship_address><!--- customer shipping info. --->
<cfset args.ship_city = variables.ship_city><!--- customer shipping info. --->
<cfset args.ship_state = variables.ship_state><!--- customer shipping info. --->
<cfset args.ship_zip = variables.ship_zip><!--- customer shipping info. --->
<cfset args.ship_country = variables.ship_country><!--- customer shipping info. --->

</cfcase>
<cfcase value = "PRIOR_AUTH_CAPTURE">

<cfset args.transactionid = variables.transactionid><!--- transaction id from original transaction. must be blank if using split tender id. --->
<cfset args.splitTenderID = variables.splitTenderID><!--- split tender id from partial transaction. must be blank if using transaction id. --->
<cfset args.amount = variables.amount><!--- amount to charge up to the original amount authorized. --->

</cfcase>
<cfcase value = "CREDIT">

<cfset args.transactionid = variables.transactionid><!--- transaction id from original transaction. --->
<cfset args.description = variables.description><!--- description of sale/transaction. --->
<cfset args.amount = variables.amount><!--- amount of refund. --->
<cfset args.invoice = variables.invoice><!--- invoice or order number. --->
 <CFIF variables.cardNumber is not "">
<cfset args.cardNumber = variables.cardNumber><!--- credit card number masked as XXXX4321. --->
 <CFELSEIF variables.accountNumber is not "">
<cfset args.accountNumber = variables.accountNumber><!--- bank account number masked as XXXX4321. --->
 </CFIF>

</cfcase>
<cfcase value = "VOID">

<cfset args.transactionid = variables.transactionid><!--- transaction id from original transaction. must be blank if using split tender id. --->
<cfset args.splitTenderID = variables.splitTenderID><!--- split tender id from partial transaction. must be blank if using transaction id. --->

</cfcase>
<cfcase value = "CAPTURE_ONLY">

<cfset args.approvalCode = variables.approvalCode><!--- approvalCode from original transaction at other gateway. --->

</cfcase>
</cfswitch>
Additional variables generally not required. Please see AIM_guide.pdf for more information.
<cfset args.EmailCustomer = variables.EmailCustomer><!--- Email the customer. Defaults to false. --->
<cfset args.currency_code = variables.currency_code><!--- defaults to "USD". --->
<cfset args.Merchant_Email = variables.Merchant_Email><!--- extra emails to send merchant emails to. --->
<cfset args.shipping = variables.shipping><!--- shipping amount. --->
<cfset args.taxes = variables.taxes><!--- sales tax amount. --->
<cfset args.MD5 = variables.MD5><!--- MD5 is entered in authorize.net control center. --->
<cfset args.taxExempt = variables.taxExempt><!--- customer tax exempt status. defaults to false. --->
<cfset args.recurring_billing = variables.recurring_billing><!--- has no effect I believe. defaults to false. --->
<cfset args.ECI = variables.ECI><!--- used for mastercard secure code and verified by visa. --->
<cfset args.CAVV = variables.CAVV><!--- used for mastercard secure code and verified by visa. --->
<cfset args.checkforduplicate = variables.checkforduplicate><!--- how long to check for a duplicate order. defaults to 120 seconds. --->
<cfset args.PO_Num = variables.PO_Num><!--- add a po number to order information. --->
System arguments set within the cfc's init method. Not required unless you need to change from the default.
<cfset args.ADC_Delim_Character = "|">
<cfset args.Encapsulate_Character = "#chr(34)#">
-- end gatewayTransaction()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
getCustomerProfileIds()    [ top ]
Gets a list of all Customer Profile IDs.
Returns a structure containing the following keys: If "error" is blank, the process was successful.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.getCustomerProfileIds(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
-- end getCustomerProfileIds()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
createCustomerProfile()    [ top ]
Creates a new CIM Customer Profile with a single Payment Profile (optional) and Shipping Profile (optional).
Returns a structure containing the following keys: If "error" is blank, the process was successful.
The additional keys below are returned from the validation step, which is performed only if you add a Customer Payment Profile. An error will be returned if the validation is declined and neither profile created.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.createCustomerProfile(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.merchantCustomerId = variables.merchantCustomerId><!--- the merchant assigned customer id. --->
<cfset args.customerdescription = variables.customerdescription><!--- description of this customer. 255 chars max. --->
<cfset args.email = variables.email><!--- customer email. 255 chars max. --->
The code below can be used to enter a Payment Profile while entering the Customer Profile.
<cfset args.testrequest = variables.testrequest><!--- true to validate in test mode. false to validate in live mode. --->
<cfset args.firstname = variables.firstname><!--- billing first name --->
<cfset args.lastname = variables.lastname><!--- billing last name --->
<cfset args.company = variables.company><!--- billing company --->
<cfset args.address = variables.address><!--- billing address --->
<cfset args.city = variables.city><!--- billing city --->
<cfset args.state = variables.state><!--- billing state --->
<cfset args.zip = variables.zip><!--- billing zip --->
<cfset args.country = variables.country><!--- billing country --->
<cfset args.phoneNumber = variables.phoneNumber><!--- billing phoneNumber (digits, - and () accepted) --->
 <CFIF variables.cardNumber is not "">
<cfset args.cardNumber = variables.cardNumber><!--- credit card number, all digits. --->
<cfset args.expirationDate = variables.expirationDate><!--- MMYY format. --->
<cfset args.cardCode = variables.cardCode><!--- card security code. --->
 <CFELSEIF variables.accountNumber is not "">
<cfset args.accountnumber = variables.accountnumber><!--- banking account number --->
<cfset args.accounttype = variables.accounttype><!--- checking, businessChecking, savings (case sensitive) --->
<cfset args.bankname = variables.bankname><!--- bank name --->
<cfset args.eCheckType = ""><!--- ARC,BOC,CCD,PPD,TEL,WEB (we default to WEB for internet transactions on personal accounts and CCD for internet transactions on business checking accounts). --->
<cfset args.nameonaccount = variables.nameonaccount><!--- name on account --->
<cfset args.routingnumber = variables.routingnumber><!--- 9 digit routing number. --->
 </CFIF>
The code below can be used to enter a Shipping Address while entering the Customer Profile.
<cfset args.ship_firstname = variables.ship_firstname><!--- shipping first name --->
<cfset args.ship_lastname = variables.ship_lastname><!--- shipping last name --->
<cfset args.ship_company = variables.ship_company><!--- shipping company --->
<cfset args.ship_address = variables.ship_address><!--- shipping address --->
<cfset args.ship_city = variables.ship_city><!--- shipping city --->
<cfset args.ship_state = variables.ship_state><!--- shipping state --->
<cfset args.ship_zip = variables.ship_zip><!--- shipping zip --->
<cfset args.ship_country = variables.ship_country><!--- shipping country --->
<cfset args.ship_phoneNumber = variables.ship_phoneNumber><!--- shipping phoneNumber (digits, - and () accepted) --->
Additional arguments not required.
<cfset args.customerType = variables.customerType><!--- "individual" or "business". omitted by default. --->
<cfset args.validate = variables.validate><!--- true (or 1) to validate, false (or 0) to skip the validation step. defaults to true if omitted. --->
<cfset args.faxNumber = variables.faxNumber><!--- billing fax number (digits, - and () accepted) --->
<cfset args.ship_faxNumber = variables.ship_faxNumber><!--- shipping fax number (digits, - and () accepted) --->
System arguments set within the cfc's init method. Not required unless you need to change from the default.
<cfset args.ADC_Delim_Character = "|">
<cfset args.Encapsulate_Character = "#chr(34)#">
<cfset args.useXmlFormat = "true|false"><!--- true or false, whether to xmlformat the input --->


-- end createCustomerProfile()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
updateCustomerProfile()    [ top ]
Updates a CIM Customer Profile.
Returns a structure containing the following keys: If "error" is blank, the process was successful.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.updateCustomerProfile(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.customerProfileId = variables.customerProfileId><!--- the customer's Profile Id. --->
<cfset args.merchantCustomerId = variables.merchantCustomerId><!--- the merchant assigned customer id. --->
<cfset args.customerdescription = variables.customerdescription><!--- description of this customer. 255 chars max. --->
<cfset args.email = variables.email><!--- customer email. 255 chars max. --->
System arguments set within the cfc's init method. Not required unless you need to change from the default.
<cfset args.useXmlFormat = "true|false"><!--- true or false, whether to xmlformat the input --->
-- end updateCustomerProfile()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
getCustomerProfile()    [ top ]
Gets a CIM Customer Profile.
Returns a structure containing the following keys: If "error" is blank, the process was successful.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.getCustomerProfile(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.customerProfileId = variables.customerProfileId><!--- the customer's Profile Id. --->
-- end getCustomerProfile()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
deleteCustomerProfile()    [ top ]
Updates a Customer Profile.
Returns a structure containing the following keys: If "error" is blank, the process was successful.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.deleteCustomerProfile(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.customerProfileId = variables.customerProfileId><!--- the customer's Profile Id. --->
-- end deleteCustomerProfile()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
createCustomerPaymentProfile()    [ top ]
Creates a new CIM Customer Payment Profile.
Returns a structure containing the following keys: If "error" is blank, the process was successful.
The additional keys below are returned from the validation step. Basically informational as as error will be returned if the validation is declined.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.createCustomerPaymentProfile(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.customerProfileId = variables.customerProfileId><!--- customer profile id --->
<cfset args.testrequest = variables.testrequest><!--- true to validate in test mode. false to validate in live mode. --->
<cfset args.firstname = variables.firstname><!--- billing first name --->
<cfset args.lastname = variables.lastname><!--- billing last name --->
<cfset args.company = variables.company><!--- billing company --->
<cfset args.address = variables.address><!--- billing address --->
<cfset args.city = variables.city><!--- billing city --->
<cfset args.state = variables.state><!--- billing state --->
<cfset args.zip = variables.zip><!--- billing zip --->
<cfset args.country = variables.country><!--- billing country --->
<cfset args.phoneNumber = variables.phoneNumber><!--- billing phoneNumber (digits, - and () accepted) --->
 <CFIF variables.cardNumber is not "">
<cfset args.cardNumber = variables.cardNumber><!--- credit card number, all digits. --->
<cfset args.expirationDate = variables.expirationDate><!--- MMYY format. --->
<cfset args.cardCode = variables.cardCode><!--- card security code. --->
 <CFELSEIF variables.accountNumber is not "">
<cfset args.accountnumber = variables.accountnumber><!--- banking account number --->
<cfset args.accounttype = variables.accounttype><!--- checking, businessChecking, savings (case sensitive) --->
<cfset args.bankname = variables.bankname><!--- bank name --->
<cfset args.eCheckType = ""><!--- ARC,BOC,CCD,PPD,TEL,WEB (we default to WEB for internet transactions on personal accounts and CCD for internet transactions on business checking accounts). --->
<cfset args.nameonaccount = variables.nameonaccount><!--- name on account --->
<cfset args.routingnumber = variables.routingnumber><!--- 9 digit routing number. --->
 </CFIF>
Additional arguments not required.
<cfset args.customerType = variables.customerType><!--- "individual" or "business". omitted by default. --->
<cfset args.validate = variables.validate><!--- true (or 1) to validate, false (or 0) to skip the validation step. defaults to true if omitted. --->
<cfset args.faxNumber = variables.faxNumber><!--- billing fax number --->
System arguments set within the cfc's init method. Not required unless you need to change from the default.
<cfset args.ADC_Delim_Character = "|">
<cfset args.Encapsulate_Character = "#chr(34)#">
<cfset args.useXmlFormat = "true|false"><!--- true or false, whether to xmlformat the input --->
-- end createCustomerPaymentProfile()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
updateCustomerPaymentProfile()    [ top ]
Updates CIM Customer Payment Profile.
Identical to createCustomerPaymentProfile, except that the customerPaymentProfileId is required.
Notes
Returns a structure containing the following keys: If "error" is blank, the process was successful.
The additional keys below are returned from the validation step. Basically informational as an error will be returned if the validation is declined.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.updateCustomerPaymentProfile(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.customerProfileId = variables.customerProfileId><!--- customer profile id --->
<cfset args.customerPaymentProfileId = variables.customerPaymentProfileId><!--- this Payment Profile Id. --->
<cfset args.testrequest = variables.testrequest><!--- true to validate in test mode. false to validate in live mode. --->
<cfset args.firstname = variables.firstname><!--- billing first name --->
<cfset args.lastname = variables.lastname><!--- billing last name --->
<cfset args.company = variables.company><!--- billing company --->
<cfset args.address = variables.address><!--- billing address --->
<cfset args.city = variables.city><!--- billing city --->
<cfset args.state = variables.state><!--- billing state --->
<cfset args.zip = variables.zip><!--- billing zip --->
<cfset args.country = variables.country><!--- billing country --->
<cfset args.phoneNumber = variables.phoneNumber><!--- billing phoneNumber (digits, - and () accepted) --->
 <CFIF variables.cardNumber is not "">
<cfset args.cardNumber = variables.cardNumber><!--- credit card number, all digits. --->
<cfset args.expirationDate = variables.expirationDate><!--- MMYY format. --->
<cfset args.cardCode = variables.cardCode><!--- card security code. --->
 <CFELSEIF variables.accountNumber is not "">
<cfset args.accountnumber = variables.accountnumber><!--- banking account number --->
<cfset args.accounttype = variables.accounttype><!--- checking, businessChecking, savings (case sensitive) --->
<cfset args.bankname = variables.bankname><!--- bank name --->
<cfset args.eCheckType = ""><!--- ARC,BOC,CCD,PPD,TEL,WEB (we default to WEB for internet transactions on personal accounts and CCD for internet transactions on business checking accounts). --->
<cfset args.nameonaccount = variables.nameonaccount><!--- name on account --->
<cfset args.routingnumber = variables.routingnumber><!--- 9 digit routing number. --->
 </CFIF>
Additional arguments not required.
<cfset args.customerType = variables.customerType><!--- "individual" or "business". omitted by default. --->
<cfset args.validate = variables.validate><!--- true (or 1) to validate, false (or 0) to skip the validation step. defaults to true if omitted. --->
<cfset args.faxNumber = variables.faxNumber><!--- billing fax number --->
System arguments set within the cfc's init method. Not required unless you need to change from the default.
<cfset args.ADC_Delim_Character = "|">
<cfset args.Encapsulate_Character = "#chr(34)#">
<cfset args.useXmlFormat = "true|false"><!--- true or false, whether to xmlformat the input --->
-- end updateCustomerPaymentProfile()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
getCustomerPaymentProfile()    [ top ]
Gets a CIM Customer Payment Profile.
Returns a structure containing the following keys: If "error" is blank, the process was successful.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.getCustomerPaymentProfile(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.customerProfileId = variables.customerProfileId><!--- the customer's Profile Id. --->
<cfset args.customerPaymentProfileId = variables.customerPaymentProfileId><!--- this payment Profile Id. --->
-- end getCustomerPaymentProfile()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
deleteCustomerPaymentProfile()    [ top ]
Deletes a CIM Customer Payment Profile.
Returns a structure containing the following keys: If "error" is blank, the process was successful.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.deleteCustomerPaymentProfile(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.customerProfileId = variables.customerProfileId><!--- the customer's Profile Id. --->
<cfset args.customerPaymentProfileId = variables.customerPaymentProfileId><!--- payment Profile Id to delete. --->
-- end deleteCustomerPaymentProfile()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
validateCustomerPaymentProfile()    [ top ]
Validates CIM Customer Payment Profile.
Returns a structure containing the following keys: If "error" is blank, the process was successful.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.validateCustomerPaymentProfile(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.customerProfileId = variables.customerProfileId><!--- customer profile id --->
<cfset args.customerPaymentProfileId = variables.customerPaymentProfileId><!--- this Payment Profile Id. --->
<cfset args.testrequest = variables.testrequest><!--- true to validate in test mode. false to validate in live mode. --->
Additional arguments not required.
<cfset args.cardCode = variables.cardCode><!--- card security code. we don't know why this would be available here, but it is. --->
System arguments set within the cfc's init method. Not required unless you need to change from the default.
<cfset args.ADC_Delim_Character = "|">
<cfset args.Encapsulate_Character = "#chr(34)#">
-- end validateCustomerPaymentProfile()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
createCustomerShippingAddress()    [ top ]
Creates a new CIM Customer Shipping Address.
Returns a structure containing the following keys: If "error" is blank, the process was successful.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.createCustomerShippingAddress(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.customerProfileId = variables.customerProfileId><!--- customer profile id --->
<cfset args.ship_firstname = variables.ship_firstname><!--- shipping first name --->
<cfset args.ship_lastname = variables.ship_lastname><!--- shipping last name --->
<cfset args.ship_company = variables.ship_company><!--- shipping company --->
<cfset args.ship_address = variables.ship_address><!--- shipping address --->
<cfset args.ship_city = variables.ship_city><!--- shipping city --->
<cfset args.ship_state = variables.ship_state><!--- shipping state --->
<cfset args.ship_zip = variables.ship_zip><!--- shipping zip --->
<cfset args.ship_country = variables.ship_country><!--- shipping country --->
<cfset args.ship_phoneNumber = variables.ship_phoneNumber><!--- shipping phoneNumber (digits, - and () accepted) --->
Additional arguments not required.
<cfset args.ship_faxNumber = variables.ship_faxNumber><!--- shipping fax number (digits, - and () accepted) --->
System arguments set within the cfc's init method. Not required unless you need to change from the default.
<cfset args.useXmlFormat = "true|false"><!--- true or false, whether to xmlformat the input --->
-- end createCustomerShippingAddress()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
updateCustomerShippingAddress()    [ top ]
Updates a CIM Customer Shipping Address.
Identical to createCustomerShippingAddress, except that the customerAddressID is required.
Returns a structure containing the following keys: If "error" is blank, the process was successful.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.updateCustomerShippingAddress(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.customerProfileId = variables.customerProfileId><!--- customer profile id --->
<cfset args.customerAddressId = variables.customerAddressId><!--- Shipping Address Id to update. --->
<cfset args.ship_firstname = variables.ship_firstname><!--- shipping first name --->
<cfset args.ship_lastname = variables.ship_lastname><!--- shipping last name --->
<cfset args.ship_company = variables.ship_company><!--- shipping company --->
<cfset args.ship_address = variables.ship_address><!--- shipping address --->
<cfset args.ship_city = variables.ship_city><!--- shipping city --->
<cfset args.ship_state = variables.ship_state><!--- shipping state --->
<cfset args.ship_zip = variables.ship_zip><!--- shipping zip --->
<cfset args.ship_country = variables.ship_country><!--- shipping country --->
<cfset args.ship_phoneNumber = variables.ship_phoneNumber><!--- shipping phoneNumber (digits, - and () accepted) --->
Additional arguments not required.
<cfset args.ship_faxNumber = variables.ship_faxNumber><!--- shipping fax number (digits, - and () accepted) --->
System arguments set within the cfc's init method. Not required unless you need to change from the default.
<cfset args.useXmlFormat = "true|false"><!--- true or false, whether to xmlformat the input --->
-- end updateCustomerShippingAddress()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
getCustomerShippingAddress()    [ top ]
Gets a CIM Shipping Address.
Returns a structure containing the following keys: If "error" is blank, the process was successful.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.getCustomerShippingAddress(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.customerProfileId = variables.customerProfileId><!--- the customer's Profile Id. --->
<cfset args.customerAddressID = variables.customerAddressID><!--- this shipping address Id. --->
-- end getCustomerShippingAddress()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
deleteCustomerShippingAddress()    [ top ]
Deletes a CIM Shipping Address.
Returns a structure containing the following keys: If "error" is blank, the process was successful.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.deleteCustomerShippingAddress(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.customerProfileId = variables.customerProfileId><!--- the customer's Profile Id. --->
<cfset args.customerAddressID = variables.customerAddressID><!--- shipping address Id to delete. --->
-- end deleteCustomerShippingAddress()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
createCustomerProfileTransaction()    [ top ]
Charges or refunds against a CIM Customer Payment Profile.
This will return a response like a gateway transaction. Please configure Direct Response settings according to the instruction at top of page.
Returns a structure containing the following keys: If "error" is blank, the process was successful.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.createCustomerProfileTransaction(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.customerProfileId = variables.customerProfileId><!--- customer profile id --->
<cfset args.customerPaymentProfileId = variables.customerPaymentProfileId><!--- Payment Profile Id. Must match original for capture, void, refund, etc. --->
<cfset args.testrequest = variables.testrequest><!--- true to process in test mode. false to process in live mode. --->
<cfset args.ipaddress = cgi.remote_addr><!--- don't change this. --->

<cfset args.auth_type = variables.auth_type><!--- AUTH_ONLY, AUTH_CAPTURE, PRIOR_AUTH_CAPTURE, CREDIT, VOID, CAPTURE_ONLY. see addendum 3. --->

<cfswitch expression="#args.auth_type#">
<cfcase value = "AUTH_ONLY">

<cfset args.amount = variables.amount><!--- amount of sale. --->
<cfset args.description = variables.description><!--- description of sale/transaction. --->
<cfset args.invoice = variables.invoice><!--- invoice or order number. --->


</cfcase>
<cfcase value = "AUTH_CAPTURE">

<cfset args.amount = variables.amount><!--- amount of sale. --->
<cfset args.description = variables.description><!--- description of sale/transaction. --->
<cfset args.invoice = variables.invoice><!--- invoice or order number. --->


</cfcase>
<cfcase value = "PRIOR_AUTH_CAPTURE">

<cfset args.amount = variables.amount><!--- amount to charge up to the original amount authorized. --->
<cfset args.transactionid = variables.transactionid><!--- transaction id from original transaction. --->

</cfcase>
<cfcase value = "CREDIT">

<cfset args.transactionid = variables.transactionid><!--- transaction id from original transaction. --->
<cfset args.amount = variables.amount><!--- amount of refund. --->
<cfset args.description = variables.description><!--- description of sale/transaction. --->
<cfset args.invoice = variables.invoice><!--- invoice or order number. --->

</cfcase>
<cfcase value = "VOID">

<cfset args.transactionid = variables.transactionid><!--- transaction id from original transaction. --->

</cfcase>
<cfcase value = "CAPTURE_ONLY">

<cfset args.approvalCode = variables.approvalCode><!--- approvalCode from original transaction at other gateway. --->

</cfcase>
</cfswitch>
Additional arguments not required.
<cfset args.cardCode = variables.cardCode><!--- card security code. again, I'm not sure why this is available here, but it is. --->
<cfset args.taxExempt = variables.taxExempt><!--- customer tax exempt status. defaults to false. --->
<cfset args.recurring_billing = variables.recurring_billing><!--- has no effect I believe. defaults to false. --->
<!--- shipping address below not required, but must match original transaction if used on subsequent capture, void, credit. --->
<cfset args.customerAddressId = variables.customerAddressId><!--- shipping address Id. --->
<cfset args.Merchant_Email = variables.Merchant_Email><!--- extra emails to send merchant emails to. --->
<cfset args.PO_Num = variables.PO_Num><!--- add a po number to order information. --->
System arguments set within the cfc's init method. Not required unless you need to change from the default.
<cfset args.ADC_Delim_Character = "|">
<cfset args.Encapsulate_Character = "#chr(34)#">
<cfset args.useXmlFormat = "true|false"><!--- true or false, whether to xmlformat the input --->
-- end createCustomerProfileTransaction()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ARBCreateSubscription()    [ top ]
Creates a new ARB Recurring Payment Subscription.
Returns a structure containing the following keys: If "error" is blank, the process was successful.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.ARBCreateSubscription(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.merchantCustomerId = variables.merchantCustomerId><!--- the merchant assigned customer id. --->
<cfset args.email = variables.email><!--- customer email. 255 chars max. --->
<cfset args.firstname = variables.firstname><!--- billing first name --->
<cfset args.lastname = variables.lastname><!--- billing last name --->
<cfset args.company = variables.company><!--- billing company --->
<cfset args.address = variables.address><!--- billing address --->
<cfset args.city = variables.city><!--- billing city --->
<cfset args.state = variables.state><!--- billing state --->
<cfset args.zip = variables.zip><!--- billing zip --->
<cfset args.country = variables.country><!--- billing country --->
<cfset args.phoneNumber = variables.phoneNumber><!--- billing phoneNumber (digits, - and () accepted) --->
<cfset args.faxNumber = variables.faxNumber><!--- billing faxNumber (digits, - and () accepted) --->
 <CFIF variables.cardNumber is not "">
<cfset args.cardNumber = variables.cardNumber><!--- credit card number, all digits. --->
<cfset args.expirationDate = variables.expirationDate><!--- MMYY format. --->
<cfset args.cardCode = variables.cardCode><!--- card security code. --->
 <CFELSEIF variables.accountNumber is not "">
<cfset args.accountnumber = variables.accountnumber><!--- banking account number --->
<cfset args.accounttype = variables.accounttype><!--- checking, businessChecking, savings (case sensitive) --->
<cfset args.bankname = variables.bankname><!--- bank name --->
<cfset args.eCheckType = ""><!--- ARC,BOC,CCD,PPD,TEL,WEB (we default to WEB for internet transactions on personal accounts and CCD for internet transactions on business checking accounts). --->
<cfset args.nameonaccount = variables.nameonaccount><!--- name on account --->
<cfset args.routingnumber = variables.routingnumber><!--- 9 digit routing number. --->
 </CFIF>
Theses are the subscription options.
<cfset args.subscriptionName = variables.subscriptionName><!--- name of the subscription offer. --->
<cfset args.invoice = variables.invoice><!--- invoice or order number to be associated with each payment. --->
<cfset args.description = variables.description><!--- description to be associated with each payment. --->
<cfset args.unit = variables.unit><!--- days, months - schedule payment every [length] [unit] --->
<cfset args.length = variables.length><!--- 7-365 (if unit="days"), 1-12 if unit="months". --->
<cfset args.startDate = variables.startdate><!--- starting date --->
<cfset args.totalOccurrences = variables.totaloccurrences><!--- total number of occurrences, including trials. 9999 = ongoing until cancelled --->
<cfset args.amount = variables.amount><!--- amount of each payment --->
<cfset args.trialOccurrences = variables.trialOccurrences><!--- number of trial occurrences for free or reduced price --->
<cfset args.trialAmount = variables.trialAmount><!--- amount of each trial occurrence, or 0.00. --->
The code below can be used to enter a Shipping Address.
<cfset args.ship_firstname = variables.ship_firstname><!--- shipping first name --->
<cfset args.ship_lastname = variables.ship_lastname><!--- shipping last name --->
<cfset args.ship_company = variables.ship_company><!--- shipping company --->
<cfset args.ship_address = variables.ship_address><!--- shipping address --->
<cfset args.ship_city = variables.ship_city><!--- shipping city --->
<cfset args.ship_state = variables.ship_state><!--- shipping state --->
<cfset args.ship_zip = variables.ship_zip><!--- shipping zip --->
<cfset args.ship_country = variables.ship_country><!--- shipping country --->
System arguments set within the cfc's init method. Not required unless you need to change from the default.
<cfset args.useXmlFormat = "true|false"><!--- true or false, whether to xmlformat the input --->
-- end ARBCreateSubscription()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ARBUpdateSubscription()    [ top ]
Updates an ARB Recurring Payment Subscription.
Important notes:
Returns a structure containing the following keys: If "error" is blank, the process was successful.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.ARBUpdateSubscription(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.subscriptionId = variables.subscriptionid><!--- the subscription id. --->
These are the customer fields. You may change any of these individually.
<cfset args.merchantCustomerId = variables.merchantCustomerId><!--- the merchant assigned customer id. --->
<cfset args.email = variables.email><!--- customer email. 255 chars max. --->
<cfset args.phoneNumber = variables.phoneNumber><!--- customer phone Number (digits, - and () accepted) --->
<cfset args.fax = variables.fax><!--- customer fax Number (digits, - and () accepted) --->
These are the billing fields. They may be changed individually.
<cfset args.firstname = variables.firstname><!--- billing first name --->
<cfset args.lastname = variables.lastname><!--- billing last name --->
<cfset args.company = variables.company><!--- billing company --->
<cfset args.address = variables.address><!--- billing address --->
<cfset args.city = variables.city><!--- billing city --->
<cfset args.state = variables.state><!--- billing state --->
<cfset args.zip = variables.zip><!--- billing zip --->
<cfset args.country = variables.country><!--- billing country --->
These are the payment options. They are not needed to update length of subscription, amount, etc.
 <CFIF variables.cardNumber is not "">
<cfset args.cardNumber = variables.cardNumber><!--- credit card number, all digits. --->
<cfset args.expirationDate = variables.expirationDate><!--- MMYY format. --->
<cfset args.cardCode = variables.cardCode><!--- card security code. --->
 <CFELSEIF variables.accountNumber is not "">
<cfset args.accountnumber = variables.accountnumber><!--- banking account number --->
<cfset args.accounttype = variables.accounttype><!--- checking, businessChecking, savings (case sensitive) --->
<cfset args.bankname = variables.bankname><!--- bank name --->
<cfset args.eCheckType = ""><!--- ARC,BOC,CCD,PPD,TEL,WEB (we default to WEB for internet transactions on personal accounts and CCD for internet transactions on business checking accounts). --->
<cfset args.nameonaccount = variables.nameonaccount><!--- name on account --->
<cfset args.routingnumber = variables.routingnumber><!--- 9 digit routing number. --->
 </CFIF>
These are the subscription options. They may be changed individually.
<cfset args.subscriptionName = variables.subscriptionName><!--- name of the subscription offer. --->
<cfset args.invoice = variables.invoice><!--- invoice or order number to be associated with each payment. --->
<cfset args.description = variables.description><!--- description to be associated with each payment. --->
<cfset args.startDate = variables.startdate><!--- starting date --->
<cfset args.totalOccurrences = variables.totaloccurrences><!--- total number of occurrences, including trials. 9999 = ongoing until cancelled --->
<cfset args.amount = variables.amount><!--- amount of each payment --->
<cfset args.trialOccurrences = variables.trialOccurrences><!--- number of trial occurrences for free or reduced price --->
<cfset args.trialAmount = variables.trialAmount><!--- amount of each trial occurrence, or 0.00. --->
These are the shipping address fields. They may be changed individually.
<cfset args.ship_firstname = variables.ship_firstname><!--- shipping first name --->
<cfset args.ship_lastname = variables.ship_lastname><!--- shipping last name --->
<cfset args.ship_company = variables.ship_company><!--- shipping company --->
<cfset args.ship_address = variables.ship_address><!--- shipping address --->
<cfset args.ship_city = variables.ship_city><!--- shipping city --->
<cfset args.ship_state = variables.ship_state><!--- shipping state --->
<cfset args.ship_zip = variables.ship_zip><!--- shipping zip --->
<cfset args.ship_country = variables.ship_country><!--- shipping country --->
System arguments set within the cfc's init method. Not required unless you need to change from the default.
<cfset args.useXmlFormat = "true|false"><!--- true or false, whether to xmlformat the input --->
-- end ARBUpdateSubscription()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ARBCancelSubscription()    [ top ]
Deletes an ARB Recurring Payment Subscription.
Returns a structure containing the following keys: If "error" is blank, the process was successful.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.ARBCancelSubscription(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.subscriptionId = variables.subscriptionid><!--- the subscription id. --->
-- end ARBCancelSubscription()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ARBGetSubscriptionStatus()    [ top ]
Gets the status of an existing ARB Recurring Payment Subscription.
Returns a structure containing the following keys: If "error" is blank, the process was successful.
Usage example:
<CFSET args = StructNew()>
Paste "args" structure keys here - see Arguments below

<cfset myVar = AuthNetTools.ARBGetSubscriptionStatus(argumentCollection=args)>

<CFIF myVar.error is "">
 Success. Save records to database, etc.
<CFELSE>
 Error: #myVar.error#
 Hopefully this won't be seen in production.
</CFIF>
Arguments:
An example of the minimal arguments required is shown here. You may copy and paste the code examples below then change the values of the cfset tags to work with your application. Do not change the argument names (args structure). You may change conditional statements (CFIF), if any, to suit your application.
Authorization arguments. May be entered manually within AuthNetTools.cfc. Authorize.net suggests storing these values in separate physical locations for security, ie; login in a database and transactionkey in a text file.
<cfset args.login = variables.login><!--- merchant login. --->
<cfset args.transactionkey = variables.transactionkey><!--- merchant transaction key. --->
Arguments to add if you want to email error messages.
<cfset args.error_email_from = variables.error_email_from><!--- email address to send error messages from. leave blank or omit this to not send errors. --->
<cfset args.error_email_to = variables.error_email_to><!--- email address to send error messages. leave blank or omit this to not send errors. --->
<cfset args.error_subject = variables.error_subject><!--- subject of error message. defaults to "AuthNetTools.cfc Error" if omitted. --->
<cfset args.error_smtp = variables.error_smtp><!--- mail server if you need to use one to send emails. --->
The arguments below are typical for all transactions.
<cfset args.refId = variables.refId><!--- echoes in the response. not required. 20 chars max. --->
<cfset args.subscriptionId = variables.subscriptionid><!--- the subscription id. --->
-- end ARBGetSubscriptionStatus()    [ top ]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Addendums:
1) AVS Response Codes:
A = Street Address: Match -- First 5 Digits of ZIP: No Match This response code signifies a perfect match between the street address entered by the customer and the billing address on file with the credit card issuing bank but a mismatch between ZIP codes.
B = Address not provided for AVS check or street address match, postal code could not be verified This response code signifies that the transaction was submitted to Authorize.Net without address information so the AVS check could not be performed.
E = AVS Error This response code signifies that an error occurred on the processing network while processing the AVS request so AVS information is not available for this transaction.
G = Non U.S. Card Issuing Bank The credit card-issuing bank is not of U.S. origin and does not support the AVS system.
N = Street Address: No Match -- First 5 Digits of ZIP: No Match Neither the street address nor the ZIP code provided by the customer matches the billing address and ZIP code on file with the card issuing bank.
P = AVS not applicable for this transaction This response code is returned when address information is not checked against the AVS system. Examples of this would be eCheck.Net transactions, credits, voids, prior auth capture transactions, capture only transactions, declines and other transactions that do not include address checking.
R = Retry, System Is Unavailable AVS was unavailable on the processing network or the processor did not respond.
S = AVS Not Supported by Card Issuing Bank The card issuing bank does not support AVS.
U = Address Information For This Cardholder Is Unavailable Address information is not available for the customers credit card at the processor
W = Street Address: No Match -- All 9 Digits of ZIP: Match The nine-digit ZIP code provided matches the billing ZIP code on file with the card-issuing bank, but the street address provided does not match.
X = Street Address: Match -- All 9 Digits of ZIP: Match The nine-digit ZIP code and street address provided matches the billing ZIP code and street address on file with the card issuing bank.
Y = Street Address: Match - First 5 Digits of ZIP: Match The five-digit ZIP code and street address provided matches the billing ZIP code and street address on file with the card-issuing bank.
Z = Street Address: No Match - First 5 Digits of ZIP: Match The five-digit ZIP code provided matches the billing ZIP code on file with the card issuing bank, but the street address provided does not match.
2) Card Code (CVV2/CVC2/CID) Response Codes:
M = Match
N = No Match
P = Not Processed
S = Should have been present
U = Issuer unable to process request
3) Authorization Types:
AUTH_ONLY = Authorize now, charge later. Capture transaction id for later PRIOR_AUTH_CAPTURE, CREDIT or VOID, or process manually through Virtual Terminal.
AUTH_CAPTURE = Authorize and charge now. Capture transaction id for later CREDIT or VOID, or process manually through Virtual Terminal.
PRIOR_AUTH_CAPTURE = Charge a previous AUTH_ONLY.
CREDIT = Refund a previous charge.
VOID = Void a transaction before it batches.
CAPTURE_ONLY = Charge a transaction placed through a different gateway.