Payments

Members

(inner, constant) CardType

Card Type
JS: @meldcx/agent-payments/dist/CardType
TS: @meldcx/agent-payments/Payments/CardType

Properties:
Name Type Description
Visa

Visa 0

Mastercard

Mastercard 1

AmericanExpress

AmericanExpress 2

DinersClub

DinersClub 3

Discover

Discover 4

JCB

JCB 5

UnionPay

UnionPay 6

Maestro

Maestro 7

Mir

Mir 8

Elo

Elo 9

Hiper

Hiper:10

Hipercard

Hipercard:11

Credit

Credit:12

Debit

Debit:13

Token

Token:14

Cash

Cash:15

StoredValue

StoredValue:16

Mobile

Mobile:17

Moniker

Moniker:18

GiftCard

GiftCard:19

Alipay

Alipay:20

EBTFood

EBTFood:21

EBTCash

EBTCash:22

Loyalty

Loyalty:23

Interac

Interac:24

Unknown

Unknown:25

(inner, constant) EntryMethod

Entry Methods
JS: @meldcx/agent-payments/dist/EntryMethods
TS: @meldcx/agent-payments/Payments/EntryMethods

Properties:
Name Type Description
None

None: 0

MSR

MSR: 1

Chip

Chip: 2

EMVContactless

EMVContactless: 4

Manual

Manual: 8

RFID

RFID: 16

Scanned

Scanned: 32

Loyalty

Loyalty: 64

(inner, constant) PaymentStatus

Payment System status
JS: @meldcx/agent-payments/dist/Status
TS: @meldcx/agent-payments/Payments/Status

Properties:
Name Type Description
Initialising

Initialising 0

Ready

Ready 1

GatewayOffline

GatewayOffline 2

TerminalOffline

TerminalOffline 3

TerminalPairingFailed

TerminalPairingFailed 4

ErrorGateway

ErrorGateway 5

ErrorTerminal

ErrorTerminal 6

ErrorConfiguration

ErrorConfiguration 7

(inner, constant) TransactionStatus

The list of Transaction Status codes that are provided
JS: @meldcx/agent-payments/dist/TransactionStatus
TS: @meldcx/agent-payments/Payments/TransactionStatus

Properties:
Name Type Description
Ready

Ready 0

Pending

Pending 1

Present

Present 2

GatewayTransmit

GatewayTransmit 3

GatewayProcess

GatewayProcess 4

GatewayResponse

GatewayResponse 5

Processing

Processing 6

Resolved

Resolved 7

Rejected

Rejected 8

Failure

Failure 9

(inner, constant) TransactionType

Transaction Types
JS: @meldcx/agent-payments/dist/TransactionType
TS: @meldcx/agent-payments/Payments/TransactionType

Properties:
Name Type Description
Payment

Payment 1

PreAuth

PreAuth 2

Capture

Capture 4

Credit

Credit 8

Refund

Refund:16

Token

Token:32

Cancel

Cancel 64

Type Definitions

CardExpiry

Card Expiry Info

Properties:
Name Type Description
month Number

The month the card expires

year Number

The year the card expires

CardInfo

Card Info Object

Properties:
Name Type Description
maskedPAN String

The masked primary account number

cardHolderName String

The card holder name on the card

cardType CardTypeInfo

The card type information

cardExpiry CardExpiry

The card expiry information

entryMethod EntryMethodInfo

The entry method of this card information

CardTypeInfo

Card Type Info

Properties:
Name Type Description
code CardType

The code representing the type of this card

type String

The plain text type of this card

Charges

Charges Object

Properties:
Name Type Attributes Description
total Number <optional>

The total amount to be charged with this transaction. Only optional when performing a Credit or Void transaction.

tax Number <optional>

The optional amount of tax associated with this charge

tip Number <optional>

The optional tip amount associated with this charge

cashout Number <optional>

The optional cash out amount associated with this charge

credit Number <optional>

The optional credit amount for a Credit transaction, Only required when peforming a Credit transaction.

CVMethod

Cardholder Verification Method
JS: @meldcx/agent-payments/dist/CVMethod
TS: @meldcx/agent-payments/Payments/CVMethod

Properties:
Name Type Description
code Number

The code of the CV Method

type String

The type of the CV Method

EntryMethodInfo

Entry Method Info

Properties:
Name Type Description
code EntryMethod

The Entry Method Code

type String

The Plain text type string

EventEmitterOptions

Event Emitter Options

Properties:
Name Type Attributes Default Description
once Boolean <optional>
false

Fire the event emitter only once.

EventUnsubscriber

Event Unsubscriber

Properties:
Name Type Description
id String

The id of the event handler

unSubscribe function

An unsubscribe callback that will de-register the event handler.

HotelItem

Hotel Item

Properties:
Name Type Description
folioNumber String | Number

The folio number

noShow Boolean

Was the customer a no show?

checkinDate String

The ISO 8601 Check In Date

checkoutDate String

The ISO 8601 Check Out Date

extraChargeType String

The extra charges (See Gateway documentation)

roomRate Number

The rate for the room

roomTax Number

The tax applied to the room rate

extraChargeTotal Number

The Extra Charge total

onCardInfo(cardInfo)

Card Info callback

Parameters:
Name Type Description
cardInfo CardInfo

Information about the Card

onCVMRequested(cvMethod, reference)

Cardholder Verification Requested callback

Parameters:
Name Type Description
cvMethod CVMethod

Information about the Cardholder verification method being invoked

reference TransactionReference

Transaction reference information

onTransactionStatus(reference, status)

Transaction Status callback

Parameters:
Name Type Description
reference TransactionReference

Transaction reference information

status TransactionStatus

Transaction status information

Options

Payment Options

Properties:
Name Type Attributes Default Description
enableMSR Boolean

If the MSR interface on the payment terminal should be enabled.

enableContact Boolean

If the Contact interface on the payment terminal should be enabled.

enableContactless Boolean

If the Contactless interface on the payment terminal should be enabled.

url String

The gateway endpoint URL, use this to override the gateway endpoint

noEMVFallbackToMSR Boolean <optional>
false

If we should allow an EMV card to be Swiped via the MSR interface.

timeout Number

The amount of time to wait before the transaction will timeout in ms.

items Array.<(module:Payments~HotelItem|TBC)> <optional>

An array of line items to be provided as part of this transaction

timeoutWaitForCard Number <optional>
120

The amount of time in seconds to wait for the card before timing out.

enableMSR Boolean

If MSR transactions should be supported

enableContact Boolean

If Contact transactions should be supported

enableContactless Boolean

If Contactless transactions should be supported

TerminalDisconnectedException

Thrown when the payment terminal is not connected

Properties:
Name Type Description
code String

The code of the error, in this case it is 'Agent.Payments.TerminalDisconnectedn'

name String

The name of the error, in this case it is 'TerminalDisconnectedException'

stack String

The stack trace from where this error was instantiated.

TransactionGatewayResult

Transaction Gateway Result Object

Properties:
Name Type Attributes Description
approved Boolean

true when the transaction is approved

code String

The transaction result provided code from the payment gateway.

id String

The transaction id as provided by the gateway

message String

The transaction message provided by the gateway

gatewayData Object <optional>

The raw result provided by the gateway, this cannot be relied upon to be consistent if using multiple/variable gateways.

TransactionReference

Transaction Reference Object
Note: Some Gateways require specific information to be provided as part of the transaction, please ensure you are provided the right information for your chosen gateway/

Properties:
Name Type Attributes Description
id String | Number <optional>

A generic reference id

invoiceNumber String <optional>

The reference invoice number

invoiceDate String <optional>

The reference invoice date as an ISO8601 string

TransactionRejectedException

Thrown when a transaction is rejected, You should follow this error up with a call to transactionStatus to confirm further details about this transaction failure.

Properties:
Name Type Description
code String

The code of the error, this will be set to the code provided by the payment gateway.

name String

The name of the error, in this case it is 'TransactionRejectedException'

stack String

The stack trace from where this error was instantiated.

message String

The user friendly message of the error.

TransactionResult

Transaction Result Object

Properties:
Name Type Description
id String

The id of the transaction as provided by the payment gateway

amount Number

The transaction amount.

receipt String

The receipt string which can be passed to a receipt printer to print a fixed pre-formatted receipt.

referenceId String

The reference id passed in as part of the start transaction request.

type TransactionType

The type of the transaction

status TransactionStatus

The status of the transaction

gatewayResult TransactionGatewayResult

The transaction result from the payment gateway

TransactionResult

Transaction Result Object

Properties:
Name Type Description
reference TransactionReference

The reference information for the transaction

transactionId string

The transaction ID provided by the gateway

charges Charges

The Charges information provided with this transaction

cardInfo CardInfo

The Card Info provided for this transaction

approved Boolean

If this transaction as approved.

transactionResponse TransactionResponse

The response information for this transaction

gatewayResponse object

The RAW response from the payment gateway.