Solved

Any one Help me I want to convert vb code  to c# code

Posted on 2007-11-15
3
286 Views
Last Modified: 2008-03-06
Private Function GetAuthCode(ByVal pVisaType As String, ByVal pCustID As String, ByVal pCustName As String, ByVal pCustPhone As String, ByVal pCCNO As String, ByVal pCVVNO As String, ByVal pEMail As String, ByVal pCCExpMonth As String, ByVal pCCExpYear As String, ByVal pCSUID As String, ByVal pbtaAdd1 As String, ByVal pbtaAdd2 As String, ByVal pbtaAdd3 As String, ByVal pbtaCity As String, ByVal pbtaState As String, ByVal pbtaZip As String, ByVal pbtaCountry As String, ByVal pstaAdd1 As String, ByVal pstaAdd2 As String, ByVal pstaAdd3 As String, ByVal pstaCity As String, ByVal pstaState As String, ByVal pstaZip As String, ByVal pstaCountry As String, ByRef pMerchant As Merchant) As String
     Dim sAuthCode As String
    Dim sqltext As String
    Dim sBillAdd As String
     sBillAdd = pbtaAdd1 & ", " & pbtaAdd2 & ", " & pbtaAdd3 & ", " & pbtaCity & ", " & pbtaState & ", " & pbtaZip & ", " & pbtaCountry
     Set oPostLib = New PostLib
     Set oCInfo = New CardInfo
    Set oMPI = New MPIData
     Set oBTA = New BillToAddress
     Set oSTA = New ShipToAddress
     Set oPGResp = New PGResponse
     oBTA.setAddressDetails pCustID, pCustName, pbtaAdd1, pbtaAdd2, pbtaAdd3, pbtaCity, pbtaState, pbtaZip, pbtaCountry, pEMail
     oSTA.setAddressDetails pstaAdd1, pstaAdd2, pstaAdd3, pstaCity, pstaState, pstaZip, pstaCountry, pEMail
     oCInfo.setCardDetails pVisaType, pCCNO, pCVVNO, pCCExpYear, pCCExpMonth, pCustName, "CREDI"
   oMPI.setMPIResponseDetails "05", "NTBlZjRjMThjMjc1NTUxYzk1MTY=", "", "", "", ""
    Set oPGResp = oPostLib.postMOTO(oCInfo, oMPI, pMerchant, oBTA, oSTA)
   sAuthCode = oPGResp.getAuthIdCode
    pPNRNO = oPGResp.getRRN & ""
   On Error GoTo TrapError
    GetAuthCode = sAuthCode
   Exit Function
TrapError:
    GetAuthCode = sAuthCode & "@sqlQuery@" & sqltext
End Function
0
Comment
Question by:sitg
3 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 250 total points
Comment Utility

private string GetAuthCode(string pVisaType, string pCustID, string pCustName string pCustPhone,

    string pCCNO, string pCVVNO, string pEMail, string pCCExpMonth, string pCCExpYear,

    string pCSUID, string pbtaAdd1, string pbtaAdd2, string pbtaAdd3, string pbtaCity,

    string pbtaState, string pbtaZip, string pbtaCountry, string pstaAdd1, string pstaAdd2,

    string  pstaAdd3, string pstaCity, string pstaState, string pstaZip, string pstaCountry,

    ref Merchant pMerchant)
 

        string sAuthCode, sqltext, sBillAdd;
 

        sBillAdd = string.Format("{0}, {1}, {2}, {3}, {4}, {5}, {6}", pbtaAdd1, pbtaAdd2,

            pbtaAdd3, pbtaCity, pbtaState, pbtaZip, pbtaCountry);

        PostLib oPostLib = new PostLib();

        CardInfo oCInfo = new CardInfo();

        MPIData oMPI = new MPIData();

        BillToAddress oBTA = new BillToAddress();

        ShipToAddress oSTA = new ShipToAddress();

        PGResponse oPGResp = new PGResponse();
 

     oBTA.setAddressDetails(pCustID, pCustName, pbtaAdd1, pbtaAdd2, pbtaAdd3, pbtaCity, pbtaState, pbtaZip, pbtaCountry, pEMail);

     oSTA.setAddressDetails(pstaAdd1, pstaAdd2, pstaAdd3, pstaCity, pstaState, pstaZip, pstaCountry, pEMail);

     oCInfo.setCardDetails(pVisaType, pCCNO, pCVVNO, pCCExpYear, pCCExpMonth, pCustName, "CREDI"

   oMPI.setMPIResponseDetails, "05", "NTBlZjRjMThjMjc1NTUxYzk1MTY=", "", "", "", "");

    oPGResp = oPostLib.postMOTO(oCInfo, oMPI, pMerchant, oBTA, oSTA);

    sAuthCode = oPGResp.getAuthIdCode();

    pPNRNO = oPGResp.getRRN.ToString();
 

    try

    {

        GetAuthCode = sAuthCode

    }

    catch

    {

        GetAuthCode = sAuthCode + "@sqlQuery@" + sqltext;

    }

}

Open in new window

0
 
LVL 18

Assisted Solution

by:ChetOS82
ChetOS82 earned 250 total points
Comment Utility
private string GetAuthCode(string pVisaType, string pCustID, string pCustName, string pCustPhone, string pCCNO, string pCVVNO, string pEMail, string pCCExpMonth, string pCCExpYear, string pCSUID,
string pbtaAdd1, string pbtaAdd2, string pbtaAdd3, string pbtaCity, string pbtaState, string pbtaZip, string pbtaCountry, string pstaAdd1, string pstaAdd2, string pstaAdd3,
string pstaCity, string pstaState, string pstaZip, string pstaCountry, ref Merchant pMerchant)
{
      string sAuthCode;
      string sqltext;
      string sBillAdd;
      sBillAdd = pbtaAdd1 + ", " + pbtaAdd2 + ", " + pbtaAdd3 + ", " + pbtaCity + ", " + pbtaState + ", " + pbtaZip + ", " + pbtaCountry;

      PostLib oPostLib = new PostLib();
      CardInfo oCInfo = new CardInfo();
      MPIData oMPI = new MPIData();
      BillToAddress oBTA = new BillToAddress();
      ShipToAddress oSTA = new ShipToAddress();
      PGResponse oPGResp = new PGResponse();

      oBTA.setAddressDetails(pCustID, pCustName, pbtaAdd1, pbtaAdd2, pbtaAdd3, pbtaCity, pbtaState, pbtaZip, pbtaCountry, pEMail);
      oSTA.setAddressDetails(pstaAdd1, pstaAdd2, pstaAdd3, pstaCity, pstaState, pstaZip, pstaCountry, pEMail);
      oCInfo.setCardDetails(pVisaType, pCCNO, pCVVNO, pCCExpYear, pCCExpMonth, pCustName, "CREDI");
      oMPI.setMPIResponseDetails("05", "NTBlZjRjMThjMjc1NTUxYzk1MTY=", "", "", "", "");

      oPGResp = oPostLib.postMOTO(oCInfo, oMPI, pMerchant, oBTA, oSTA);
      sAuthCode = oPGResp.getAuthIdCode();
      pPNRNO = oPGResp.getRRN();

      try {
            return sAuthCode
      } catch (Exception ex) {
            return sAuthCode + "@sqlQuery@" & sqltext;
      }
}
0
 

Author Comment

by:sitg
Comment Utility
thanks
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now