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.
Or, download via GitHub

* BluePay Java 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.

package rebill;
import bluepay.*;
import java.util.HashMap;

public class Get_Recurring_Payment_Status {

  public static void main(String[] args) {

    String ACCOUNT_ID = "Merchant's Account ID Here";
    String SECRET_KEY = "Merchant's Secret Key Here";
    String MODE = "TEST";

    BluePay rebill = new BluePay(

    // Set Customer Information
    HashMap<String, String> customerParams = new HashMap<>();
    customerParams.put("firstName", "Bob");
    customerParams.put("lastName", "Tester");
    customerParams.put("address1", "1234 Test St.");
    customerParams.put("address2", "Apt #500");
    customerParams.put("city", "Testville");
    customerParams.put("state", "IL");
    customerParams.put("zip", "54321");
    customerParams.put("country", "USA");
    customerParams.put("phone", "123-123-12345");
    customerParams.put("email", "[email protected]");

    // Set Credit Card Information
    HashMap<String, String> ccParams = new HashMap<>();
    ccParams.put("cardNumber", "4111111111111111");
    ccParams.put("expirationDate", "1225");
    ccParams.put("cvv2", "123");

    // Set recurring payment
    HashMap<String, String> rebillParams = new HashMap<>();
    rebillParams.put("firstDate", "2015-01-01"); // Rebill Start Date: Jan. 1, 2015
    rebillParams.put("expr", "1 MONTH"); // Rebill Frequency: 1 MONTH
    rebillParams.put("cycles", "12"); // Rebill # of Cycles: 12
    rebillParams.put("amount", "15.00"); // Rebill Amount: $15.00

    // Sets a Card Authorization at $0.00
    HashMap<String, String> authParams = new HashMap<>();
    authParams.put("amount", "0.00");

    //  Makes the API Request to create a rebill
    try {
    } catch (Exception ex) {
      System.out.println("Exception: " + ex.toString());

    if (rebill.isSuccessful()) {
        BluePay getRecurringStatus = new BluePay(
        // Find the rebill by ID and get rebill status

        //  Makes the API Request to get the rebill status
        try {
        } catch (Exception ex) {
          System.out.println("Exception: " + ex.toString());
        // Reads the response from BluePay
        System.out.println("Rebill Status: " + getRecurringStatus.getRebillStatus());
        System.out.println("Rebill ID: " + rebill.getRebillingID());
        System.out.println("Rebill Creation Date: " + getRecurringStatus.getRebillCreationDate());
        System.out.println("Rebill Next Date: " + getRecurringStatus.getRebillNextDate());
        System.out.println("Rebill Last Date: " + getRecurringStatus.getRebillLastDate());
        System.out.println("Rebill Schedule Expression: " + getRecurringStatus.getRebillSchedExpr());
        System.out.println("Rebill Cycles Remaining: " + getRecurringStatus.getRebillCyclesRemain());
        System.out.println("Rebill Amount: " + getRecurringStatus.getRebillAmount());
        System.out.println("Rebill Next Amount: " + getRecurringStatus.getRebillNextAmount());
    } else {
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.