×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Hi, 

I'm working with Java trying to authorize credit card transactions using
Verisign.
The error the I get is:
"RESULT=-31&RESPMSG=The certificate chain did not validate, no local
certificate found, Cert Path =
/QIBM/ProdData/Java400/verisign/payflowpro/java/certs/, Working Directory =
QIBM/ProdData/Java400/verisign/payflowpro/java"

The certificate file "f73e89fd.0" is under "certs" directory and should be
found according the "Cert Path".

I think authorize credit card transactions using Verisign is posible because
I read the "Shannon O'Donnell"  example in this user group.   I read all the
threads and looks like it's working for him but he didn't have this error.
I attached his example.

If anybody has an idea about this issue please send me an e-mail.
Thank you.

Alberto Zeledón M.
Technical Consultant
THE PREMIER GROUP
Turning Breakthrough Ideas into Action with J.D. Edwards Solutions
Visit us on the Internet at http://www.premierway.com/
Telephone: (305) 567-3188 x228
Facsimile..: (305) 567-9488
alberto_zeledon@xxxxxxxxxxxxxx

=======================================================================
=======================================================================
Calling Java from RPG - CLASSPATH Problem?

*       Subject: Calling Java from RPG - CLASSPATH Problem? 
*       From: "Shannon O'Donnell" <sodonnell@xxxxxxxxxxxxxxx> 
*       Date: Wed, 9 Jul 2003 13:54:22 -0500 
*       List-archive: <<http://archive.midrange.com/java400-l>> 
*       List-help: <<mailto:java400-l-request@xxxxxxxxxxxx?subject=help>> 
*       List-id: Java Programming on and around the iSeries /
AS400<java400-l.midrange.com> 
*       List-post: <<mailto:java400-l@xxxxxxxxxxxx>> 
*       List-subscribe:
<<http://lists.midrange.com/mailman/listinfo/java400-l>>,<<mailto:java400-l-
request@xxxxxxxxxxxx?subject=subscribe>> 
*       List-unsubscribe:
<<http://lists.midrange.com/mailman/listinfo/java400-l>>,<<mailto:java400-l-
request@xxxxxxxxxxxx?subject=unsubscribe>> 

Hi,

I have been able to successfully call a java app from a CL program, after
much 
finagling of the CLASSPATH.

Now I want to do the same thing in RPGIV, but running into a CLASSPATH (I 
guess...) problem again.  I've included the code here since it's short, and 
hopefully someone will be able to point out an error or two I might be
making. 
Basically though, when I run it, I get an error:  "...received Java
exception:  
"java.lang.NoClassDefFoundError:" when calling method "<init>" with
signature 
"()V" in class 
"/QIBM/ProdData/Java400/verisign/payflowpro/Java/PFProJavaReturns".

Here's the java code and the RPG code. Both are short....

====================================================
import com.Verisign.payment.PFProAPI;
class PFProJavaReturns {
 // Set defaults
 static String HostAddress   = "test-payflow.verisign.com";
 static Integer HostPort = Integer.decode("443");
 static String ParmList      = "";
 static Integer Timeout = Integer.decode("30");
 static String ProxyAddress  = "";
 static Integer ProxyPort = Integer.decode("0");
 static String ProxyLogon    = "";
 static String ProxyPassword = "";
 static String ReturnResponse = "";

   public static void main(String InputParms[])
   {
    // Place the arguments in the correct variables

  try {
   HostAddress   = InputParms[0];
   HostPort       = Integer.decode(InputParms[1]);
   ParmList      = InputParms[2];
   Timeout       = Integer.decode(InputParms[3]);
   ProxyAddress  = InputParms[4];
   ProxyPort     = Integer.decode(InputParms[5]);
   ProxyLogon    = InputParms[6];
   ProxyPassword = InputParms[7];
  } catch (Exception e) { }

               PFProJavaReturns c = new PFProJavaReturns();
   }

   public PFProJavaReturns()
    {
      String responses = autCard();
    }

// *CONSTRUCTOR With ZERO Parms
  protected String autCard()
     {          
         PFProAPI pn = new PFProAPI();
        // Set the certificate path
        
pn.SetCertPath("/QIBM/ProdData/Java400/verisign/payflowpro/java/certs/");
  // Call the client.
  pn.CreateContext(HostAddress,
                         HostPort.intValue(),
                         Timeout.intValue(),
                         ProxyAddress,
                         ProxyPort.intValue(),
                         ProxyLogon,
                         ProxyPassword);
  String rc = pn.SubmitTransaction(ParmList);
  ReturnResponse = rc;
  pn.DestroyContext();
  return ReturnResponse;
     }


// *CONSTUCTOR with All Parms

  protected String autCard(String args[])
     {    
         try {
   HostAddress   = args[0];
   HostPort      = Integer.decode(args[1]);
   ParmList      = args[2];
   Timeout       = Integer.decode(args[3]);
   ProxyAddress  = args[4];
   ProxyPort     = Integer.decode(args[5]);
   ProxyLogon    = args[6];
   ProxyPassword = args[7];
  } catch (Exception e) { }
         
   PFProAPI pn = new PFProAPI();
   // Set the certificate path
   pn.SetCertPath("/QIBM/ProdData/Java400/verisign/payflowpro/java/certs/");

  // Call the client.
  pn.CreateContext(HostAddress,
                         HostPort.intValue(),
                         Timeout.intValue(),
                         ProxyAddress,
                         ProxyPort.intValue(),
                         ProxyLogon,
                         ProxyPassword);

  String rc = pn.SubmitTransaction(ParmList);
  ReturnResponse = rc;
  pn.DestroyContext();
  return ReturnResponse;
 }
}
========================================
========================================

 And here's the RPGIV program to call it:


     H thread(*serialize) DFTACTGRP(*NO)
      * Declare object refernce variable
     D obj_ref         S               O
CLASS(*JAVA:'/QIBM/ProdData/Java400/-
     D
verisign/payflowpro/Java/PFProJava-
     D                                     Returns')
     D string          S               O   CLASS(*JAVA:'java.lang.String')

      * Prototype procedure to create java String object
     D newString       PR              O   EXTPROC(*JAVA:
     D                                             'java.lang.String':
     D                                             *CONSTRUCTOR)
     D                                     CLASS(*JAVA:'java.lang.String')
     D charParm                    2000A   CONST VARYING

      * Prototype procedure to instantiate 'PFProJava' class
     D PFProJava       PR              O
     D                                     EXTPROC(*JAVA:
     D                                             '/QIBM/ProdData/Java400/-
     D                                     verisign/payflowpro/Java-
     D                                     /PFProJavaReturns':
     D                                             *CONSTRUCTOR)

      * Prototype procedure to accept the credit card info STRING Object
     D PFProAut        PR          2000a
     D                                     EXTPROC(*JAVA:
     D                                             '/QIBM/ProdData/Java400/-
     D                                     verisign/payflowpro/Java-
     D                                     /PFProJavaReturns':
     D                                             'autCard')
     D stringParm                          LIKE(string)


     D Response        S           2000a   Varying
     D Input_String    S            100A   VARYING
     D OutResponse     S           2000a
     D Cmd             s           1024a
     D CmdString       S            200a
     D Cmds            PR                  ExtPgm('QCMDEXC')
     D   command                    200A   const
     D   length                      15P 5 const
     D Apost           S              1a   Inz('''')

      /Free

     // Define a test data string to send to Verisign

       Input_String ='test-payflow.verisign.com 443 '  +
       '"USER=myusernameokoko&VENDOR=&PARTNER=mypartne&PWD=mypwdidisok2' +
       '&TRXTYPE=S&TENDER=C&ACCT=4222222222222&EXPDATE=1209&AMT=14.42' +
       '&COMMENT=Good Customer&INVNUM=1234567890&STREET=5199 ' +
       'JOHNSON&ZIP=94588"' + ' 30';

     // Convert alphanumeric string to java String object
                   string = newString(Input_String);

     // Instantiate the 'PFProJava' class
                   obj_ref = PFProJava();

        //  Call the 'autCard' method in class 'PFProJavaReturns'
                     Response = PFProAut(obj_ref:string);

                     OutResponse = Response;

                     *Inlr = *On;

      /End-Free


Thanks in Advance!

Shannon O'Donnell
=======================================================================
=======================================================================


Alberto Zeledón M.
Technical Consultant
THE PREMIER GROUP
Turning Breakthrough Ideas into Action with J.D. Edwards Solutions
Visit us on the Internet at http://www.premierway.com/
Telephone: (305) 567-3188 x228
Facsimile..: (305) 567-9488
alberto_zeledon@xxxxxxxxxxxxxx



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.