ASP.Net: Integrate QuickBooks Payment Gateway API in your website for payment processing

Here  I am going to explain that how to integrate QuickBooks API in your website.

QuickBooks is a payment gateway based website which provides the way to integrate your business with accounting and processing your payments easily with it.

Run below function from your Visual Studio VB project

Protected Function getSession(ByVal Site As String)
    Dim req As WebRequest = WebRequest.Create(Site)
    Dim xmldom As New XmlDocument
    Dim request_xml As String
    Dim myWriter As StreamWriter
    xmldom.Load(Server.MapPath("~\input.xml"))
    request_xml = xmldom.InnerXml

    req.Method = "POST"
    req.ContentLength = request_xml.Length
    req.ContentType = "application/x-qbmsxml"
    myWriter = New StreamWriter(req.GetRequestStream)
    myWriter.Write(request_xml)
    myWriter.Close()

    Dim resp As WebResponse = req.GetResponse()

    Dim s As Stream = resp.GetResponseStream()
    Dim sr As StreamReader = New StreamReader(s, Encoding.ASCII)
    Dim doc As String = sr.ReadToEnd()

    Return doc
End Function

Where “input.xml” is a file which consist your XML parameters with Credit Card information.

Take a look that how “input.xml” file can be:

https://developer.intuit.com/docs/030_qbms/0070_advanced_topics/payment_wallet

and Call above function where you want to call.

As:

getSession("https://merchantaccount.ptc.quickbooks.com/j/AppGateway")

Enjoy…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s