Transaction Notification

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 makes method calls utilizing our ruby gem.
Download BluePay gem
Or, download via GitHub

# BluePay Ruby 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.

require_relative "../../lib/bluepay.rb"
require "cgi"

ACCOUNT_ID = "Merchant's Account ID Here"
SECRET_KEY = "Merchant's Secret Key Here"

tps = ACCOUNT_ID, secret_key: SECRET_KEY, mode: MODE)

vars =

# Assign values
trans_id = vars["trans_id"]
trans_status = vars["trans_status"]
trans_type = vars["trans_type"]
amount = vars["amount"]
batch_id = vars["batch_id"]
rebill_id = vars["rebill_id"]
rebill_amount = vars["reb_amount"]
rebill_status = vars["status"]
tps_hash_type = vars["TPS_HASH_TYPE"]
bp_stamp = vars["BP_STAMP"]
bp_stamp_def = vars["BP_STAMP_DEF"]

# Calculate expected bp_stamp
bp_stamp_string = ''
bp_stamp_def.split(' ').each do |field|
  bp_stamp_string += vars[field]
expected_stamp = tps.create_tps_hash(bp_stamp_string, tps_hash_type).upcase

# check if expected bp_stamp = actual bp_stamp
if expected_stamp == vars["BP_STAMP"]

  # Reads the response from BluePay
  puts 'Transaction ID: ' + trans_id
  puts 'Transaction Status: ' + trans_status
  puts  'Transaction Type: ' + trans_type
  puts  'Transaction Amount: ' + amount
  puts  'Rebill ID: ' + rebill_id
  puts  'Rebill Amount: ' + rebill_amount
  puts  'Rebill Status: ' + rebill_status
Can’t find what you’re
looking for? We can help.

Contact 800-350-2684 for Integration Support.

BluePay Processing, LLC is a registered ISO of Wells Fargo Bank, N.A., Concord, CA, 94524 U.S.A.
BluePay Canada ULC, is a Registered ISO/MSP of Peoples Trust Company, Vancouver, Canada.