Difference between revisions of "CreditLine DLL API Integration"
(→Inventory) |
|||
Line 3: | Line 3: | ||
− | + | =Inventory= | |
To begin with, you will need the following: | To begin with, you will need the following: | ||
Line 10: | Line 10: | ||
2) The library file <font color="#800000">'''CLCAPIW2.DLL'''</font>located in '''911\DATA''' directory. | 2) The library file <font color="#800000">'''CLCAPIW2.DLL'''</font>located in '''911\DATA''' directory. | ||
− | + | =Language Specific Instructions= | |
− | + | ==Visual Basic== | |
*In VB you need to declare all the parameters using the '''ByVal''' prefix instead of ByRef. This includes the strings. | *In VB you need to declare all the parameters using the '''ByVal''' prefix instead of ByRef. This includes the strings. | ||
*If you would like to use an OCX instead for Visual Basic, you can use CLClient.ocx in the same directory. Another alternative is [[CreditLine_Text_Based_/_ICVerify_Integration|File Based Communication]]. | *If you would like to use an OCX instead for Visual Basic, you can use CLClient.ocx in the same directory. Another alternative is [[CreditLine_Text_Based_/_ICVerify_Integration|File Based Communication]]. | ||
− | + | ==VB example== | |
<font size="2" face="Arial"> '''<font color="#000080">Public Declare Function clcInit Lib "CLCAPIW2.dll" (ByVal ClientName As String, ByVal ServerName As String As Integer</font>''')</font> | <font size="2" face="Arial"> '''<font color="#000080">Public Declare Function clcInit Lib "CLCAPIW2.dll" (ByVal ClientName As String, ByVal ServerName As String As Integer</font>''')</font> | ||
− | + | ==C++/C#== | |
*The Header file is the regular WIN32 header file. The data type LONG is 32 bit. | *The Header file is the regular WIN32 header file. The data type LONG is 32 bit. | ||
*Keep in mind that in C# and any .NET environment for instance, LONG is 64 bit so you have to use int or Integer not LONG ot Long in your definitions. | *Keep in mind that in C# and any .NET environment for instance, LONG is 64 bit so you have to use int or Integer not LONG ot Long in your definitions. | ||
*In C, the path has to be of format "C:'''\\'''911'''\\'''DATA", because back-slash is the escape char | *In C, the path has to be of format "C:'''\\'''911'''\\'''DATA", because back-slash is the escape char | ||
− | + | ==C# example== | |
DllImport("CLCAPIW2.dll", EntryPoint="clcInit", SetLastError=true, ExactSpelling=true, CallingConvention=CallingConvention.StdCall) | DllImport("CLCAPIW2.dll", EntryPoint="clcInit", SetLastError=true, ExactSpelling=true, CallingConvention=CallingConvention.StdCall) | ||
Line 29: | Line 29: | ||
'''''public static extern int ''clcInit(''string ClientName'', ''string'' ServerName);''' | '''''public static extern int ''clcInit(''string ClientName'', ''string'' ServerName);''' | ||
− | + | =Call Sequences= | |
− | + | == On Startup == | |
* clcInit → Set the client name and server name for communications | * clcInit → Set the client name and server name for communications | ||
Line 41: | Line 41: | ||
* clcSetStationId → Set a unique number for the terminal | * clcSetStationId → Set a unique number for the terminal | ||
− | + | == On Shutdown == | |
* clcTerm Release the resources | * clcTerm Release the resources | ||
− | + | == On Start Dial == | |
* clcSetMerchantIndex → Optional, use a different merchant than the default | * clcSetMerchantIndex → Optional, use a different merchant than the default | ||
Line 52: | Line 52: | ||
* clcDial → Start to dial the processor, connect before sending the transaction | * clcDial → Start to dial the processor, connect before sending the transaction | ||
− | + | == On Regular Authorization == | |
* clcSetMerchantIndex → Optional, use a different merchant than the default | * clcSetMerchantIndex → Optional, use a different merchant than the default | ||
Line 71: | Line 71: | ||
* clcGetErrText → Get the error text if failed | * clcGetErrText → Get the error text if failed | ||
− | + | == On Regular Force == | |
* clcSetMerchantIndex → Optional, use a different merchant than the default | * clcSetMerchantIndex → Optional, use a different merchant than the default | ||
Line 88: | Line 88: | ||
* clcForce → Actual do the force, returns the Transaction Id if successful | * clcForce → Actual do the force, returns the Transaction Id if successful | ||
− | + | == On Regular Credit == | |
* clcSetMerchantIndex → Optional, use a different merchant than the default | * clcSetMerchantIndex → Optional, use a different merchant than the default | ||
Line 105: | Line 105: | ||
* clcCredit → Do the credit, returns the Transaction Id if successful | * clcCredit → Do the credit, returns the Transaction Id if successful | ||
− | + | == On Add Tip == | |
* clcSetMerchantIndex → Optional, use a different merchant than the default | * clcSetMerchantIndex → Optional, use a different merchant than the default | ||
* clcAddTip → Add actual tip to the transaction, need the Transaction Id | * clcAddTip → Add actual tip to the transaction, need the Transaction Id | ||
− | + | == On Void Transaction == | |
* clcSetMerchantIndex → Optional, use a different merchant than the default | * clcSetMerchantIndex → Optional, use a different merchant than the default | ||
* clcVoid → Void the transaction, need the Transaction Id | * clcVoid → Void the transaction, need the Transaction Id | ||
− | + | == On Batch == | |
* clcSetMerchantIndex → Optional, use a different merchant than the default | * clcSetMerchantIndex → Optional, use a different merchant than the default | ||
* clcBatch → Batch | * clcBatch → Batch | ||
− | + | == On Gift Card Transaction == | |
* clcActivate → Optional, activate gift card | * clcActivate → Optional, activate gift card | ||
Line 128: | Line 128: | ||
* clcCredit → Do the credit, returns the Transaction Id if successful | * clcCredit → Do the credit, returns the Transaction Id if successful | ||
− | + | == Hotel Specific == | |
* clcSetCheckInDate → Sets checkin date | * clcSetCheckInDate → Sets checkin date | ||
* clcSetCheckOutDate → Sets checkout date | * clcSetCheckOutDate → Sets checkout date | ||
Line 135: | Line 135: | ||
* clcSetCustomerFirstName → Sets customer first name | * clcSetCustomerFirstName → Sets customer first name | ||
− | + | =Call Samples= | |
− | + | ==Visual Basic== | |
Dim hCC As Integer; | Dim hCC As Integer; | ||
Line 146: | Line 146: | ||
Dim nBalance As Integer; | Dim nBalance As Integer; | ||
− | + | ==''''On Startup'''== | |
hCC = clcInit("TERM001", "CCVSVR1"); | hCC = clcInit("TERM001", "CCVSVR1"); | ||
Line 161: | Line 161: | ||
− | + | ==''''On Shutdown'''== | |
clcTerm(hCC);<br /> | clcTerm(hCC);<br /> | ||
− | + | ==''''On Start Dial'''== | |
clcSetMerchantIndex(hCC, 1); ''''default is 0''' | clcSetMerchantIndex(hCC, 1); ''''default is 0''' | ||
Line 173: | Line 173: | ||
clcDial(hCC);<br /><br /> | clcDial(hCC);<br /><br /> | ||
− | + | ==''''On Regular Authorization'''== | |
clcSetMerchantIndex(hCC, 1); ''''default is 0''' | clcSetMerchantIndex(hCC, 1); ''''default is 0''' | ||
Line 234: | Line 234: | ||
clcCopyErrText(hCC, strErrText);<br /><br /> | clcCopyErrText(hCC, strErrText);<br /><br /> | ||
</nowiki> | </nowiki> | ||
− | + | ==''''On Regular Credit'''== | |
clcSetMerchantIndex(hCC, 1); ''''default is 0''' | clcSetMerchantIndex(hCC, 1); ''''default is 0''' | ||
Line 264: | Line 264: | ||
clcCopyErrText(hCC, strErrText);<br /><br /> | clcCopyErrText(hCC, strErrText);<br /><br /> | ||
</nowiki> | </nowiki> | ||
− | + | ==''''On Add Tip'''== | |
clcSetMerchantIndex(hCC, 1); ''''default is 0''' | clcSetMerchantIndex(hCC, 1); ''''default is 0''' | ||
Line 270: | Line 270: | ||
clcAddTip(hCC, nTransNum, 100); ''''Add $1.00 Tip'''<br /><br /> | clcAddTip(hCC, nTransNum, 100); ''''Add $1.00 Tip'''<br /><br /> | ||
− | + | ==''''On Void Transaction'''== | |
clcSetMerchantIndex(hCC, 1); ''''default is 0 | clcSetMerchantIndex(hCC, 1); ''''default is 0 | ||
Line 276: | Line 276: | ||
clcVoid(hCC, nTransNum); | clcVoid(hCC, nTransNum); | ||
− | + | ==''''On Gift Card transaction'''== | |
' sale & credit are the same as a regular credit card ''' | ' sale & credit are the same as a regular credit card ''' | ||
Line 286: | Line 286: | ||
nBalance = clcInquire(hCC, "4111111111111111"); | nBalance = clcInquire(hCC, "4111111111111111"); | ||
− | + | ==''''On Batch'''== | |
clcSetMerchantIndex(hCC, 1); ''''default is 0''' | clcSetMerchantIndex(hCC, 1); ''''default is 0''' | ||
Line 292: | Line 292: | ||
nResult = clcBatch(hCC); | nResult = clcBatch(hCC); | ||
− | + | =Fine Tuning= | |
CreditLine behavior can be fine tuned to match your operational requirements. | CreditLine behavior can be fine tuned to match your operational requirements. |
Revision as of 22:40, 24 February 2006
This article is part of the Payment Processing Software Library |
|
Get it... | |
Install it... | |
Connect to it... | |
Set it up... | |
Learn to use it... | |
→ Manual & User Guide | |
Fix it... | |
→ Errors & Troubleshooting | |
Get Help... | |
More Info ... | |
See also... | |
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 guide is for developers using the DLL
Inventory
To begin with, you will need the following:
1) The interface header file CLCAPIW.h located in 911\BIN directory. This header contains the ENTIRE listing of available API.
2) The library file CLCAPIW2.DLLlocated in 911\DATA directory.
Language Specific Instructions
Visual Basic
- In VB you need to declare all the parameters using the ByVal prefix instead of ByRef. This includes the strings.
- If you would like to use an OCX instead for Visual Basic, you can use CLClient.ocx in the same directory. Another alternative is File Based Communication.
VB example
Public Declare Function clcInit Lib "CLCAPIW2.dll" (ByVal ClientName As String, ByVal ServerName As String As Integer)
C++/C#
- The Header file is the regular WIN32 header file. The data type LONG is 32 bit.
- Keep in mind that in C# and any .NET environment for instance, LONG is 64 bit so you have to use int or Integer not LONG ot Long in your definitions.
- In C, the path has to be of format "C:\\911\\DATA", because back-slash is the escape char
C# example
DllImport("CLCAPIW2.dll", EntryPoint="clcInit", SetLastError=true, ExactSpelling=true, CallingConvention=CallingConvention.StdCall)
public static extern int clcInit(string ClientName, string ServerName);
Call Sequences
On Startup
- clcInit → Set the client name and server name for communications
- clcSetJournalDir → Set the directory where the credit card journal is, e.g. 911\DATA
- clcSetMessageDir → Set the directory where the file communications occur, e.g. C:\911\MESSAGES
NOTE: the directories are actual directories on the server (where the dll is installed)
- clcSetStationId → Set a unique number for the terminal
On Shutdown
- clcTerm Release the resources
On Start Dial
- clcSetMerchantIndex → Optional, use a different merchant than the default
- clcSetAccountNum → Set the card account number (for manual entry)
- clcSetTrackData → Set the scanned track data (for magnetic swipe)\
- clcDial → Start to dial the processor, connect before sending the transaction
On Regular Authorization
- clcSetMerchantIndex → Optional, use a different merchant than the default
- clcSetInvoiceId → Set the invoice number
- clcSetOperatorId → Set the operator number
- clcSetTableNum → Set the table number
- clcSetPaymentType → Set the payment type
- clcSetGuestCount → Set the guest count
- clcSetAccountNum → Set the card account number (for manual entry)
- clcSetExpDate → Set the expiration date (for manual entry)
- clcSetTrackData → Set the scanned track data (for magnetic swipe)
- clcSetAmount → Set the authorization amount ($20.01 is entered as 2001 )
- clcSetCVCNumber → Set the CVC Number
- clcSetAVSData → Set the AVS Data (e.g. Zip)
- clcAuth → Do the authorization, returns the Transaction Id if successful. Auths cannot be settled until Tip is added
- clcSale → Do the sale, returns the Transaction Id if successful
- clcGetAuthCode → Get the authorization code if successful
- clcGetErrText → Get the error text if failed
On Regular Force
- clcSetMerchantIndex → Optional, use a different merchant than the default
- clcSetInvoiceId → Set the invoice number
- clcSetOperatorId → Set the operator number
- clcSetTableNum → Set the table number
- clcSetPaymentType → Set the payment type
- clcSetGuestCount → Set the guest count
- clcSetAccountNum → Set the card account number (for manual entry)
- clcSetExpDate → Set the expiration date (for manual entry)
- clcSetTrackData → Set the scanned track data (for magnetic swipe)
- clcSetAmount → Set the authorization amount
- clcSetAuthCode → Set the force auth code (acquired from the call center)
- clcSetCVCNumber → Set the CVC Number
- clcSetAVSData → Set the AVS Data (e.g. Zip)
- clcForce → Actual do the force, returns the Transaction Id if successful
On Regular Credit
- clcSetMerchantIndex → Optional, use a different merchant than the default
- clcSetInvoiceId → Set the invoice number
- clcSetOperatorId → Set the operator number
- clcSetTableNum → Set the table number
- clcSetPaymentType → Set the payment type
- clcSetGuestCount → Set the guest count
- clcSetAccountNum → Set the card account number (for manual entry)
- clcSetExpDate → Set the expiration date (for manual entry)
- clcSetTrackData → Set the scanned track data (for magnetic swipe)
- clcSetAmount → Set the authorization amount
- clcSetCVCNumber → Set the CVC Number
- clcSetAVSData → Set the AVS Data (e.g. Zip)
- clcSetAuthCode → Set the force auth code (acquired from the call center)
- clcCredit → Do the credit, returns the Transaction Id if successful
On Add Tip
- clcSetMerchantIndex → Optional, use a different merchant than the default
- clcAddTip → Add actual tip to the transaction, need the Transaction Id
On Void Transaction
- clcSetMerchantIndex → Optional, use a different merchant than the default
- clcVoid → Void the transaction, need the Transaction Id
On Batch
- clcSetMerchantIndex → Optional, use a different merchant than the default
- clcBatch → Batch
On Gift Card Transaction
- clcActivate → Optional, activate gift card
- clcDeactivate → Optional, deactivate gift card
- clcInquire Optional, returns the balance on the gift card
- clcSale → Do the sale, returns the Transaction Id if successful. Add tip is not supported, so clcAuth does not apply
- clcCredit → Do the credit, returns the Transaction Id if successful
Hotel Specific
- clcSetCheckInDate → Sets checkin date
- clcSetCheckOutDate → Sets checkout date
- clcSetRoomRate → Sets room rate
- clcSetCustomerLastName → Sets customer last name
- clcSetCustomerFirstName → Sets customer first name
Call Samples
Visual Basic
Dim hCC As Integer;
Dim nResult As Integer;
Dim nTransNum As Integer;
Dim nBalance As Integer;
'On Startup
hCC = clcInit("TERM001", "CCVSVR1");
' NOTE: the directories are actual directories on the server
' (where the dll is installed). These are required.
clcSetJournalDir(hCC, "[file:///c:/911/data c:\911\data]");
clcSetMessageDir(hCC, "[file:///c:/911/messages c:\911\messages]");
clcSetStationId(hCC, 1);
'On Shutdown
clcTerm(hCC);
'On Start Dial
clcSetMerchantIndex(hCC, 1); 'default is 0
clcSetAccountNum(hCC, "4111111111111111");
clcDial(hCC);
'On Regular Authorization
clcSetMerchantIndex(hCC, 1); 'default is 0
clcSetInvoiceId(hCC, 123);
clcSetOperatorId(hCC, 1);
clcSetTableNum(hCC, 10);
clcSetAccountNum(hCC, "4111111111111111");
clcSetExpDate2(hCC, 02, 12);
clcSetAmount(hCC, 100); '$1.00
' sales can be batched right away but auths need tip to be added to them before batching
nResult = clcAuth(hCC); ' or nResult = clcSale(hCC);
if (nResult > 0) nTransNum = clcGetTransId(hCC); clcCopyAuthCode(hCC, strAuthCode); else clcCopyErrText(hCC, strErrText);<br /><br /> ' On Regular Force
clcSetMerchantIndex(hCC, 1); 'default is 0
clcSetInvoiceId(hCC, 123);
clcSetOperatorId(hCC, 1);
clcSetTableNum(hCC, 10);
clcSetAccountNum(hCC, "4111111111111111");
clcSetExpDate2(hCC, 02, 12);
clcSetAmount(hCC, 100); '$1.00
clcSetAuthCode(hCC, "123456");
nResult = clcForce(hCC); if (nResult > 0) nTransNum = clcGetTransId(hCC); clcCopyAuthCode(hCC, strAuthCode); else clcCopyErrText(hCC, strErrText);<br /><br />
'On Regular Credit
clcSetMerchantIndex(hCC, 1); 'default is 0
clcSetInvoiceId(hCC, 123);
clcSetOperatorId(hCC, 1);
clcSetTableNum(hCC, 10);
clcSetAccountNum(hCC, "4111111111111111");
clcSetExpDate2(hCC, 02, 12);
clcSetAmount(hCC, 100); '$1.00
clcSetAuthCode(hCC, "CREDIT");
nResult = clcCredit(hCC); if (nResult > 0) nTransNum = clcGetTransId(hCC); clcCopyAuthCode(hCC, strAuthCode); else clcCopyErrText(hCC, strErrText);<br /><br />
'On Add Tip
clcSetMerchantIndex(hCC, 1); 'default is 0
clcAddTip(hCC, nTransNum, 100); 'Add $1.00 Tip
'On Void Transaction
clcSetMerchantIndex(hCC, 1); 'default is 0
clcVoid(hCC, nTransNum);
'On Gift Card transaction
' sale & credit are the same as a regular credit card
clcActivate(hCC, "4111111111111111");
clcDeactivate(hCC, "4111111111111111");
nBalance = clcInquire(hCC, "4111111111111111");
'On Batch
clcSetMerchantIndex(hCC, 1); 'default is 0
nResult = clcBatch(hCC);
Fine Tuning
CreditLine behavior can be fine tuned to match your operational requirements.
Please see the in 911\data\911_CCV.INI for more information.
Note: Do not forget to remove ';' in front of a key to uncomment it; for the key to take effect