COM Object v1.2



USAepay Gateway Wrapper COM

This COM object will collect the USAePay Transaction API form variables and send them to the gateway via an SSL connection. The send function of the COM object accepts a pointer to an LPSTR, which it will then fill up with the resulting response from the gateway.

Requirements and Installation Instructions

This COM object uses Microsoft's wininet DLL which ships with all Internet Explorer versions 3.0 and up. The resulting application should be run on a computer with IE 3.0+ To install the COM object you should place the “USAepayComObject” folder on your hard drive and run the “install.bat” script from there. The script uses the windows program “regsvr32.exe.” If the script fails, make sure that your windows PATH is pointing to the location of regsvr32. If not, you will need to manually locate the path to the program. It should be in the windows folder in %WINDOWS_HOME%\system32 (where %WINDOWS_HOME% is the directory where you installed windows). Add the path to regsvr32, to the windows path by typing:


at a dos command prompt. Then using the same command prompt, navigate to the COM object folder and run the install.bat file again. To uninstall the COM object run the uninstall.bat file.

Compiling Your Program

Once you've installed the COM object, you can start using it in your applications. We have provided a sample application using the COM object called USAepayClient which should serve as a good reference point on how to connect and use the COM object. You will need to compile two files, “USAepay.h” and “USAepay_i.c” (they can be found in the USAepayComObject folder). Copy these files to your project folder and include them in your project.

Functions, Methods and Instructions

The USAePay COM Object contains functions that allow you to set or get any of the gateway API form fields. These functions are arranged as follows:

1. get_<fieldName> (LPSTR &<variableToReturnValueInto>) This function will return the value currently contained within the COM objects <fieldName> varaible. The result will be placed into the <variableToBeReturnedInto> reference.

For Example: pIUSAepay→get_UMkey(&lpszKey); where pIUSAepay is a pointer to the COM object Instance. This function will get the UMkey form variable and place the value into lpszKey.

2. put_<fieldName> (LPSTR &<variableToSetTo>) This function will assign the value of <variableToSetTo> into the COM objects <fieldName> field.

For Example: pIUSAepay→put_UMkey(theKey); where pIUSAepay is a pointer to the COM object Instance. This function will set the UMkey form variable to the value of the Key variable.

3. The final function is:send(LPSTR &<variableTOReturnResultInto>) This function will complete the transaction by connecting to the gateway through SSL and sending all the form varaibles that were set using the put_ functions (2) and will return the result sent by the gateway into <variableTOReturnResultInto>.

For Example: pIUSAepay→send(&returnValue); where pIUSAepay is a pointer to the COM object Instance. This function will send all the form fields that have been set and return the result into the variable returnValue.

NOTE: For a list of all the <fieldName>s that you can get_ or put_ in the COM object, refer to the USAePay gateway API.

NOTE/WARNING: The COM object does not implement URL encoding. Therefore, the form variables that you set into the objects should be URL encoded before setting. To learn how to encode a string to be URL safe you can take a look at the sample client that already handles it.

Program Developed by Mind2Web Enterprise for USA ePay

Change Log

1.0.1rev → 1.2 Fixed problems with load control and added support for VBV, MSC and other new fields. 10/15/03

1.0.1 → 1.0.1rev This COM object supports early and late binding (IUnknown and IDispatch interfaces). Although it will load with ASP and Coldfusion, for IIS security reasons the COM object will raise an illegal access error while calling the send function. Therefore this COM cannot be used with any language running under IIS. 08/20/03

1.0 → 1.0.1 Added support for Layer 2 object oriented coding to support such languages as ASP and Coldfusion. 06/30/03

developer/comobject.txt · Last modified: 2019/05/07 10:10 by yura

Page Tools