Payment data¶
This module provides the data structures for describing credit cards and addresses for use in executing charges.
Credit card¶
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.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.
The credit card expiration date as a
datetime
object.
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.
Validates the credit card data and raises an
AuthorizeInvalidError
if anything doesn’t check out. You shouldn’t have to call this yourself.
Address¶
Represents a billing address for a charge. Pass in the street, city, state and zip code, and optionally country for the address.