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 calls a routine from our Code Library.
Download BluePay.cs
Or, download via GitHub

* BluePay C#.NET 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.

using System;
using BluePayLibrary;

namespace Rebill
    class GetRecurringPaymentStatus
        public static void Main()
            string accountID = "Merchant's Account ID Here";
            string secretKey = "Merchant's Secret Key Here";
            string mode = "TEST";

            BluePay rebill = new BluePay

                firstName: "Bob",
                lastName: "Tester",
                address1: "1234 Test St.",
                address2: "Apt #500",
                city: "Testville",
                state: "IL",
                zip: "54321",
                country: "USA",
                phone: "123-123-12345",
                email: "[email protected]"
                ccNumber: "4111111111111111",
                ccExpiration: "1215",
                cvv2: "123"

            // Set recurring payment
                rebFirstDate: "2015-01-01", // Rebill Start Date: Jan. 1, 2015
                rebExpr: "1 MONTH", // Rebill Frequency: 1 MONTH
                rebCycles: "12", // Rebill # of Cycles: 12
                rebAmount: "15.00" // Rebill Amount: $15.00

            // Set a Card Authorization at $0.00
            rebill.Auth(amount: "0.00");

            // Makes the API Request

            // If transaction was approved..
            if (rebill.IsSuccessfulTransaction())

                BluePay rebillStatus = new BluePay

                // Find the rebill by ID and get rebill status

                // Makes the API Request

                // Reads the responses from BluePay
                Console.WriteLine("Rebill Status: " + rebillStatus.GetStatus());
                Console.WriteLine("Rebill ID: " + rebillStatus.GetRebillID());
                Console.WriteLine("Rebill Creation Date: " + rebillStatus.GetCreationDate());
                Console.WriteLine("Rebill Next Date: " + rebillStatus.GetNextDate());
                Console.WriteLine("Rebill Last Date: " + rebillStatus.GetLastDate());
                Console.WriteLine("Rebill Schedule Expression: " + rebillStatus.GetSchedExpr());
                Console.WriteLine("Rebill Cycles Remaining: " + rebillStatus.GetCyclesRemain());
                Console.WriteLine("Rebill Amount: " + rebillStatus.GetRebillAmount());
                Console.WriteLine("Rebill Next Amount: " + rebillStatus.GetNextAmount());
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.