The cl-moneris Reference Manual

This is the cl-moneris Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 04:14:30 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 cl-moneris

An interface to the Moneris payment processing service (HTTP).

Maintainer

Vladimir Sedach <>

License

ISC

Dependencies
  • s-xml (system).
  • drakma (system).
Source

cl-moneris.asd.

Child Components

3 Files

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


3.1 Lisp


3.1.1 cl-moneris/cl-moneris.asd

Source

cl-moneris.asd.

Parent Component

cl-moneris (system).

ASDF Systems

cl-moneris.


3.1.2 cl-moneris/package.lisp

Source

cl-moneris.asd.

Parent Component

cl-moneris (system).

Packages

cl-moneris.


3.1.3 cl-moneris/response-codes.lisp

Dependency

package.lisp (file).

Source

cl-moneris.asd.

Parent Component

cl-moneris (system).

Internals

3.1.4 cl-moneris/moneris.lisp

Dependency

response-codes.lisp (file).

Source

cl-moneris.asd.

Parent Component

cl-moneris (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 cl-moneris

Source

package.lisp.

Use List
  • common-lisp.
  • drakma.
  • s-xml.
Public Interface
Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Ordinary functions

Function: correction (&key order-id txn-id crypt-type)

Generate a transaction to void a same-day purchase. No purchase will appear on the customer’s credit card.

Description of input parameters:

order-id (string, 50 chars max, alphanumeric)
Merchant defined unique transaction identifier - must reference a
previously processed purchase transaction order-id.

txn-id (string, 255 chars max, alphanumeric)
This must be the value returned as the Txn_number in the
response to the original purchase.

crypt-type (string, 1 char, alphanumeric)
E-Commerce Indicator:
1 - Mail Order/Telephone Order - Single
2 - Mail Order/Telephone Order - Recurring
3 - Mail Order Telephone Order - Instalment
4 - Mail Order Telephone Order - Unknown Classification
5 - Authenticated E-commerce Transaction (VBV)
6 - Non Authenticated Ecommerce Transaction (VBV)
7 - SSL enabled merchant
8 - Non Secure Transaction (Web or Email Based)
9 - SET Non Authenticated transaction

Package

cl-moneris.

Source

moneris.lisp.

Function: process (merchant-token transaction)

Send a ’purchase’, ’correction’, or ’refund’ transaction for processing to Moneris merchant account specified by merchant-token.

If the Moneris mpg server returns an HTTP status code other than 200, raises a moneris-post-error

If transaction is declined, raises a moneris-transaction-error

If transaction is successfuly processed, returns (as multiple values):
txn-id - transaction ID
code - numeric response code
code-description - response code description
message - message returned in response
response-xml - parsed XML of response
response-string - raw XML response string

Package

cl-moneris.

Source

moneris.lisp.

Function: purchase (&key order-id cust-id amount pan expdate crypt-type)

Generate a purchase transaction for processing.

Description of input parameters:

order-id (string, 50 chars max, alphanumeric)
Merchant defined unique transaction identifier - must be uniquely generated by caller for every Purchase.

amount (string, 9 chars max, decimal)
Amount of the transaction. This must contain 3 digits with two penny values. The minimum value passed can be 0.01 and the maximum 9999999.99

pan (string, 20 chars max, numeric)
Credit Card Number - no spaces or dashes. Most credit card numbers today are 16 digits in length but some 13 digits are still accepted by some issuers. This field has been intentionally expanded to 20 digits in consideration for future expansion and/or potential support of private label card ranges.

expdate (string, 4 chars, numeric)
Expiry Date - format YYMM no spaces or slashes. PLEASE NOTE THAT THIS IS REVERSED FROM THE DATE DISPLAYED ON THE PHYSICAL CARD WHICH IS MMYY

cust-id (string, 50 chars max, alphanumeric)
This is an optional field that can be sent as part of a Purchase or PreAuth request. It is searchable in the Moneris Merchant Resource Centre. It is commonly used for policy number, membership number, student ID or invoice number.

Package

cl-moneris.

Source

moneris.lisp.

Function: refund (&key order-id txn-id amount crypt-type)

Generate a transaction to refund a purchase.

order-id (string, 50 chars max, alphanumeric)
Merchant defined unique transaction identifier. For Independent Refund attempts, must be uniquely generated by caller. For refunds of previous purchases, must reference a previously processed purchase transaction order-id.

txn-id (string, 255 chars max, alphanumeric)
Used when performing follow on transactions - this must be the value returned as the Txn_number in the response to the original purchase.

amount (string, 9 chars max, decimal)
Amount of the transaction. This must contain 3 digits with two penny values. The minimum value passed can be 0.01 and the maximum 9999999.99

crypt-type (string, 1 char, alphanumeric)
E-Commerce Indicator:
1 - Mail Order/Telephone Order - Single
2 - Mail Order/Telephone Order - Recurring
3 - Mail Order Telephone Order - Instalment
4 - Mail Order Telephone Order - Unknown Classification
5 - Authenticated E-commerce Transaction (VBV)
6 - Non Authenticated Ecommerce Transaction (VBV)
7 - SSL enabled merchant
8 - Non Secure Transaction (Web or Email Based)
9 - SET Non Authenticated transaction

Package

cl-moneris.

Source

moneris.lisp.


5.1.2 Generic functions

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

cl-moneris.

Methods
Reader Method: code ((condition moneris-transaction-error))
Writer Method: (setf code) ((condition moneris-transaction-error))
Source

moneris.lisp.

Target Slot

code.

Generic Reader: code-description (condition)
Generic Writer: (setf code-description) (condition)
Package

cl-moneris.

Methods
Reader Method: code-description ((condition moneris-transaction-error))
Writer Method: (setf code-description) ((condition moneris-transaction-error))
Source

moneris.lisp.

Target Slot

code-description.

Generic Reader: http-body (condition)
Generic Writer: (setf http-body) (condition)
Package

cl-moneris.

Methods
Reader Method: http-body ((condition moneris-post-error))
Writer Method: (setf http-body) ((condition moneris-post-error))
Source

moneris.lisp.

Target Slot

http-body.

Generic Reader: http-code (condition)
Generic Writer: (setf http-code) (condition)
Package

cl-moneris.

Methods
Reader Method: http-code ((condition moneris-post-error))
Writer Method: (setf http-code) ((condition moneris-post-error))
Source

moneris.lisp.

Target Slot

http-code.

Generic Reader: http-headers (condition)
Generic Writer: (setf http-headers) (condition)
Package

cl-moneris.

Methods
Reader Method: http-headers ((condition moneris-post-error))
Writer Method: (setf http-headers) ((condition moneris-post-error))
Source

moneris.lisp.

Target Slot

http-headers.

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

cl-moneris.

Methods
Reader Method: message ((condition moneris-transaction-error))
Writer Method: (setf message) ((condition moneris-transaction-error))
Source

moneris.lisp.

Target Slot

message.

Generic Reader: parsed-xml (condition)
Generic Writer: (setf parsed-xml) (condition)
Package

cl-moneris.

Methods
Reader Method: parsed-xml ((condition moneris-transaction-error))
Writer Method: (setf parsed-xml) ((condition moneris-transaction-error))
Source

moneris.lisp.

Target Slot

parsed-xml.

Generic Reader: raw-xml (condition)
Generic Writer: (setf raw-xml) (condition)
Package

cl-moneris.

Methods
Reader Method: raw-xml ((condition moneris-transaction-error))
Writer Method: (setf raw-xml) ((condition moneris-transaction-error))
Source

moneris.lisp.

Target Slot

raw-xml.

Generic Reader: reason-phrase (condition)
Generic Writer: (setf reason-phrase) (condition)
Package

cl-moneris.

Methods
Reader Method: reason-phrase ((condition moneris-post-error))
Writer Method: (setf reason-phrase) ((condition moneris-post-error))
Source

moneris.lisp.

Target Slot

reason-phrase.


5.1.3 Conditions

Condition: moneris-error

Superclass of network errors or
transaction-declined conditions. Handle this when you don’t care why your transaction failed to process.

Package

cl-moneris.

Source

moneris.lisp.

Direct superclasses

error.

Direct subclasses
Condition: moneris-post-error

Condition raised due to network error

Package

cl-moneris.

Source

moneris.lisp.

Direct superclasses

moneris-error.

Direct methods
Direct slots
Slot: http-code
Initargs

:http-code

Readers

http-code.

Writers

(setf http-code).

Slot: http-headers
Initargs

:http-headers

Readers

http-headers.

Writers

(setf http-headers).

Slot: http-body
Initargs

:http-body

Readers

http-body.

Writers

(setf http-body).

Slot: reason-phrase

Reason phrase from HTTP header status line

Initargs

:reason-phrase

Readers

reason-phrase.

Writers

(setf reason-phrase).

Condition: moneris-transaction-error

Condition raised when transaction is declined

Package

cl-moneris.

Source

moneris.lisp.

Direct superclasses

moneris-error.

Direct methods
Direct slots
Slot: code

Numeric Moneris response code

Initargs

:code

Readers

code.

Writers

(setf code).

Slot: code-description

Text description of Moneris response code

Initargs

:code-description

Readers

code-description.

Writers

(setf code-description).

Slot: message

Message returned by Moneris

Initargs

:message

Readers

message.

Writers

(setf message).

Slot: raw-xml

XML string returned by Moneris

Initargs

:raw-xml

Readers

raw-xml.

Writers

(setf raw-xml).

Slot: parsed-xml

Parsed XML returned by Moneris

Initargs

:parsed-xml

Readers

parsed-xml.

Writers

(setf parsed-xml).


5.1.4 Classes

Class: merchant-token

Merchant-token objects specify your unique Moneris store information.

Package

cl-moneris.

Source

moneris.lisp.

Direct methods
Direct slots
Slot: moneris-uri

Full URI of the Moneris Server e.g. https://moneris.com/mpg

Initargs

:moneris-uri

Readers

moneris-uri.

Writers

This slot is read-only.

Slot: api-token

Your api token issued during Moneris store creation.

Initargs

:api-token

Readers

api-token.

Writers

This slot is read-only.

Slot: store-id

Your store-id issued during Moneris store creation.

Initargs

:store-id

Readers

store-id.

Writers

This slot is read-only.


5.2 Internals


5.2.1 Special variables

Special Variable: *response-codes*
Package

cl-moneris.

Source

response-codes.lisp.


5.2.2 Ordinary functions

Function: is-error-code? (code)
Package

cl-moneris.

Source

response-codes.lisp.

Function: lispify-response (s-xml-response)
Package

cl-moneris.

Source

moneris.lisp.

Function: response-code-description (code)
Package

cl-moneris.

Source

response-codes.lisp.


5.2.3 Generic functions

Generic Reader: api-token (object)
Package

cl-moneris.

Methods
Reader Method: api-token ((merchant-token merchant-token))

Your api token issued during Moneris store creation.

Source

moneris.lisp.

Target Slot

api-token.

Generic Reader: moneris-uri (object)
Package

cl-moneris.

Methods
Reader Method: moneris-uri ((merchant-token merchant-token))

Full URI of the Moneris Server e.g. https://moneris.com/mpg

Source

moneris.lisp.

Target Slot

moneris-uri.

Generic Reader: store-id (object)
Package

cl-moneris.

Methods
Reader Method: store-id ((merchant-token merchant-token))

Your store-id issued during Moneris store creation.

Source

moneris.lisp.

Target Slot

store-id.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   C   F   G   H   I   L   M   P   R   S  
Index Entry  Section

(
(setf code): Public generic functions
(setf code): Public generic functions
(setf code-description): Public generic functions
(setf code-description): Public generic functions
(setf http-body): Public generic functions
(setf http-body): Public generic functions
(setf http-code): Public generic functions
(setf http-code): Public generic functions
(setf http-headers): Public generic functions
(setf http-headers): Public generic functions
(setf message): Public generic functions
(setf message): Public generic functions
(setf parsed-xml): Public generic functions
(setf parsed-xml): Public generic functions
(setf raw-xml): Public generic functions
(setf raw-xml): Public generic functions
(setf reason-phrase): Public generic functions
(setf reason-phrase): Public generic functions

A
api-token: Private generic functions
api-token: Private generic functions

C
code: Public generic functions
code: Public generic functions
code-description: Public generic functions
code-description: Public generic functions
correction: Public ordinary functions

F
Function, correction: Public ordinary functions
Function, is-error-code?: Private ordinary functions
Function, lispify-response: Private ordinary functions
Function, process: Public ordinary functions
Function, purchase: Public ordinary functions
Function, refund: Public ordinary functions
Function, response-code-description: Private ordinary functions

G
Generic Function, (setf code): Public generic functions
Generic Function, (setf code-description): Public generic functions
Generic Function, (setf http-body): Public generic functions
Generic Function, (setf http-code): Public generic functions
Generic Function, (setf http-headers): Public generic functions
Generic Function, (setf message): Public generic functions
Generic Function, (setf parsed-xml): Public generic functions
Generic Function, (setf raw-xml): Public generic functions
Generic Function, (setf reason-phrase): Public generic functions
Generic Function, api-token: Private generic functions
Generic Function, code: Public generic functions
Generic Function, code-description: Public generic functions
Generic Function, http-body: Public generic functions
Generic Function, http-code: Public generic functions
Generic Function, http-headers: Public generic functions
Generic Function, message: Public generic functions
Generic Function, moneris-uri: Private generic functions
Generic Function, parsed-xml: Public generic functions
Generic Function, raw-xml: Public generic functions
Generic Function, reason-phrase: Public generic functions
Generic Function, store-id: Private generic functions

H
http-body: Public generic functions
http-body: Public generic functions
http-code: Public generic functions
http-code: Public generic functions
http-headers: Public generic functions
http-headers: Public generic functions

I
is-error-code?: Private ordinary functions

L
lispify-response: Private ordinary functions

M
message: Public generic functions
message: Public generic functions
Method, (setf code): Public generic functions
Method, (setf code-description): Public generic functions
Method, (setf http-body): Public generic functions
Method, (setf http-code): Public generic functions
Method, (setf http-headers): Public generic functions
Method, (setf message): Public generic functions
Method, (setf parsed-xml): Public generic functions
Method, (setf raw-xml): Public generic functions
Method, (setf reason-phrase): Public generic functions
Method, api-token: Private generic functions
Method, code: Public generic functions
Method, code-description: Public generic functions
Method, http-body: Public generic functions
Method, http-code: Public generic functions
Method, http-headers: Public generic functions
Method, message: Public generic functions
Method, moneris-uri: Private generic functions
Method, parsed-xml: Public generic functions
Method, raw-xml: Public generic functions
Method, reason-phrase: Public generic functions
Method, store-id: Private generic functions
moneris-uri: Private generic functions
moneris-uri: Private generic functions

P
parsed-xml: Public generic functions
parsed-xml: Public generic functions
process: Public ordinary functions
purchase: Public ordinary functions

R
raw-xml: Public generic functions
raw-xml: Public generic functions
reason-phrase: Public generic functions
reason-phrase: Public generic functions
refund: Public ordinary functions
response-code-description: Private ordinary functions

S
store-id: Private generic functions
store-id: Private generic functions