Highlighted
Absent Member.
Absent Member.
2649 views

[archive] Problem getting property value

[Migrated content. Thread originally posted on 25 September 2009]

Hello,

I am trying to write a program to perform credit card authorizations, I am using the ActiveX/COM from /n software for VB 6.0. I have attached the entire def file for your review and here is the code that I am using to set the properties and call the Sale() object. It all seems to work but I can not retrieve the data that should be returning to me. Any help would be greatly appreciated.

If you would like I can zip up the entire project and attach.

Thanks,
Jim Whalen

*** Start Code from Working Storage.

01 ICHARGE-HANDLE HANDLE OF @ICharge.

01 ICHARGE-RETURN-STATUS PIC S9(9) COMP-5 value 1.
01 ICHARGE-APPROVAL-STATUS PIC S9(9) COMP-5 value 0.

*** End Code from Working Storage,

*** Start Code from Event editor.
*
ICharge-Bef-Routine.

CREATE ICharge HANDLE IS ICHARGE-HANDLE.
MODIFY ICHARGE-HANDLE GATEWAY 1.
MODIFY ICHARGE-HANDLE GATEWAYURL "https://test.authorize.net/
- "gateway.transact.dll"
MODIFY ICHARGE-HANDLE AddSpecialField(
BY NAME @Name "x_test_request",
BY NAME @Val "true")
MODIFY ICHARGE-HANDLE AddSpecialField(
BY NAME @Name "x_tran_key",
BY NAME @Val "SsVxS6trU8whvBwz")
.
*
ICharge-Authorize-Pb-Ev-Cmd-Clicked.

INQUIRE ICHARGE-CVV2-EF, VALUE ICHARGE-CVV2-EF-VALUE.
MODIFY ICHARGE-HANDLE CardCVV2Data = ICHARGE-CVV2-EF-VALUE.

INQUIRE ICHARGE-MONTH-CM, VALUE ICHARGE-MONTH-CM-VALUE.
MODIFY ICHARGE-HANDLE CardExpMonth = ICHARGE-MONTH-CM-VALUE.

INQUIRE ICHARGE-YEAR-EF, VALUE ICHARGE-YEAR-EF-VALUE.
MOVE ICHARGE-YEAR-EF-VALUE TO WS-YEAR.
MODIFY ICHARGE-HANDLE CardExpYear = WS-YEAR.

INQUIRE ICHARGE-CARD-NUMBER-EF,
VALUE ICHARGE-CARD-NUMBER-EF-VALUE
MODIFY ICHARGE-HANDLE CardNumber =
ICHARGE-CARD-NUMBER-EF-VALUE.

INQUIRE ICHARGE-ADDRESS-EF, VALUE ICHARGE-ADDRESS-EF-VALUE.
MODIFY ICHARGE-HANDLE CustomerAddress =
ICHARGE-ADDRESS-EF-VALUE.

INQUIRE ICHARGE-CITY-EF, VALUE ICHARGE-CITY-EF-VALUE.
MODIFY ICHARGE-HANDLE CustomerCity = ICHARGE-CITY-EF-VALUE.

MODIFY ICHARGE-HANDLE CustomerCountry = "US".

INQUIRE ICHARGE-E-MAIL-EF, VALUE ICHARGE-E-MAIL-EF-VALUE.
MODIFY ICHARGE-HANDLE CustomerEmail =
ICHARGE-E-MAIL-EF-VALUE.

MODIFY ICHARGE-HANDLE CustomerFax = " ".

INQUIRE ICHARGE-FIRST-NAME-EF,
VALUE ICHARGE-FIRST-NAME-EF-VALUE.
MODIFY ICHARGE-HANDLE CustomerFirstName =
ICHARGE-FIRST-NAME-EF-VALUE.

INQUIRE ICHARGE-CUSTOMER-ID-EF,
VALUE ICHARGE-CUSTOMER-ID-EF-VALUE.
MODIFY ICHARGE-HANDLE CustomerId =
ICHARGE-CUSTOMER-ID-EF-VALUE.

INQUIRE ICHARGE-LAST-NAME-EF,
VALUE ICHARGE-LAST-NAME-EF-VALUE.
MODIFY ICHARGE-HANDLE CustomerLastName =
ICHARGE-LAST-NAME-EF-VALUE.

INQUIRE ICHARGE-PHONE-EF, VALUE ICHARGE-PHONE-EF-VALUE.
MODIFY ICHARGE-HANDLE CustomerPhone = ICHARGE-PHONE-EF-VALUE.

INQUIRE ICHARGE-STATE-EF, VALUE ICHARGE-STATE-EF-VALUE.
MODIFY ICHARGE-HANDLE CustomerState = ICHARGE-STATE-EF-VALUE.

INQUIRE ICHARGE-ZIP-EF, VALUE ICHARGE-ZIP-EF-VALUE.
MODIFY ICHARGE-HANDLE CustomerZip = ICHARGE-ZIP-EF-VALUE.

INQUIRE ICHARGE-INVC-NO-EF, VALUE ICHARGE-INVC-NO-EF-VALUE.
MODIFY ICHARGE-HANDLE InvoiceNumber =
ICHARGE-INVC-NO-EF-VALUE.

INQUIRE ICHARGE-LOGIN-EF, VALUE ICHARGE-LOGIN-EF-VALUE.
MODIFY ICHARGE-HANDLE MerchantLogin = ICHARGE-LOGIN-EF-VALUE.

INQUIRE ICHARGE-PASSWORD-EF, VALUE ICHARGE-PASSWORD-EF-VALUE.
MODIFY ICHARGE-HANDLE MerchantPassword =
ICHARGE-PASSWORD-EF-VALUE.

INQUIRE ICHARGE-AMOUNT-EF, VALUE ICHARGE-AMOUNT-EF-VALUE.
MODIFY ICHARGE-HANDLE TransactionAmount =
ICHARGE-AMOUNT-EF-VALUE.

INQUIRE ICHARGE-DESC-EF, VALUE ICHARGE-DESC-EF-VALUE.
MODIFY ICHARGE-HANDLE TransactionDesc =
ICHARGE-DESC-EF-VALUE.

MODIFY ICHARGE-HANDLE Sale() GIVING ICHARGE-RETURN-STATUS.

IF ICHARGE-RETURN-STATUS <> 0
MOVE "Error processing transaction" TO SCRN-LIT
PERFORM DSPLY-GUI-MSG
ELSE
INQUIRE ICHARGE-HANDLE ResponseApprovalCode
IN ICharge-Approval-Code-La-TITLE
MODIFY ICHARGE-APPROVAL-CODE-LA,
TITLE ICharge-Approval-Code-La-TITLE
INQUIRE ICHARGE-HANDLE ResponseAVSResult
IN ICharge-Response-AVS-La-TITLE
MODIFY ICharge-Response-AVS-La,
TITLE ICharge-Response-AVS-La-TITLE
INQUIRE ICHARGE-HANDLE ResponseCode
IN ICharge-Response-Code-La-TITLE
MODIFY ICharge-Response-Code-La,
TITLE ICharge-Response-Code-La-TITLE
INQUIRE ICHARGE-HANDLE ResponseCVVResult
IN ICharge-CVV2-Response-La-TITLE
MODIFY ICharge-CVV2-Response-La,
TITLE ICharge-CVV2-Response-La-TITLE
INQUIRE ICHARGE-HANDLE ResponseInvoiceNumber
IN ICharge-Invoice-No-La-TITLE
MODIFY ICharge-Invoice-No-La,
TITLE ICharge-Invoice-No-La-TITLE
INQUIRE ICHARGE-HANDLE ResponseText
IN ICharge-Response-Txt-La-TITLE
MODIFY ICharge-Response-Txt-La,
TITLE ICharge-Response-Txt-La-TITLE
INQUIRE ICHARGE-HANDLE ResponseTransactionId
IN ICharge-Trx-ID-La-TITLE
MODIFY ICharge-Trx-ID-La, TITLE ICharge-Trx-ID-La-TITLE
INQUIRE ICHARGE-HANDLE ResponseApproved
IN ICHARGE-APPROVAL-STATUS
IF ICHARGE-APPROVAL-STATUS = 0
MOVE "Transaction Approved" TO SCRN-LIT
PERFORM DSPLY-GUI-MSG
ELSE
MOVE "Transaction Declined" TO SCRN-LIT
PERFORM DSPLY-GUI-MSG
END-IF
END-IF.
.
*** End Code from Event editor.
0 Likes
14 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem getting property value

After debugging the program I feel the object is not getting created because the Handle number is very large, 14643336. Usually the handle number is a 4 or 5 byte number. I have attached a zip file containing the entire project. I am using AcuCobol 8.1 for this project and this will need to work in 7.2.2 as well.

I have also attachd a zip file of the ActiveX control I am trying to use.

Thanks again!
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem getting property value

The object is certainly being created, otherwise you should get an error when you execute the methods/properties.

Is your code based on a vb example? If so, can you provide the vb listing too?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem getting property value

The EpaymentIntegrator zip file that I attached in a previous post should have the sample VB Code in it. When you unzip the file it will be an EXE self extract install that will install the DLL, register it, and install all the samples. If it is not there or you just want the VB project let me know.

Thank you very much for your time and help and this is an important project for me and I am stuck and at a stand still.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem getting property value

I created my project to be almost an exact duplicate of the VB example they provided. I have zipped up the VB project so you can see it. I have to use VB 6.0 to open the project.

I am using the ICharge function of this DLL to start with and will add ECheck later.

Thanks,
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem getting property value

I don't know when I find time to look into it, but I will try to get to it.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem getting property value

Thank you very much gforseth!
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem getting property value

Turns out this is an ActiveX, then you cannot and should not use the CREATE verb.

Also, refrain from using component names as identifiers. Like in this case, ICharge is the name of the component, it will confuse the compiler and is why you did not get a clearer error message.

Source example (obviously not validated):

       IDENTIFICATION               DIVISION.
       PROGRAM-ID.                  IChargeDemo.
       ENVIRONMENT                  DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY "icharge.def".
           .
       WORKING-STORAGE SECTION.
       77  CNTL-FONT                USAGE HANDLE OF FONT SMALL-FONT.
       77  KEY-STATUS               IS SPECIAL-NAMES
           CRT STATUS               PIC 9(4) VALUE 0.
           88  EXIT-PRESSED         VALUE 27.
           88  ACTION-PRESSED       VALUE 28.
           88  ABOUT-PRESSED        VALUE 29.
       77  ICHARGE-RETURN-STATUS    PIC S9(9).
       SCREEN SECTION.
       01  Test-Screen.
       
           03 MyCharge              ICharge
              LINE                  01
              COL                   01
              VISIBLE               0.
                   
           03 Push-Button
              LINE                  25
              COL                   02
              SIZE                  14
              TITLE                 "Action"
              SELF-ACT
              EXCEPTION-VALUE       = 28.
                   
           03 Push-Button
              LINE                  25
              COL                   42
              SIZE                  14
              TITLE                 "About"
              SELF-ACT
              EXCEPTION-VALUE       = 29.
           03 Push-Button
              LINE                  25
              COL                   63
              SIZE                  14
              TITLE                 "Exit"
              SELF-ACT
              EXCEPTION-VALUE       = 27.
       PROCEDURE DIVISION.
       MAIN-LOGIC.
           DISPLAY STANDARD         GRAPHICAL WINDOW
                   TITLE            "Template"
                   CONTROL          FONT CNTL-FONT
                   SIZE             80
                   LINES            30
                   BACKGROUND-LOW.
           DISPLAY Test-Screen.
           PERFORM Charge-Initialize
           PERFORM WITH TEST AFTER  UNTIL EXIT-PRESSED
                   ACCEPT           Test-Screen
                   IF ACTION-PRESSED
                      PERFORM Do-Transaction
                   END-IF
                   IF ABOUT-PRESSED
                      MODIFY MyCharge AboutBox()
                   END-IF
           END-PERFORM.
           DESTROY Test-Screen.
           STOP    RUN.
           
       Charge-Initialize SECTION.
       Charge-Initialize-001.
       
           MODIFY  MyCharge         Reset().
           MODIFY  MyCharge         Gateway = 1.
           MODIFY  MyCharge         GatewayURL =
                   "[URL]https://test.authorize.net/gateway/transact.dll[/URL]".
           MODIFY  MyCharge         AddSpecialField(
                   BY NAME @Name    "x_test_request",
                   BY NAME @Val     "true").
           MODIFY  MyCharge AddSpecialField(
                   BY NAME @Name    "x_tran_key",
                   BY NAME @Val     "42z9w4Y83sQwFZyy").
                   
       Charge-Initialize-900.
       Charge-Initialize-EXIT.
           EXIT.
       Do-Transaction SECTION.
       Do-Transaction-001.
       
           MODIFY MyCharge         
                  CardCVV2Data      = "Some data"
                  CardExpMonth      = 12
                  CardExpYear       = 2010
                  CardNumber        = 1234567890123456
                  CustomerAddress   = "Disney Road 333"
                  CustomerCity      = "Anaheim"
                  CustomerCountry   = "US"
                  CustomerEmail     = "[EMAIL="DDuck@phone.com"]DDuck@phone.com[/EMAIL]"
                  CustomerFax       = " "
                  CustomerFirstName = "Donald"
                  CustomerId        = "12345-99cx"
                  CustomerLastName  = "Duck"
                  CustomerPhone     = "1 (333) 555 6666"
                  CustomerState     = "Disneyland"
                  CustomerZip       = "33555"
                  InvoiceNumber     = "1200333"
                  MerchantLogin     = 99032
                  MerchantPassword  = "Secret"
                  TransactionAmount = 1200
                  TransactionDesc  = "Rides and fun".
           MODIFY MyCharge          @Sale()
                  GIVING            ICHARGE-RETURN-STATUS.
           IF ICHARGE-RETURN-STATUS <> 0
               DISPLAY MESSAGE BOX "Error processing transaction"
           ELSE
               DISPLAY MESSAGE BOX "Success processing transaction"           
           END-IF.
       Do-Transaction-900.
       Do-Transaction-EXIT.
           EXIT.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem getting property value

Gforseth,

Thanks for your example, that helped a bunch. Here is what I have tried. In Acubench I am using the ActiveX contol box to add the ICharge control to my screen. As soon as I drop the control on the screen I get the following error;

"Design-time license for OCX.ICharge control missing. Loading control with place holder only..."

Is this a license error that I need to contact ICharge, or is there a file that AcuBench is looking for that I need to find and put in a particular place?

Thank you very much for your help!
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem getting property value

ActiveX components come with two types of licenses. One runtime (deployment) license for end users and one design time license. The difference between the two may be subtle, but significant.

Typically IDE's like Acubench, Visual Studio will instantiate an ActiveX in design time mode, for a variety of reasons. Most commonly to get access to method, properties not available at runtime.

In many cases, deployment of an ActiveX is free, but you have to buy the right to develop with it, e.g. you need to purchase a design time license.

So, if you have not purchased a design time license (developer version) of the ActiveX, this is expected behavior.

If you have purchased a design time license, there is a problem, but not with Acubench.

Hence, contacting ICharge is the correct solution.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem getting property value

I did contact ICharge and they told me there is not a design time license, only a runtime license. So now what?

Again thanks for your patience and help!
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem getting property value

They dont' have a design time license??? How can they use it with for instance Visual Studio then?

Note that a design time license is only an issue in two cases:

    • If you use an IDE. Which means if you hand code in an editor it will not be an issue.
    • If the component contains methods/properties that are not available at runtime. If they don't provide a design time license, this is probably not an issue.
    Hm... This is kind of odd though, I never heard of this before. Because if there is no license, it should be usable 'as is'.

    Why don't you check out the utility described on these two links:

    http://support.microsoft.com/kb/151771

    http://support.microsoft.com/kb/315501

    See what you get.

    If they claim there is no designtime license for the product and it doesn't check out with Acubench, but they say it works with for instance Visual Studio, I think you will have to contact Micro Focus Technical suppport on the topic.
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.