Update a Transaction
This code steps you through the process of updating an existing transaction (i.e. for tips).
There are three outcomes when processing credit card transactions:
'Approved' transactions can be charged against customers' credit cards. 'Declined' transactions can't be charged. As a result, in order to test the process of charging a customer's credit card, you must first pass an odd dollar amount. This returns the transaction with an 'Approved' status. You can then charge the credit card to complete the transaction.
An error could result from a variety of conditions such as missing data, invalid card numbers, and expiration dates provided in invalid formats.
' * Bluepay VB.NET Sample code.
' * This code sample runs a $3.00 Credit Card Sale transaction
' * against a customer using test payment information. If
' * approved, a 2nd transaction is run to update the first transaction
' * to $5.75, $2.75 more than the original $3.00.
' * If using TEST mode, odd dollar amounts will return
' * an approval and even dollar amounts will return a decline.
Public Class UpdateTransaction
Public Shared Sub run()
Dim accountID As String = "Merchant's Account ID Here"
Dim secretKey As String = "Merchant's Secret Key Here"
Dim mode As String = "TEST"
Dim payment As BluePay = New BluePay(
address1:="12345 Test St.",
If payment.isSuccessfulTransaction() Then
Dim paymentUpdate As BluePay = New BluePay(
' Updates a transaction from previous sale
paymentUpdate.update(transactionID:= payment.GetTransID(), amount:="5.75")
Console.Write("Transaction Status: " + paymentUpdate.getStatus() + Environment.NewLine)
Console.Write("Transaction Message: " + paymentUpdate.getMessage() + Environment.NewLine)
Console.Write("Transaction ID: " + paymentUpdate.getTransID() + Environment.NewLine)
Console.Write("AVS Result: " + paymentUpdate.getAVS() + Environment.NewLine)
Console.Write("CVV2 Result: " + paymentUpdate.getCVV2() + Environment.NewLine)
Console.Write("Masked Payment Account: " + paymentUpdate.getMaskedPaymentAccount() + Environment.NewLine)
Console.Write("Card Type: " + paymentUpdate.getCardType() + Environment.NewLine)
Console.Write("Authorization Code: " + paymentUpdate.getAuthCode() + Environment.NewLine)
Console.Write("Transaction Error: " + payment.getMessage() + Environment.NewLine)
855-812-5191 to get access to the applicable integration modules.