Payments

Payments

Payments API
A tutorial can be found here.

Classes

Terminal

Methods

(async) cancelTransaction(reference) → {Promise.<undefined>}

Will cancel a pending transaction.
Note: If the transaction does not confirm as being cancelled you must ensure that you perform a reversal using the void transaction type

Parameters:
Name Type Description
reference TransactionReference

The reference information for this transaction

(async) isPaired() → {Promise.<Boolean>}

Check if the payment terminal is paired

(async) isWaitingForCVM() → {Promise.<Boolean>}

Query if the payment system is waiting for Cardholder verification

onCardInfo(cb, opts)

Register an event handler for the Card Info event

Parameters:
Name Type Description
cb onCardInfo

Callback to call when this event is fired

opts EventEmitterOptions

Config options for the event handler

onCVMRequested(cb, opts)

Register an event handler for the Cardholder Verification Requested event

Parameters:
Name Type Description
cb onCVMRequested

Callback to call when this event is fired

opts EventEmitterOptions

Config options for the event handler

onTerminalAttached(cb, opts) → {EventUnsubscriber}

Register an event handler for the Terminal Attached event

Parameters:
Name Type Description
cb function

Callback to call when this event is fired

opts EventEmitterOptions

Config options for the event handler

onTerminalConnected(cb, opts) → {EventUnsubscriber}

Register an event handler for the Terminal Connected event

Parameters:
Name Type Description
cb function

Callback to call when this event is fired

opts EventEmitterOptions

Config options for the event handler

onTerminalDisconnected(cb, opts)

Register an event handler for the Terminal Disconnected event

Parameters:
Name Type Description
cb function

Callback to call when this event is fired

opts EventEmitterOptions

Config options for the event handler

onTerminalRemoved(cb, opts) → {EventUnsubscriber}

Register an event handler for the Terminal Removed event

Parameters:
Name Type Description
cb function

Callback to call when this event is fired

opts EventEmitterOptions

Config options for the event handler

(async) onTransactionStatus(cb, opts) → {Promise.<module:Payments~TransactionStatus>}

Register an event handler for the Transaction status event

Parameters:
Name Type Description
cb onTransactionStatus

Callback to call when this event is fired

opts EventEmitterOptions

Config options for the event handler

(async) pairSilent() → {Promise.<Boolean>}

Run the silent pairing process, this will return a value representing if the pairing was successful.

(async) pendingCVMType() → {Promise.<module:Payments~CVMethod>}

Query what the pending Cardholder Verification method type is.

(async) startTransaction(transactionType, reference, charges, options) → {Promise.<module:Payments~TransactionResult>}

Will request a transaction for the amount provided, it will keep the provided reference a long with the transaction for future accounting.

Parameters:
Name Type Description
transactionType TransactionType

The type of transaction to start

reference TransactionReference

The reference information for this transaction

charges Charges

The charges associated with this transaction

options Options

The optional configuration for this transaction

Throws:

(async) status() → {Promise.<module:Payments~PaymentStatus>}

Register an event handler for the Payment System status event