sys.path.append(
    os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
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)

payment.set_customer_information(
    name1="Bob",
    name2="Tester",
    addr1="123 Test St.",
    addr2="Apt #500",
    city="Testville",
    state="IL",
    zipcode="54321",
    #stored_indicator = "F",
    #stored_type = "C",
    #stored_id = "TESTID526957756",
    country="USA")

payment.set_cc_information(card_number="4111111111111111",
                           card_expire="1225",
                           cvv2="123")

payment.sale(amount='3.00')  # Sale Amount: $3.00

# Makes the API Request
payment.process()
from __future__ import print_function
import os.path, sys
sys.path.append(
    os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
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)

payment.set_customer_information(name1="Bob",
                                 name2="Tester",
                                 addr1="123 Test St.",
                                 addr2="Apt #500",
                                 city="Testville",
                                 state="IL",
                                 zipcode="54321",
                                 country="USA")

payment.set_cc_information(card_number="4111111111111111",
                           card_expire="1225",
                           cvv2="123")

payment.sale(amount='3.00')  # Sale Amount: $3.00

# Makes the API request for processing the sale
payment.process()

# If transaction was approved..
if payment.is_successful_response():
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
)

payment.set_customer_information(
    name1 = "Bob",
    name2 = "Tester",
    addr1 = "123 Test St.",
    addr2 = "Apt #500",
    city = "Testville",
    state = "IL",
    zipcode = "54321",
    country = "USA"
)

payment.set_cc_information(
    card_number = "4111111111111111",
    card_expire = "1225",
    cvv2 = "123"
)

payment.auth(amount = '3.00')

# Makes the API Request for a credit card authorization
payment.process()