Get a Recurring Payment Status

This code steps you through the process of establishing a rebilling transaction for the purpose of assigning a Transaction ID. You can then use this Transaction ID to check the status of rebilling in the future.

This code uses BluePay's Rebilling Administration Interface.
For documentation on usage of this interface Go to: Library documentation

You can test for both outcomes:

Approved: When you pass odd dollar amounts, this returns an 'Approved' status.
Declined: When you pass even dollar amounts, this returns a 'Declined' status.

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 runs a $0.00 Credit Card Auth transaction
# against a customer using test payment information.
# Once the rebilling cycle is created, this sample shows how to
# get information back on this rebilling cycle.
# See comments below on the details of the initial setup of the
# rebilling cycle.

require_relative "../../lib/bluepay.rb"

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

rebill =
  account_id: ACCOUNT_ID, 
  secret_key: SECRET_KEY, 
  mode: MODE

  first_name: "Bob",
  last_name: "Tester",
  address1: "123 Test St.",
  address2: "Apt #500",
  city: "Testville",
  state: "IL",
  zip_code: "54321",
  country: "USA",
  phone: "123-123-1234", 
  email: "[email protected]"

  cc_number: "4111111111111111", # Customer Credit Card Number
  cc_expiration: "1225", # Card Expiration Date: MMYY
  cvv2: "123" # Card CVV2

  reb_first_date: "2015-01-05", # Rebill Start Date: Jan. 5, 2015
  reb_expr: "1 MONTH", # Rebill Frequency: 1 MONTH
  reb_cycles: "11", # Rebill # of Cycles: 11
  reb_amount: "15.00" # Rebill Amount: $15.00

# Sets a Card Authorization at $0.00
rebill.auth(amount: "0.00")

# Makes the API Request to create a recurring payment

# If transaction was successful..
if rebill.successful_transaction?
  rebill_status =
    account_id: ACCOUNT_ID, 
    secret_key: SECRET_KEY, 
    mode: MODE

  # Find the rebill by ID and get rebill status

  # Makes the API Request to get the rebill status

  # Reads the response from BluePay
  puts "REBILL STATUS: " + rebill_status.get_rebill_status
  puts "REBILL ID: " + rebill_status.get_reb_id
  puts "REBILL CREATION DATE: " + rebill_status.get_creation_date
  puts "REBILL NEXT DATE: " + rebill_status.get_next_date
  puts "REBILL LAST DATE: " + rebill_status.get_last_date
  puts "REBILL SCHEDULE EXPRESSION: " + rebill_status.get_sched_expression
  puts "REBILL CYCLES REMAINING: " + rebill_status.get_cycles_remaining
  puts "REBILL AMOUNT: " + rebill_status.get_rebill_amount
  puts "REBILL NEXT AMOUNT: " + rebill_status.get_next_amount
  puts rebill.get_message
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.