Using the Merchant/400 API in an ILE Program


Introduction

The Merchant/400 API interface provided for the ILE (Integrated Language Extensions) environment is through the service program WWWMAPI in the WWWSERVER library. Function prototypes and definitions are provided for ILE C applications in the member WWWMAPI in source file H (i.e., WWWMAPI.H) in library WWWSERVER. Constants that define API entry points for ILE RPG applications are available in member DWWWMAPI in WWWSERVER/QRPGLESRC. Data items that define API entry points for ILE COBOL applications can be found in member WWWMAPI in WWWSERVER/QCBLLESRC. A bind directory named MBNDDIR in library WWWSERVER is provided to aid in developing ILE applications.


The ILE Call to Execute the API

The following documents the function that is available to execute the Merchant/400 API in an ILE environment. The API requires all of the parameters that are listed. More information about the minimum information needed by the API can be found in the topic on Required Information.

WwwMrcSubmit

ILE C Prototype:
void WwwMrcSubmit(char *pachRemoteHost,
                  long  lRemoteHostLen,
                  long  lRemotePort,
                  long  lTransmitMethod,
                  long  lInputFormat,
                  void *pSubmitInputs,
                  long  lOutputFormat,
                  void *pSubmitResults,
                  long *plResultSuccess);


where,

pachRemoteHost is the buffer containing the name and domain, or IP address, of the remote processing host. This will be supplied by the partner agency.

lRemoteHostLen is the length of the Remote Host Name buffer. This will be calculated by your application based on the size of the entry in the pachRemoteHost parameter.

lRemotePort is the socket port number used by the remote host for SSL communications. This will usually be set to 443.

lTransmitMethod tells the Merchant/400 API how to transmit the data. Please refer to the topic What Happens - Transmission Methods for more information on how to set this parameter.

lInputFormat tells the API what format your input data will be in.

pSubmitInputs is the formatted buffer that holds the customer, order, and credit card information.

lOutputFormat tells the API what format you are expecting to receive results data to be in.

pSubmitResults is the formatted buffer that will hold the returned transaction information from the card processor.

plResultSuccess is the code returned indicating the success of the transaction.

ILE RPG or COBOL Parameters:
   1.  Remote Host Name            Input        Char(*)

   2.  Remote Host Name Length     Input        Binary(4)

   3.  Remote Port Number          Input        Binary(4)

   4.  Transmission Method         Input        Binary(4)

   5.  Input Data Format           Input        Binary(4)

   6.  Input Data Buffer           Input        Char(*)

   7.  Output Data Format          Input        Binary(4)

   8.  Output Data Buffer          Input/Output Char(*)

   9.  Completion Indicator        Output       Binary(4)
where,

Remote Host Name is the buffer containing the name and domain, or IP address, of the remote processing host. This will be supplied by the partner agency.

Remote Host Name Length is the length of the Remote Host Name buffer. This will be calculated by your application based on the size of the entry in the Remote Host Name parameter.

Remote Port Number is the socket port number used by the remote host for SSL communications. This will usually be set to 443.

Transmission Method tells the Merchant/400 API how to transmit the data. Please refer to the topic What Happens - Transmission Methods for more information on how to set this parameter.

Input Data Format tells the API what format your input data will be in.

Input Data Buffer is the formatted buffer that holds the customer, order, and credit card information.

Output Data Format tells the API what format you are expecting to receive results data to be in.

Output Data Buffer is the formatted buffer that will hold the returned transaction information from the card processor.

Completion Indicator is the code returned indicating the success of the transaction.

Please refer to the document What Happens - Transmission Methods for a description of the processing that is performed within the API.