Asp- php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • creative1
    Contributor
    • Sep 2007
    • 274

    Asp- php

    hi php developers,
    I am working on VBV authentication for a website. I am in final step but got in trouble. I believe people with ASP and PHP knowledge can help me as I don't know a word about ASP. I have code written in ASP that does the desired job:
    Code:
    Dim vbvRequest
    vbvRequest = "PaRes=" & request("PaRes") & "&MD=" & request("MD")
    XMLSendReqAuth(vbvRequest)
    
    Function XMLSendReqAuth(trnValue)
                set XMLstringreq = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
    
                XMLstringreq.setOption(3) = ""
                XMLstringreq.setTimeouts 60000, 30000, 30000, 90000
                XMLstringreq.Open "POST", "[URL="https://www.beanstream.com/scripts/process_transaction_auth.asp"]https://www.sitename.com/scripts/process_tran_auth.asp[/URL]", False
                XMLstringreq.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    
                XMLstringreq.Send (trnValue)
                trnResponse = XMLstringreq.ResponseText
                SendRequest = true
    End Function
    this pice of code does the desired job and has no problem I want my PHP page to do the same job but I get no approval message as response: Here is what I have done in PHP:
    Code:
    <?php
            $faripa= $_REQUEST["PaRes"];
            $faripd= $_REQUEST["MD"];                
            $vr=curl_init();
            curl_setopt( $vr, CURLOPT_POST, 1 );
            curl_setopt($vr, CURLOPT_SSL_VERIFYHOST,0);
            curl_setopt($vr, CURLOPT_SSL_VERIFYPEER, 0);
            curl_setopt( $vr, CURLOPT_RETURNTRANSFER, 1 );
            curl_setopt( $vr, CURLOPT_URL, "[COLOR=navy][FONT=&quot][URL="https://www.beanstream.com/scripts/process_transaction_auth.asp"]https://www.sitename.com/scripts/process_tran_auth.asp[/URL][/FONT][/COLOR]");  
            curl_setopt( $vr, CURLOPT_POSTFIELDS,"PaRes=$faripa&MD=$faripd");
             $txtResult = curl_exec($vr);
             curl_close($vr);
             echo $txtResult;                                      
                                                    
    ?>
    If I try to print PaRes or MD I guess no values.
    I hope I'll get some help here.
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi.

    The URL in your PHP code doesn't look quite right. (Line #9).
    Try fixing that.

    You should also turn on the debugging messages to see if there are any errors or warnings being issued.

    Comment

    • creative1
      Contributor
      • Sep 2007
      • 274

      #3
      curl_setopt( $vr, CURLOPT_URL, "https://www.beanstream. com/scripts/process_transac tion_auth.asp") ;
      this right code there.

      Comment

      • creative1
        Contributor
        • Sep 2007
        • 274

        #4
        I think the problem is SSL , the page I am trying to get the posted values needs to be secured. but thing is how I can make php code secure. I mean where to add script?

        Comment

        • Atli
          Recognized Expert Expert
          • Nov 2006
          • 5062

          #5
          When I use this code on my test server:
          [code=php]
          <?php
          $faripa = $_REQUEST["PaRes"];
          $faripd = $_REQUEST["MD"];

          $vr = curl_init();
          curl_setopt($vr , CURLOPT_POST, 1);
          curl_setopt($vr , CURLOPT_SSL_VER IFYHOST, 0);
          curl_setopt($vr , CURLOPT_SSL_VER IFYPEER, 0);
          curl_setopt($vr , CURLOPT_RETURNT RANSFER, 1);
          curl_setopt($vr , CURLOPT_URL, "https://www.beanstream. com/scripts/process_transac tion_auth.asp") ;
          curl_setopt($vr , CURLOPT_POSTFIE LDS, "PaRes=$faripa& MD=$faripd");
          $txtResult = curl_exec($vr);
          curl_close($vr) ;

          echo $txtResult;
          ?>[/code]
          I get this:
          Code:
          Declined. Missing or invalid merchant data.
          Which would indicate that the code is working, but that the data I'm passing isn't valid (obviously).

          How does the form you use to call this with look?
          Are you sure the REQUEST vales are being passed properly?

          Comment

          • creative1
            Contributor
            • Sep 2007
            • 274

            #6
            it is a Terminal Page b/w visa transection and VBV validation. It is supposed to get these two response variable in response to a VBV passowrd verification transaction (verification by visa). According to provided API code (i.e in ASP already posted here.) it is simple process of getting PaRes and MD as response and forwarding it back to the company taking care of our online transection.
            Now here 's what I am facing:
            On first instance I get message saying , Interupted... etc
            If I refresh page couple of times, Terminal page tries to call authorizing response page Pares and MD variable and as a result I get message , Card Declined.

            Comment

            Working...