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.
# BluePay Python 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.
from BluePayPayment_BP10Emu import BluePayPayment_BP10Emu
accountID = "MERCHANT'S ACCOUNT ID HERE"
secretKey = "MERCHANT'S SECRET KEY HERE"
mode = "TEST"
# Merchant's Account ID
# Merchant's Secret Key
# Transaction Mode: TEST (can also be LIVE)
payment = BluePayPayment_BP10Emu(
# First Name: Bob
# Last Name: Tester
# Address1: 123 Test St.
# Address2: Apt #500
# City: Testville
# State: IL
# Zip: 54321
# Country: USA
"123 Test St.",
# Card Number: 4111111111111111
# Card Expire: 12/15
# Card CVV2: 123
# Rebill Start Date: Jan. 5, 2015
# Rebill Frequency: 1 MONTH
# Rebill # of Cycles: 5
# Rebill Amount: $3.50
# Auth Amount: $0.00
response = payment.auth('0.00')
# If transaction was approved..
if(response['Result'] == 'APPROVED'):
rebillStatus = BluePayPayment_BP10Emu(
# Cancel rebilling cycle from above transaction
response = rebillStatus.getRebillingCycleStatus(response['REBID'])
# Read response from BluePay
print 'Rebill Status: ' + response['status']
print 'Rebill ID: ' + response['rebill_id']
print 'Rebill Creation Date: ' + response['creation_date']
print 'Rebill Next Date: ' + response['next_date']
print 'Rebill Schedule Expression: ' + response['sched_expr']
print 'Rebill Cycles Remaining: ' + response['cycles_remain']
print 'Rebill Amount: ' + response['reb_amount']