This code steps you through the basics of configuring Web Hooks to handle data that gets posted to a URL that's associated with your BluePay Platform Account. When you're using this code in "test mode," only test transactions are returned.

Please contact our integration team with your gateway account ID & the URL of your receiving script to have this feature enabled.

The following sample code calls a routine from our Code Library.
Download BluePay.vb
Or, download via GitHub

* Bluepay VB.NET Sample code.
* This code sample shows a very based approach
* on handling data that is posted to a script running
* a merchant's server after a transaction is processed
* through their BluePay gateway account.

Imports System
Imports vbnet.BPVB
Imports System.IO
Imports System.Collections.Specialized
Imports System.Web
Imports System.Net

Namespace GetData

    Public Class TransactionNotification

        Public Sub New()
        End Sub

        Public Shared Sub run()
            Dim listener As HttpListener = New HttpListener()
            Dim secretKey As String = ""
            Dim response As String = ""

                'Listen for incoming data
            Catch ex As HttpListenerException
            End Try
            While (listener.IsListening)
                Dim context = listener.GetContext()
                Dim body = New StreamReader(context.Request.InputStream).ReadToEnd()

                Dim b() As Byte = System.Text.Encoding.UTF8.GetBytes("ACK")

                ' Return HTTP Status of 200 to BluePay
                context.Response.StatusCode = 200
                context.Response.KeepAlive = False
                context.Response.ContentLength64 = body.Length

                Dim output = context.Response.OutputStream
                output.Write(b, 0, b.Length)

                ' Get Response
                Using reader As New System.IO.StreamReader(output)
                    response = reader.ReadToEnd()
                End Using
            End While

            ' Parse data into a NVP collection
            Dim vals As NameValueCollection = HttpUtility.ParseQueryString(response)
            Dim transID As String = vals("trans_id")
            Dim transStatus As String = vals("trans_stats")
            Dim transType As String = vals("trans_type")
            Dim amount As String = vals("amount")
            Dim batchID As String = vals("batch_id")
            Dim batchStatus As String = vals("batch_status")
            Dim totalCount As String = vals("total_count")
            Dim totalAmount As String = vals("total_amount")
            Dim batchUploadID As String = vals("batch_upload_id")
            Dim rebillID As String = vals("rebill_id")
            Dim rebillAmount As String = vals("rebill_amount")
            Dim rebillStatus As String = vals("rebill_status")

            ' calculate the expected BP_STAMP
            Dim bpStamp = calcTransNotifyTPS(secretKey,

            ' Output data if the expected bp_stamp matches the actual BP_STAMP
            If bpStamp = vals("bp_stamp") Then
                Console.Write("Transaction ID: " + transID)
                Console.Write("Transaction Status: " + transStatus)
                Console.Write("Transaction Type: " + transType)
                Console.Write("Transaction Amount: " + amount)
                Console.Write("Rebill ID: " + rebillID)
                Console.Write("Rebill Amount: " + rebillAmount)
                Console.Write("Rebill Status: " + rebillStatus)
                Console.Write("ERROR IN RECEIVING DATA FROM BLUEPAY")
            End If

        End Sub
    End Class
End Namespace
BluePay Processing, LLC is a registered ISO of Wells Fargo Bank, N.A., Walnut Creek, CA, U.S.A.
BluePay Canada ULC, is a Registered ISO/MSP of Peoples Trust Company, Vancouver, Canada.