CreditLine COM Integration

From Payment Processing Software Library
Revision as of 16:05, 16 February 2009 by Admin (Talk | contribs)

Jump to: navigation, search
This article is part of the
Payment Processing Software Library

Categories

Get it...

Credit Card Software
Download

Install it...

Installation
Upgrade & Migration

Connect to it...

Point Of Sale Integration

Set it up...

Quick Start Guide
Setup
Processor Setup

Licensing

Learn to use it...

Manual & User Guide
Knowledge Base
Frequently Asked Questions
Compliance Guide
Merchant Account Rates
User Interface Guides

Fix it...

Errors & Troubleshooting
Knowledge Base
Corrupted Install Repair

Get Help...

Contact
Processor Support Contacts

More Info ...

Glossary
Articles

See also...

911 Software
Help

CreditLine Payment Processing Software Integration. This site can also be reached at http://docs.911software.com

Looking for better rates?   Get a Free Credit Card Processing Cost Comparison!


This guides serves to illustrate the integration using .NET, ASP or other COM and web based technologies.

Important Programming Rules

PLEASE, read every point below as those are the common points of failure in the integrations. Reviewing these pointers may save you significant amount of time in debugging.

  1. Compile for x86 / 32-bit. Do NOT compile for 64-bit even if the program will be used on a 64-bit OS.
  2. Each API object instance needs to call the initialization function (such as clcInit or Init) themselves and get a unique handle to themselves. This handle can not be shared across objects. However, SEE IMPORTANT WARNING BELOW about multiple object creation!
  3. Do NOT create a new object every time you call our API. This will create resource issues. The API object is meant to be created and shared by your application, unless you need to make multiple requests in parallel or creating multiple terminals to do the same - see below.
  4. Each instance can only make one request at a time, but one process can have multiple instances to make multiple requests.
  5. Each instance needs to have a unique client name or terminal name. For example, instance 1 gets TERM001, and instance 2 gets TERM002. The best way to configure this is by device. The length limit is 7. The server monitors the names for duplication and will do it's own name resolution in case of duplicate client names.
  6. The server name should match what's showing on the title bar of the credit server program.
  7. If using the CreditLine Multiple Merchant Account Setup, you must call clcSetMerchantIndex before every Auth, Edit, Sale, Batch and other transaction related calls. The merchant index is reset to 0 on every call completion.
  8. Some environments, such as VB.NET may lose the automation reference if the same API is called twice too quickly. Avoid calling the same API in tight loops - add a reasonable delay if needed.
  9. The dollar amounts have an implied decimal point. e.g. $2.00 should be submitted to our API as 200, not 2.00
  10. Since you will be calling a "black box" DLL, please avoid redundant and inefficient code. Obscure and hard to debug code may significantly extend your debugging efforts.
  11. Do take a look at our sample code.


The server name should match what's showing on the title bar of the credit server program. We had a NETBIOS interface before, so they must match. However, the file API is not that strict. However, it is a good practice to match them, in case we implement multi-servers that monitor the same message directory.



Inventory

To begin with, you will need the following:

  1. COM wrapper dll CLC.DLL located in \911\BIN directory.
  2. The library file CLCAPIW2.DLL located in \911\BIN directory.

The COM wrapper dll is \911\bin\clc.dll, which wraps the standard API dll \911\bin\clcapiw2.dll

Note: for .NET please use clccs.dll and CLCAPIW2.dll in \911\BIN directory, instead.


The following guide is for Windows NT (latest service packs), Windows 2000 (latest service packs) and Windows XP (latest service packs)

Installation

First, you will need to register the DLL Run the following command from command prompt:

regsvr32 c:\911\bin\clc.dll

This will put a registry entry for CreditLine.CLServer object. You can verify the entry by running regedit and searching for "CreditLine.CLServer".

Upgrade and Removal

  1. Use regedit to find and delete the entries that point to "CreditLine.CLServer"
  2. Restart the computer before registering the new dll.

Example

The following is a simple ASP example of communication with the dll.


<%
OPTION EXPLICIT

Class CreditLineTransaction
	Private objCLC
	Private sub Class_Initialize()
		set objCLC = server.CreateObject("CreditLine.CLServer")
		' set unique client nume
		objCLC.setClientName ("TERM_PPO")
		objCLC.setServerName ("CCVSRVR")
		' required: set actual directories on the server  to journal and message interface paths
		objCLC.setJournalDir ("C:\911\data")
		objCLC.setMessageDir ("C:\911\messages")
		objCLC.setOperatorID (10)
	End sub
	Private sub Class_Terminate()
		set objCLC = nothing
	End sub


	Private function setTransactionData(lngInvoiceID, strCardNum, lngCardExpMonth, lngCardExpYear, lngAmount)
		if not (objCLC.isServerOnline) then
			setTransactionData = "OFFLINE"
			Exit Function
		end if
		'General Data validation is done before data gets here. Any system specific validation can be done here.
		objCLC.setinvoiceid (clng(lngInvoiceID))
		objCLC.setAccountNum(cstr(strCardNum))
		all objCLC.setExpDate2("05","05")
		objCLC.setExpDate(clng(0505))
		objCLC.setAmount(clng(lngAmount))
		setTransactionData = "OK"
	End Function




	Public Function Authorize (lngInvoiceID, strCardNum, lngCardExpMonth, lngCardExpYear, lngAmount)
		Authorize = setTransactionData(lngInvoiceID, strCardNum, lngCardExpMonth, lngCardExpYear, lngAmount)
		if Authorize = "OK" then
			Authorize = objCLC.sale
		end if
		
		if (Authorize = false) then
			Authorize = objCLC.getErrText
		elseif (Authorize = true) then
			Authorize = objCLC.getTransId
		end if
	End Function
	
	Public Function ConfirmShipment(lngTransID)
		'This function is intended to convert Auths to Sales so that they are included in the next batch. It would not be called by this script, but rather by a script run periodically on the server to confirm shipment of ordered items. This entry is for testing only.
		call objCLC.addTip(lngTransID,0)
	End Function
	
End Class






dim objCL, response
set objCL = new CreditLineTransaction
dim InvoiceID, CardNum,CardExpMonth, CardExpYear, Amount


InvoiceID = 12345
CardNum = "4111111111111111"
CardExpMonth = 05
CardExpYear = 05
Amount = 2101


response = objCL.Authorize(InvoiceID,CardNum,CardExpMonth,CardExpYear,Amount)
response.write("Transaction Number: "& response)



set objCL = nothing


%>

Listing Of Functions

The COM object simply wraps the standard API DLL, removing clc prefix from functions.
For the full description of functions please see API documentation.

Samples

Troubleshooting