Difference between revisions of "CreditLine COM Integration"

From Payment Processing Software Library
Jump to: navigation, search
(UNDER CONSTRUCTION)
(UNDER CONSTRUCTION)
Line 13: Line 13:
 
This section is under construction....
 
This section is under construction....
  
==== <font color="#000080">This guide is for developers who wish to integrate through COM interface. This can be used in .NET, ASP and any other technology that uses COM communications. </font> ====
+
==Inventory==
  
==== '''To begin with, you will need the following:''' ====
+
To begin with, you will need the following:  
 +
1) COM wrapper dll  CLC.DLL located in c:\911\BIN directory. 
  
<span style="font-weight: 400">1)</span> COM wrapper dll<font color="#000080"> </font><font color="#800000">'''CLC.DLL'''</font> located in [file:///c:/911/DATA c:\911\BIN] directory.
+
2) The library file CLCAPIW2.DLL located in c:\911\BIN directory.
  
<span style="font-weight: 400">2) The library file </span>'''<font color="#800000">CLCAPIW2.DLL</font>'''<span style="font-weight: 400"> located in [file:///c:/911/DATA c:\911\BIN] directory. </span>
+
The COM wrapper dll is c:\911\bin\clc.dll, which wraps the standard API dll c:\911\bin\clcapiw2.dll.
 
+
<font color="#000080">The COM wrapper dll is </font><font color="#800000"> [file:///c:/911/bin/clc.dll c:\911\bin\clc.dll]</font><font color="#000080">, which wraps the standard API dll </font> [file:///c:/911/bin/clcapiw2.dll c:\911\bin\clcapiw2.dll].
+
  
 
The following guide is for Windows NT (latest service packs), Windows 2000 (latest service packs) and Windows XP ((latest service packs)
 
The following guide is for Windows NT (latest service packs), Windows 2000 (latest service packs) and Windows XP ((latest service packs)
  
==== <font face="Times New Roman">1) Register the DLL</font> ====
+
==Installation==
 
+
<font face="Times New Roman">Run the following command from command prompt:</font>
+
 
+
'''<font face="Times New Roman">regsvr32 [file:///c:/911/bin/clc.dll c:\911\bin\clc.dll]</font>'''
+
 
+
<font face="Times New Roman">This will put a registry entry for CreditLine.CLServer object. You can verify the entry by running '''regedit''' and searching for '''"CreditLine.CLServer"'''. If you need to unregister the dll, use '''regedit '''to find and delete the entries that point to '''"CreditLine.CLServer", '''then restart the computer before registering the new dll.</font>
+
 
+
==== <font face="Times New Roman">2) The following is a simple ASP example of communication with the dll. </font> ====
+
 
+
<code> </code>
+
 
+
'''<font color="#000080" face="Arial"><%</font>'''
+
 
+
'''<font color="#000080" face="Arial">OPTION EXPLICIT
+
</font>'''
+
 
+
'''<font color="#000080" face="Arial">Class CreditLineTransaction</font>'''
+
 
+
'''<font color="#000080" face="Arial"> Private objCLC</font>'''
+
 
+
'''<font color="#000080" face="Arial"> Private sub Class_Initialize()</font>'''
+
 
+
'''<font color="#000080" face="Arial"> set objCLC = server.CreateObject("CreditLine.CLServer")</font>'''
+
 
+
'''<font color="#000080" face="Arial"> ' set unique client nume</font>'''
+
 
+
'''<font color="#000080" face="Arial"> objCLC.setClientName ("TERM_PPO")</font>'''
+
 
+
'''<font color="#000080" face="Arial"> objCLC.setServerName ("CCVSRVR")</font>'''
+
 
+
'''<font color="#000080" face="Arial"> ' required: set actual directories on the server  to journal and message interface paths</font>'''
+
 
+
'''<font color="#000080" face="Arial"> objCLC.setJournalDir ("C:\911\data")</font>'''
+
 
+
'''<font color="#000080" face="Arial"> objCLC.setMessageDir ("C:\911\messages")</font>'''
+
 
+
'''<font color="#000080" face="Arial"> objCLC.setOperatorID (10)</font>'''
+
 
+
'''<font color="#000080" face="Arial"> End sub</font>'''
+
 
+
'''<font color="#000080" face="Arial"> Private sub Class_Terminate()</font>'''
+
 
+
'''<font color="#000080" face="Arial"> set objCLC = nothing</font>'''
+
 
+
'''<font color="#000080" face="Arial"> End sub
+
</font>'''
+
 
+
'''<font color="#000080" face="Arial"> Private function setTransactionData(lngInvoiceID, strCardNum, lngCardExpMonth, lngCardExpYear, lngAmount)</font>'''
+
 
+
'''<font color="#000080" face="Arial"> if not (objCLC.isServerOnline) then</font>'''
+
 
+
'''<font color="#000080" face="Arial"> setTransactionData = "OFFLINE"</font>'''
+
 
+
'''<font color="#000080" face="Arial"> Exit Function</font>'''
+
 
+
'''<font color="#000080" face="Arial"> end if</font>'''
+
 
+
'''<font color="#000080" face="Arial"> 'General Data validation is done before data gets here. Any system specific validation can be done here.</font>'''
+
 
+
'''<font color="#000080" face="Arial"> objCLC.setinvoiceid (clng(lngInvoiceID))</font>'''
+
 
+
'''<font color="#000080" face="Arial"> objCLC.setAccountNum(cstr(strCardNum))</font>'''
+
 
+
'''<font color="#000080" face="Arial"> all objCLC.setExpDate2("05","05")</font>'''
+
 
+
'''<font color="#000080" face="Arial"> objCLC.setExpDate(clng(0505))</font>'''
+
 
+
'''<font color="#000080" face="Arial"> objCLC.setAmount(clng(lngAmount))</font>'''
+
 
+
'''<font color="#000080" face="Arial"> setTransactionData = "OK"</font>'''
+
 
+
'''<font color="#000080" face="Arial"> End Function
+
</font>'''
+
 
+
'''<font color="#000080" face="Arial"> Public Function Authorize (lngInvoiceID, strCardNum, lngCardExpMonth, lngCardExpYear, lngAmount)</font>'''
+
 
+
'''<font color="#000080" face="Arial"> Authorize = setTransactionData(lngInvoiceID, strCardNum, lngCardExpMonth, lngCardExpYear, lngAmount)</font>'''
+
 
+
'''<font color="#000080" face="Arial"> if Authorize = "OK" then</font>'''
+
 
+
'''<font color="#000080" face="Arial"> Authorize = objCLC.sale</font>'''
+
 
+
'''<font color="#000080" face="Arial"> end if</font>'''
+
  
'''<font color="#000080" face="Arial"> </font>'''
+
First, you will need to register the DLL
 +
Run the following command from command prompt:
  
'''<font color="#000080" face="Arial"> if (Authorize = false) then</font>'''
+
'''regsvr32 c:\911\bin\clc.dll'''
  
'''<font color="#000080" face="Arial"> Authorize = objCLC.getErrText</font>'''
+
This will put a registry entry for CreditLine.CLServer object. You can verify the entry by running regedit and searching for "CreditLine.CLServer". If you need to unregister the dll, use regedit to find and delete the entries that point to "CreditLine.CLServer", then restart the computer before registering the new dll.
  
'''<font color="#000080" face="Arial"> elseif (Authorize = true) then</font>'''
+
==Sample==
 +
The following is a simple ASP example of communication with the dll.
 +
<CODE>
 +
<%
 +
OPTION EXPLICIT
  
'''<font color="#000080" face="Arial"> Authorize = objCLC.getTransId</font>'''
+
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
  
'''<font color="#000080" face="Arial"> end if</font>'''
 
  
'''<font color="#000080" face="Arial"> End Function</font>'''
+
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
  
'''<font color="#000080" face="Arial"> </font>'''
 
  
'''<font color="#000080" face="Arial"> Public Function ConfirmShipment(lngTransID)</font>'''
 
  
'''<font color="#000080" face="Arial"> '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.</font>'''
 
  
'''<font color="#000080" face="Arial"> call objCLC.addTip(lngTransID,0)</font>'''
+
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
  
'''<font color="#000080" face="Arial"> End Function</font>'''
 
  
'''<font color="#000080" face="Arial"> </font>'''
 
  
'''<font color="#000080" face="Arial">End Class
 
</font>'''
 
  
'''<font color="#000080" face="Arial">dim objCL, response</font>'''
 
  
'''<font color="#000080" face="Arial">set objCL = new CreditLineTransaction</font>'''
 
  
'''<font color="#000080" face="Arial">dim InvoiceID, CardNum,CardExpMonth, CardExpYear, Amount
+
dim objCL, response
</font>'''
+
set objCL = new CreditLineTransaction
 +
dim InvoiceID, CardNum,CardExpMonth, CardExpYear, Amount
  
'''<font color="#000080" face="Arial">InvoiceID = 12345</font>'''
 
  
'''<font color="#000080" face="Arial">CardNum = "4111111111111111"</font>'''
+
InvoiceID = 12345
 +
CardNum = "4111111111111111"
 +
CardExpMonth = 05
 +
CardExpYear = 05
 +
Amount = 2101
  
'''<font color="#000080" face="Arial">CardExpMonth = 05</font>'''
 
  
'''<font color="#000080" face="Arial">CardExpYear = 05</font>'''
+
response = objCL.Authorize(InvoiceID,CardNum,CardExpMonth,CardExpYear,Amount)
 +
response.write("Transaction Number: "& response)
  
'''<font color="#000080" face="Arial">Amount = 2101
 
</font>'''
 
  
'''<font color="#000080" face="Arial">response = objCL.Authorize(InvoiceID,CardNum,CardExpMonth,CardExpYear,Amount)</font>'''
 
  
'''<font color="#000080" face="Arial">response.write("Transaction Number: "& response)
+
set objCL = nothing
</font>'''
+
  
'''<font color="#000080" face="Arial">set objCL = nothing
 
</font>'''
 
  
'''<font color="#000080" face="Arial">%></font>'''
+
%>
 +
</CODE>
  
==== <font face="Arial">'''3) Listing of functions. For description of functions please see <font color="#000080">[API.htm API documentation]</font> (com object simply wraps the standard API DLL removing clc prefix from functions)'''</font> ====
+
==Listing Of Functions==
 +
The COM object simply wraps the standard API DLL, removing clc prefix from functions.<br>
 +
For the full description of functions please see [[CreditLine_DLL_API_Integration|API documentation]].
  
 
==Samples==
 
==Samples==

Revision as of 17:19, 7 January 2009

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!

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.


CreditLine COM and Web Page (ASP/.NET/COM) Integration

Please follow this link COM Integration Guide

UNDER CONSTRUCTION

This section is under construction....

Inventory

To begin with, you will need the following: 1) COM wrapper dll CLC.DLL located in c:\911\BIN directory.

2) The library file CLCAPIW2.DLL located in c:\911\BIN directory.

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

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". If you need to unregister the dll, use regedit to find and delete the entries that point to "CreditLine.CLServer", then restart the computer before registering the new dll.

Sample

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