The cl-creditcard Reference Manual

This is the cl-creditcard Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 04:48:23 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 cl-creditcard

Generic interace library for talking with credit card processors.

Author

<>

License

MIT

Version

0.1

Dependency

iterate (system).

Source

cl-creditcard.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 cl-creditcard/src

Source

cl-creditcard.asd.

Parent Component

cl-creditcard (system).

Child Components

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 cl-creditcard/cl-creditcard.asd

Source

cl-creditcard.asd.

Parent Component

cl-creditcard (system).

ASDF Systems

cl-creditcard.

Packages

cl-creditcard.system.


4.1.2 cl-creditcard/src/packages.lisp

Source

cl-creditcard.asd.

Parent Component

src (module).

Packages

cl-creditcard.


4.1.3 cl-creditcard/src/credit-card-api.lisp

Dependency

packages.lisp (file).

Source

cl-creditcard.asd.

Parent Component

src (module).

Public Interface
Internals

4.1.4 cl-creditcard/src/util.lisp

Dependency

credit-card-api.lisp (file).

Source

cl-creditcard.asd.

Parent Component

src (module).

Internals

5 Packages

Packages are listed by definition order.


5.1 cl-creditcard.system

Source

cl-creditcard.asd.

Use List
  • asdf/interface.
  • common-lisp.

5.2 cl-creditcard

Library for charging credit cards.

Source

packages.lisp.

Nickname

clcc

Use List
  • common-lisp.
  • iterate.
Public Interface
Internals

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Generic functions

Generic Reader: account (object)
Generic Writer: (setf account) (object)
Package

cl-creditcard.

Methods
Reader Method: account ((cc-data cc-data))
Writer Method: (setf account) ((cc-data cc-data))

The card number.

Source

credit-card-api.lisp.

Target Slot

account.

Generic Reader: address (object)
Generic Writer: (setf address) (object)
Package

cl-creditcard.

Methods
Reader Method: address ((cc-data cc-data))
Writer Method: (setf address) ((cc-data cc-data))

Street address for AVS. Typically only numbers need to
be passed in this fields. Letters and other characters are ignored.

Source

credit-card-api.lisp.

Target Slot

address.

Generic Function: authorize (processor cc-data amount &key &allow-other-keys)

Do a pre-authorization without capture returning a
transaction identifier that can later be used with preauth-capture.

Package

cl-creditcard.

Source

credit-card-api.lisp.

Generic Reader: ccv (object)
Generic Writer: (setf ccv) (object)
Package

cl-creditcard.

Methods
Reader Method: ccv ((cc-data cc-data))
Writer Method: (setf ccv) ((cc-data cc-data))

Card [Code] Verification value. Usually 3-4 digits on back of card.

Source

credit-card-api.lisp.

Target Slot

ccv.

Generic Function: enough-data-p (cc-data &key require-avs require-ccv error-p)

Check that a cc-data like structure has enough data to
complete a transaction.
Can optionally require that AVS verification, Card Verfication data be present. Can optionally signal an error if data isn’t present.

Some merchant accounts will incur extra fees if AVS isn’t used.

Package

cl-creditcard.

Source

credit-card-api.lisp.

Generic Reader: expdate (object)
Generic Writer: (setf expdate) (object)
Package

cl-creditcard.

Methods
Reader Method: expdate ((cc-data cc-data))
Writer Method: (setf expdate) ((cc-data cc-data))

The card expiration date

Source

credit-card-api.lisp.

Target Slot

expdate.

Generic Function: luhn-check-p (card-number)

Check the credit-card number is valid looking based on
the luhn algorithm: http://en.wikipedia.org/wiki/Luhn_algorithm

Package

cl-creditcard.

Source

credit-card-api.lisp.

Generic Function: preauth-capture (processor transaction-id &key amount &allow-other-keys)

Capture a charge that was previously authorized with authorize.
Some processors allow capturing a different amount than was originally authorized.

Package

cl-creditcard.

Source

credit-card-api.lisp.

Generic Function: sale (processor cc-data amount &key &allow-other-keys)

Do a one time charge on a credit card for an amount using
the given processor. Other provided keys are up to the processor to interpret or ignore.

Returns the transaction’s unique identifier if successful.

Package

cl-creditcard.

Source

credit-card-api.lisp.

Generic Function: void (processor transaction-id &key &allow-other-keys)

Void a previous transaction.

Package

cl-creditcard.

Source

credit-card-api.lisp.

Generic Reader: zip (object)
Generic Writer: (setf zip) (object)
Package

cl-creditcard.

Methods
Reader Method: zip ((cc-data cc-data))
Writer Method: (setf zip) ((cc-data cc-data))

Zipcode for AVS verfication.

Source

credit-card-api.lisp.

Target Slot

zip.


6.1.2 Conditions

Condition: deny-exception

Error signalled when the CC is denied and error signalling is requested.

Package

cl-creditcard.

Source

credit-card-api.lisp.

Direct superclasses

cc-error.


6.1.3 Classes

Class: cc-data

Class to hold data that normally goes with a credit card charge.
We interact with this class only through the accessors and never actually check
the type, so you can feed it any data structure that responds to these set of accessors.

Package

cl-creditcard.

Source

credit-card-api.lisp.

Direct methods
Direct slots
Slot: account

The card number.

Initargs

:account

Readers

account.

Writers

(setf account).

Slot: expdate

The card expiration date

Initargs

:expdate

Readers

expdate.

Writers

(setf expdate).

Slot: ccv

Card [Code] Verification value. Usually 3-4 digits on back of card.

Initargs

:ccv

Readers

ccv.

Writers

(setf ccv).

Slot: address

Street address for AVS. Typically only numbers need to
be passed in this fields. Letters and other characters are ignored.

Initargs

:address

Readers

address.

Writers

(setf address).

Slot: zip

Zipcode for AVS verfication.

Initargs

:zip

Readers

zip.

Writers

(setf zip).


6.2 Internals


6.2.1 Ordinary functions

Function: read-keyword-from-string (str)

Safely read a string into the keyword package.

Package

cl-creditcard.

Source

util.lisp.

Function: replace-all (string part replacement &key test)

Returns a new string in which all the occurences of the part
is replaced with replacement. [FROM http://cl-cookbook.sourceforge.net/strings.html#manip]

Package

cl-creditcard.

Source

util.lisp.


6.2.2 Generic functions

Generic Function: credit (processor cc-data &key transaction-id amount &allow-other-keys)

Credit a charge, if transaction-id is present this is a credit against a precviouly charged authorization

Package

cl-creditcard.

Source

credit-card-api.lisp.

Generic Reader: user-message (condition)
Generic Writer: (setf user-message) (condition)
Package

cl-creditcard.

Methods
Reader Method: user-message ((condition cc-error))
Writer Method: (setf user-message) ((condition cc-error))
Source

credit-card-api.lisp.

Target Slot

user-message.

Generic Reader: verbiage (condition)
Generic Writer: (setf verbiage) (condition)
Package

cl-creditcard.

Methods
Reader Method: verbiage ((condition cc-error))
Writer Method: (setf verbiage) ((condition cc-error))
Source

credit-card-api.lisp.

Target Slot

verbiage.


6.2.3 Conditions

Condition: cc-error

Requested errors when processing the credit will inherit
from here. user-message, when supplied, should be a safe string to display to clients informing them of the error.

Package

cl-creditcard.

Source

credit-card-api.lisp.

Direct superclasses

simple-error.

Direct subclasses

deny-exception.

Direct methods
Direct slots
Slot: user-message
Initform

(quote nil)

Initargs

:user-message

Readers

user-message.

Writers

(setf user-message).

Slot: verbiage

human-interpretable response code
(meant for system display to clerk)

Initargs

:verbiage

Readers

verbiage.

Writers

(setf verbiage).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   C   E   F   G   L   M   P   R   S   U   V   Z  
Index Entry  Section

(
(setf account): Public generic functions
(setf account): Public generic functions
(setf address): Public generic functions
(setf address): Public generic functions
(setf ccv): Public generic functions
(setf ccv): Public generic functions
(setf expdate): Public generic functions
(setf expdate): Public generic functions
(setf user-message): Private generic functions
(setf user-message): Private generic functions
(setf verbiage): Private generic functions
(setf verbiage): Private generic functions
(setf zip): Public generic functions
(setf zip): Public generic functions

A
account: Public generic functions
account: Public generic functions
address: Public generic functions
address: Public generic functions
authorize: Public generic functions

C
ccv: Public generic functions
ccv: Public generic functions
credit: Private generic functions

E
enough-data-p: Public generic functions
expdate: Public generic functions
expdate: Public generic functions

F
Function, read-keyword-from-string: Private ordinary functions
Function, replace-all: Private ordinary functions

G
Generic Function, (setf account): Public generic functions
Generic Function, (setf address): Public generic functions
Generic Function, (setf ccv): Public generic functions
Generic Function, (setf expdate): Public generic functions
Generic Function, (setf user-message): Private generic functions
Generic Function, (setf verbiage): Private generic functions
Generic Function, (setf zip): Public generic functions
Generic Function, account: Public generic functions
Generic Function, address: Public generic functions
Generic Function, authorize: Public generic functions
Generic Function, ccv: Public generic functions
Generic Function, credit: Private generic functions
Generic Function, enough-data-p: Public generic functions
Generic Function, expdate: Public generic functions
Generic Function, luhn-check-p: Public generic functions
Generic Function, preauth-capture: Public generic functions
Generic Function, sale: Public generic functions
Generic Function, user-message: Private generic functions
Generic Function, verbiage: Private generic functions
Generic Function, void: Public generic functions
Generic Function, zip: Public generic functions

L
luhn-check-p: Public generic functions

M
Method, (setf account): Public generic functions
Method, (setf address): Public generic functions
Method, (setf ccv): Public generic functions
Method, (setf expdate): Public generic functions
Method, (setf user-message): Private generic functions
Method, (setf verbiage): Private generic functions
Method, (setf zip): Public generic functions
Method, account: Public generic functions
Method, address: Public generic functions
Method, ccv: Public generic functions
Method, expdate: Public generic functions
Method, user-message: Private generic functions
Method, verbiage: Private generic functions
Method, zip: Public generic functions

P
preauth-capture: Public generic functions

R
read-keyword-from-string: Private ordinary functions
replace-all: Private ordinary functions

S
sale: Public generic functions

U
user-message: Private generic functions
user-message: Private generic functions

V
verbiage: Private generic functions
verbiage: Private generic functions
void: Public generic functions

Z
zip: Public generic functions
zip: Public generic functions