URL Generator: Ruby

This code steps you through the basics of generating a URL on-the-fly to one of BluePay's Simple Hosted Payment Forms (SHPF).

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

require_relative "bluepay.rb"

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

test_url = BluePay.new(
  account_id: ACCOUNT_ID, 
  secret_key: SECRET_KEY, 
  mode: MODE

generated_url = test_url.generate_url(
merchant_name: "Test Merchant",
return_url: "www.google.com",
transaction_type: "SALE",
accept_discover: "Yes",
accept_amex: "Yes",
amount: "99.99",
protect_amount: "Yes",
rebilling: "Yes",
reb_protect: "Yes",
reb_amount: "50",
reb_cycles: "12",
reb_start_date: "1 MONTH",
reb_frequency: "1 MONTH",
custom_id: "MyCustomID1.1234",
protect_custom_id: "Yes",
custom_id2: "MyCustomID2.12345678910",
protect_custom_id2: "Yes",
payment_template: "mobileform01",
receipt_template: "defaultres2",
receipt_temp_remote_url: ""

puts "Hosted Payment Form URL: " + generated_url
Can’t find what you’re
looking for? We can help.

Contact 800-350-2684 for Integration Support.

  • Microsoft Gold Partner Badge
  • 2018 American Business Awards Gold Stevie® Winner Badge for Best Payment and Electronic Commerce Solution
  • 2018 CNP Awards Customer Choice Winner Badge for Best E-Commerce Platform/Gateway
  • Best in Biz Awards 2018 Silver Winner Badge for Business Development Department of the Year
  • TSG Gateway Awards 2019 BluePay
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.