Payment data

This module provides the data structures for describing credit cards and addresses for use in executing charges.

Credit card

class authorize.data.CreditCard(card_number=None, exp_year=None, exp_month=None, cvv=None, first_name=None, last_name=None)

Represents a credit card that can be charged.

Pass in the credit card number, expiration date, CVV code, and optionally a first name and last name. The card will be validated upon instatiation and will raise an AuthorizeInvalidError for invalid credit card numbers, past expiration dates, etc.

card_type

The credit card issuer, such as Visa or American Express, which is determined from the credit card number. Recognizes Visa, American Express, MasterCard, Discover, and Diners Club.

expiration

The credit card expiration date as a datetime object.

safe_number

The credit card number with all but the last four digits masked. This is useful for storing a representation of the card without keeping sensitive data.

validate()

Validates the credit card data and raises an AuthorizeInvalidError if anything doesn’t check out. You shouldn’t have to call this yourself.

Address

class authorize.data.Address(street=None, city=None, state=None, zip_code=None, country='US')

Represents a billing address for a charge. Pass in the street, city, state and zip code, and optionally country for the address.