Skip to content

Fingermark Transactions API

Tytus is the project which contains all the payment integration logic for Fingermark projects.

How it works?

Each payment provider supported has it's own logic and requirements, but only one call function

Supported payment providers:

  • Adyen
  • Noon
  • Marshal
  • Verifone

Also encapsulates refunds for the providers that supports it

Providers who can perform refunds

  • Adyen
  • Marshal

Interface object params

js
const params = {
  loggerId,
  paymentInfo: {
    amount,
    paymentTimeout,
  },
  refundInfo: {
    amount,
    transactionId,
    refundTimeout,
    voidRcptNum,
    messNumber,
  },
  settings: {
    // See definitions below...
    adyen: adyenSettings,
    marshal: marshalSettings,
    verifone: verifoneSettings,
    noon: noonSettings,
  },
  mock: {
    state,
  },
  deviceConfig: {
    frame,
    type,
    port,
  },
};

const adyenSettings = {
  poiId,
  pinpadIp,
  apiKey,
  keyIdentifier,
  passphrase,
  keyVersion,
  currency,
  isLocal,
  test,
  kioskName,
  referenceType,
  orderSettings: {
    siteId,
    orderId,
    storeId,
  },
};

const marshalSettings = {
  terminalId,
  comPort,
};

const verifoneSettings = {
  port,
  pinpadIp,
};

const noonSettings = {
  name,
  test,
  locale,
  tokenize,
  currency,
  testToken,
  liveToken,
  channel,
  category,
};

Payload builder

There's payload builders for payment and refunds that parse the current KAS settings to the payload required by tytus

How to use

Here's a sample how to use the payment integration

js
import 'buildPaymentHandlers' from '@fingermarkglobal/transactions';

const { pay, refund, settle } = buildPaymentHandlers(...);

try {

    const { result } = await pay(..., ..., ...);

    // ok

} catch (e) {

}

Verifone

Uses TCP connection, handled by the chrome extension (actually @fingermarkglobal/slamurai)

Command codes

js
/**
 * Response codes sent from pinpad
 * CP: Pinpad on
 * RP?: Ready to print, please ack
 * PT?: Payment receipt sent, please ack
 * RS: Status response (ping)
 */

Response codes

js
/**
 * Response codes
 * BB: Busy
 * ??: Processing, try again
 * 00, 09: Payment approved
 * CC: Payment cancelled
 */