Create a Recurring Payment
This code steps you through the process of storing a payment method for a customer and using it to set up recurring payments. When this recurring payment information is stored, a $0 authorization is used for the initial transaction. As a result, the customer is not charged until the rebilling cycle begins.
For sample code that charges customers at the same point of establishing rebilling Go to: Run a credit card transaction with recurring payments or ACH processing with recurring payments
# BluePay Python Sample code.
# This code sample creates a recurring payment charging $15.00 per month for one year.
from __future__ import print_function
import os.path, sys
from BluePay import BluePay
account_id = "Merchant's Account ID Here"
secret_key = "Merchant's Secret Key Here"
mode = "TEST"
payment = BluePay(
account_id = account_id,
secret_key = secret_key,
mode = mode
name1 = "Bob",
name2 = "Tester",
addr1 = "123 Test St.",
addr2 = "Apt #500",
city = "Testville",
state = "IL",
zipcode = "54321",
country = "USA"
card_number = "4111111111111111",
card_expire = "1225",
cvv2 = "123"
payment.auth(amount = '0.00')
# Set Recurring Payment Information
reb_first_date = "2015-01-01", # Rebill Start Date: Jan. 1, 2015
reb_expr = "1 MONTH", # Rebill Frequency: 1 MONTH
reb_cycles = "12", # Rebill # of Cycles: 12
reb_amount = "15.00" # Rebill Amount: $15.00
# Makes the API Request
# Read response from BluePay
print('Transaction ID: ' + payment.trans_id_response)
print('Rebill ID: ' + payment.reb_id_response)
print('Transaction Status: ' + payment.status_response)
print('Transaction Message: ' + payment.message_response)
print('Transaction AVS Result: ' + payment.avs_code_response)
print('Transaction CVV2 Result: ' + payment.cvv2_code_response)
print('Masked Payment Account: ' + payment.masked_account_response)
print('Transaction Auth Code: ' + payment.auth_code_response)
855-812-5191 to get access to the applicable integration modules.