Highlighted
Valued Contributor.
Valued Contributor.
110 views

CALL .NET FROM COBOL

I need to call a Credit Card Gateway to submit credit card charges from my software.  I have spent hours reviewing the documentation  Working With .NET Assemblies.  I have everything coded but when I Create my assembly, the Handle gets set to a value of 1.

Also, the result of the assembly is also passed to another assembly that I create, where the Handle is passed as an OBJECT.   There are no examples given that show how to do this correctly.  Also, there is no example that uses "Stored Object Events".

Here is a sample of the coding I am trying to write.  The problem is with the last statement in the example:

MODIFY PostRequest-HANDLE "SetTransaction" ( Ms-Operation-HANDLE ).

I'm not sure hot to pass this correctly.

Thanks in advance to anyone that contributes to help me out.

 

 

======================================

Example Coding:
******************* NETDEFGENED Def File:  *******************************************************************
*  ACUCOBOL-GT Version 1.0.0 .NET Copy Book - Generated On 12/03/19 4:17:25 PM
           OBJECT @ASSEMBLY
           NAME    "TEST_dotNet_API"
           VERSION "1.0.17.0"

*  FULLY-QUALIFIED-NAME Mydotnet.Operation-1, Whatever_API, Version=1.0.17.0,
*  Mydotnet.Operation-1
           NAMESPACE "MYDOTTER"
           CLASS     "Operation-1"
           MODULE    "Whatever_API.dll"
           CONSTRUCTOR, 0, @CONSTRUCTOR1
*  [Class: Operation-1] Void SetEcrno(System.String)
           METHOD, 0, "@SetVariable1"
               "BSTR" @Var1_number, TYPE 8
*  [Class: Operation-1] System.String toXML(System.String)
           METHOD, 0, "@SetCountry"
               "BSTR" @country, TYPE 8
           RETURNING "BSTR", TYPE 8

*  FULLY-QUALIFIED-NAME Mydotnet.PostRequest, eSELECTplus_dotNet_API, Version=1.0.17.0, Culture=neutral, PublicKeyToken=8cb9cd598f87e276
*  Mydotnet.HttpsPostRequest
           NAMESPACE "MYDOTTER"
           CLASS     "PostRequest"
           MODULE    ""Whatever_API.dll"
           CONSTRUCTOR, 0, @CONSTRUCTOR1
*  [Class: HttpsPostRequest] Void SetStatus(Boolean)
           METHOD, 0, "@SetStatus "
               "boolean" @status_numb, TYPE 11
*  [Class: HttpsPostRequest] Void SetUserId(System.String)
           METHOD, 0, "@SetUserId"
               "BSTR" @User_id, TYPE 8
*  [Class: HttpsPostRequest] Void SetTransaction(Mydotnet.Transaction)
           METHOD, 0, "@SetTransaction"
               "STORED_OBJECT" @t, TYPE 69
******************* NETDEFGENED Def File:  *******************************************************************
My Sample Coding:
77 Ms-Operation-HANDLE  USAGE IS HANDLE.
77 Ms-PostRequest-HANDLE USAGE IS HANDLE.
77 WS-INTEGER-VARIABLE  PIC 99 VALUE 44.
77 WS-THE-COUNTRY  PIC X(20) VALUE "CANADA".
77 WS-Status-Check  PIC 9 VALUE 1.
77 WS-MY-USER-ID  PIC X(10) VALUE "DAFFY-DUCK".
 CREATE "TEST_dotNet_API"       
     NAMESPACE IS MYDOTTER
     CLASS-NAME IS "Operation-1"
     HANDLE IS Ms-Operation-HANDLE.
 MODIFY Ms-Operation-HANDLE "SetVariable1" ( WS-INTEGER-VARIABLE ).
 MODIFY Ms-Operation-HANDLE "SetCountry"   ( WS-THE-COUNTRY ).
 .....
 .....
 CREATE "TEST_dotNet_API"       
     NAMESPACE IS MYDOTTER
     CLASS-NAME IS "PostRequest"
     HANDLE IS PostRequest-HANDLE.
 MODIFY PostRequest-HANDLE "SetUserId" ( WS-MY-USER-ID ).
 MODIFY PostRequest-HANDLE "SetStatus" ( WS-Status-Check ).
 MODIFY PostRequest-HANDLE "SetTransaction" ( Ms-Operation-HANDLE ).
****************************************************************************

LarryGeeked

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.