[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] [External]Re: HTTPAPI - Credit card settlement issues logging/debugging question..



Farhan,

I wrote the http_url_post_raw() that this code references, but I didn't write the rest of it.  Some of the things it is doing are not my style, for example I would not define a standalone variable that begins with "pe" because "pe" was my naming convention for a variable that was received into a routine from a parameter.

I'm guessing that someone borrowed some of my code and decided to put my open source license at the top.  Not sure why they'd include my license in their own code, perhaps they didn't understand what it was for.  At any rate, I'm not familiar with this code.  

If you can show us the part that calls http_url_post_raw() or any of the other subprocedures that are part of HTTPAPI, then we could perhaps provide some suggestions.

Thanks!

-SK


On 10/29/2020 4:41 AM, Farhan Qadri wrote:

Hi Scott,

 

This has gotten more confusing now as this program has all your comments on top. This may not be related to HTTPAPI project but definitely some other project that you did and someone copied into HTTPAPI library on our box for usage.

 

I emailed that program from the client site and it will take a day for me to get it. I will share the program when I get it on my email.

 

As I said, this program is what we use as part of our call to credit card settlement process and get a response back on it from the provider side and for some weeks getting a response which is not correct in some way and most orders gets settled on the provider side but showing error on our side due to response codes we are getting.

 

Snippet of the program here, which is customized from your original code. Dates show from 2008:

 

********************************************************************************

*                                                                              

*  Copyright (c) 2001-2007 Scott C. Klement                                    

*  All rights reserved.                                                        

*                                                                              

*  Redistribution and use in source and binary forms, with or without          

*  modification, are permitted provided that the following conditions          

*  are met:                                                                    

*  1. Redistributions of source code must retain the above copyright           

*     notice, this list of conditions and the following disclaimer.            

*  2. Redistributions in binary form must reproduce the above copyright        

*     notice, this list of conditions and the following disclaimer in the      

*     documentation and/or other materials provided with the distribution.     

*                                                                              

*  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ''AS IS'' AND      

*  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE       

*  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE  

*  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE     

*  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL  

*  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS     

*  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)       

*  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT  

*  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY   

*  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF                    *

*  SUCH DAMAGE.                                                                              *

*                                                                                            *

**********************************************************************************************

H DFTACTGRP(*NO) ACTGRP(*NEW) BNDDIR('HTTPAPI')                                                

 **********************************************************************************************

*                                                                                            *

D/copy op_libhttp/qrpglesrc,httpapi_h                                                         

 *                                                                                            *

**********************************************************************************************

* Prototype for incoming http response data                                                  *

**********************************************************************************************

D incoming        PR            10I 0                                                          

D   descriptor                  10I 0 value                                                   

D   data                      8192A   options(*varsize)                                       

D   datalen                     10I 0 value                                                   

 *                                                                                            *

**********************************************************************************************

* general use fields                                                                         *

**********************************************************************************************

D rc              s             10I 0                                      return code        

D msg             s             52A                                        message text       

D CRLF            C                   CONST(x'0d25')                       CR - LF            

D data            S           2048A                                        data to send to URL

D retdata         S          32766A                                        data returned from 

D retlen          S             10I 0                                      returned data len  

D nextpos         S             10I 0 inz(1)                               next position      

 * prototype parameters                                                                       *

D peURL           s           1024                                         entry:send to URL  

D peTimeout       s             10I 0                                      entry:wait seconds 

D peContentType   s             64                                         entry:content type 

 * snddtaq parms                                                                              *

d dqName          s             10                                         dtaq data length   

d dqLibr          s             10                                         dtaq data length   

d dqKeyLen        s              3  0                                      dtaq data length   

d dqKey           s             10                                         dtaq data length   

d dqLen           s              5  0                                      dtaq data length   

d dqData          s           2048                                         dtaq data          

 * entry parameters                                                                           *

D eURL            s           1024                                         entry:send to URL  

D eData           s           2048                                         entry:data to send 

D eTimeout        s             10I 0                                      entry:wait seconds 

D eContentType    s             64                                         entry:content type 

D eAsciiCvt       s              1                                         entry:Cvt to ASCII 

D eRetData        s           2048                                         entry:Returned data

D eErrFlag        s              1                                         Rtrn:Error flag    

 *                                                                                            *

* PROGRAM INFORMATION DATA STRUCTURE, OTHER FIELDS ARE AVAILABLE                             *

**********************************************************************************************

D                SDS                                                                          *

D daWSID                244    253                                                            *

D daUser                        10                                                            *

*                                                                                            *

*                                                                                            *

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                       *

*  http_url_post_raw(): Post data to CGI script and get document                             *

*                                                                                            *

*         peURL = url to post to (http://www.blah.com/cgi-bin/etc)                           *

*    pePostData = pointer to data to post to CGI script.                                     *

* pePostDataLen = length of data to post to CGI script.                                      *

*         peFD  = FD to pass back to peProc                                                  *

*       peProc  = procedure to call each time data is received.                              *

*    peTimeout  = (optional) give up if no data is received for                              *

*            this many seconds.                                                              *

*  peUserAgent  = (optional) User-Agent string passed to the                                 *

*            server.  Pass the named constant HTTP_USERAGENT                                 *

*            if you want to get the default value.                                           *

* peContentType = (optional) content type to supply (mainly                                  *

*            useful when talking to CGI scripts)                                             *

*  peSOAPAction = (optional) string used to specify the action                               *

*          taken by some SOAP applications.                                                  *

*                                                                                            *

*  Returns  (same as http_url_post)                                                          *

*                                                                                            *

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                       *

* http_url_post_raw...                                                                       *

*                PR            10I 0                                                         *

* peURL                     32767A   varying const options(*varsize)                         *

* pePostData                     *   value                                                   *

* pePostDataLen                10I 0 value                                                   *

* peFD                         10I 0 value                                                   *

* peProc                         *   value procptr                                           *

* peTimeout                    10I 0 value options(*nopass)                                  *

* peUserAgent                  64A   const options(*nopass:*omit)                            *

* peContentType                64A   const options(*nopass:*omit)                            *

* peSOAPAction                 64A   const options(*nopass:*omit)                            *

*                                                                                            *

*                                                                                            *

******************************************************                                       *

* Entry parameter                                                                            *

c     *ENTRY        plist                                                                     

c                   parm                    eURL                                              

c                   parm                    eData                                             

c                   parm                    eTimeout                                          

c                   parm                    eContentType                                      

c                   parm                    eAsciiCvt                      entry:Cvt to ASCII 

 * result parms                                                                               *

c                   parm                    eRetData                       out: data received 

c                   parm                    eErrFlag                       out: error flag    

 *                                                                                            *

******************************************************                                       *

*  MAINLINE                                          *                                       *

******************************************************                                       *

*                                                                                            *

******************************************************                                       *

* Initialize                                                                                 *

******************************************************                                       *

c                   clear                   eRetData                                          

c                   clear                   eErrFlag                                          

 *                                                                                            *

* blank out entry parms if beginning of fields are empty                                     *

c                   if        %subst(eURL:1:10) = *blanks                  entry:send to URL  

c                   clear                   eURL                                              

c                   end                                                                       

c                   if        %subst(eData:1:10) = *blanks                 entry:data to send 

c                   clear                   eData                                             

c                   end                                                                       

c                   if        %subst(eContentType:1:10) = *blanks          entry:content type 

c                   clear                   eContentType                                      

..

.

.

.

.

.

.

.

 

If this could help you or team remember anything about it.

 

Thanks

Farhan

 

 

From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx> On Behalf Of Scott Klement
Sent: Wednesday, October 28, 2020 9:18 PM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: [External]Re: [Ftpapi] HTTPAPI - Credit card settlement issues logging/debugging question..

 

Hello Farhan,

HTTPAPI does not have an interface like the code example you've posted.   You cannot access it via CALL/PARM like that.

Are you certain that you are using HTTPAPI?  This code doesn't look familiar at all.

-SK

 

On 10/28/2020 5:21 AM, Farhan Qadri wrote:

Hi  Guys/Gurus,

 

I am a new bee to this mailing list and also to HTTPAPI programs and usages. I have a situation that one of our client company is having issues in settlement of credit cards using HTTP_POST procedure under HTTPAPI. The bad thing is that it works for 25% or more of orders correctly and seems like sending wrong feedback or response to us for many other orders which gets settled at bank when we inquire the client. But at the end of the day we have to go through a manual process of finding out how many got settled and how many have wrong statuses and needs to set their statuses accordingly to get those orders to next invoice process every day for the past month or so.

 

I am exhausted to read those programs and how they get feedback from the calls to API’s but still am not close enough to even ask what to look and how to look at things. Have gone through many documentations on HTTPAPI from Scott and also FTPAPI mailing list for many thread but seems like we have experienced people talking and getting answers.

 

Our iseries at client is at V7R3M0 and we have secure socket layer protocols at:

Protocols

*TLSV1.2

*TLSV1.1

*TLSV1  

*SSLV3  

 

We have even copied the installed library LIBHTTP from another client which did recent install to adapt new protocols but to no avail.

 

Our Authorization and settlement program calls HTTP_POST program as follows:

 

* send http post for auth request                                                           

C                   CALL      'HTTP_POST'                          99                        

C                   PARM      dsURL         eURL                                              

C                   PARM      dqData        eData                                            

C                   PARM      TPWAIT        eTimeout                                         

C                   PARM      *blanks       eContentType                                     

C                   PARM      *blanks       eAsciiCvt                      entry:Cvt to ASCII

 *                                                                                            

C                   PARM      *blanks       eRetData                       Rtrn:data received

C                   PARM      *blanks       eErrorText                     Rtrn:Error text   

  

Please ask relevant questions so I can give feedback.

 

My only question at this moment is what to inquire and how and what to debug to get to the bottom of this strange phenomenon to get any answers. I have never worked with this API before and have inherited recently to support it.

 

Thanks and regards

Farhan  



The information transmitted is intended only for the person or entity to which it is addressed and may contain proprietary, business-confidential and/or privileged material. If you are not the intended recipient of this message you are hereby notified that any use, review, retransmission, dissemination, distribution, reproduction or any action taken in reliance upon this message is prohibited. If you received this in error, please contact the sender and delete the material from any computer.


-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi