# Adapter scenarios

# Printing Custom Receipt

Business Need : Based on the market and acquirer’s needs, we want to print additional data on the receipt.

To achieve this goal, processorOptions object is used. It is a map of key-value strings and used for various processor specific data including the custom fields to be printed on the receipt.

Poynt terminal application looks for certain keys received in the response message and prints the key and corresponding value on the receipt.

In the following Response Handler Java Script code, the procOpt (an internal variable) is filled with following custom data. Acquirers may decide their own custom data printed on the receipt.

  • Promotional messages

  • Number of installments

  • Cardholder name

And finally TRANSACTION data object is set with the the values with the ones within the procOpt.

POS Terminal application checks certain keywords (“isPrintPromotionalMessage”, “noOfInstallments“, “Cardholder Name“) and then prints them on the receipt.

Adapter Printing

# Adding SCA Logic (EU)

Business Need : In Europe, SCA is mandated by regulation. Acquirers send certain SCA soft decline codes to the terminal (INSERT_CARD, ENTER_PIN) and POS terminal prompts user to insert the card or enter the PIN based on these response codes.

To achieve this, Response Handler Java Script code performs following operations :

  • If ReplyCode indicates 1111 (a specific value for ENTER PIN soft decline)

    • Set internal variable (scaResult) to $SCA_ENTER_PIN
  • If ReplyCode indicates 2222 (a specific value for INSERT CAR soft decline)

    • If the transaction is done with a mobile wallet (checkedTag and checkedByte variables)

      • Set internal variable (scaResult) to $SCA_CDCVM
    • else

      • Set internal variable (scaResult) to $SCA_INSERT_CARD

And finally set scaResult in the $PROCESSOR_RESPONSE.

POS terminal gets the $PROCESSOR_RESPONSE, checks the scaResult and perform the defined actions based on this data.



# Setting EMV Data(Auth Message)

Business Need : Brands) have different EMV tags and new tags comes in certain periods. We need to be able to define any EMV tags in the authorization message.

emvData field has following attributes:

Adapter emvdata1


To achieve this goal, there is a WHITELIST function where EMV tags are defined. New tags can easily be added in this list.

The Java script code performs following operations :

Adapter emvdata2

# Setting EMV Data(Auth Response)

Business Need : EMV data received from the acquirer should be sent to the terminal.

EMV response data includes significant data(Authorization response cryptogram, issuer response code, etc) to successfully complete an EMV transaction.

To achieve this, Response Handler Java Script code performs following operations :

  • If entryMode indicates that it is an EMV transaction

    • Set the $PROCESSOR_RESPONSE data object with the EMV response tags.

POS terminal reaches out the EMV response data within the $PROCESSOR_RESPONSE and performs EMV defined operations to complete the transaction.
Adapter emvresp

# Setting Processing Code

Business need : We need to set Processing Code field-(3-4) to a certain value in the following 2 cases.

  • EMV card with US common debit AID

  • MSR card with PIN entry

Processing field has following attributes :

Adapter aid

To achieve this, Java Script code performs following operations :

  • if the entry mode is EMV or contactless

    • If value of EMV Tag 84 (AID) is an U.S Common Debit AID

      • Set the Processing Code field (3-4) to the $INT_DEB_CRD_PIN
  • if the entry mode is NOT EMV or contactless

    • If the trnsaction includes PIN data

      • Set the Processing Code field (3-4) to the $INT_DEB_CRD_PIN

Adapter aid2

# Setting Track2Data

Business Need : Converting Track2 data to fixed length alphanumeric format and add Fs at the end.

Track2 data comes in the TRANSACTION data object in the BINARY format as defined in the attributes below.

Adapter trackdata1

To achieve this, Java Script code performs following operations :

  • If the EntryMode is not KEYED

    • Get the Track2Data from the TRANSACTION object (the path is $TRANSACTION.getFundingSource().getCard().getTrack2data())

    • If the total length of the track2Data is odd

      • Pad “F” character at the end
    • Convert it to String format

    Adapter trackdata2

# Error Message on Terminal Screen

Business Need : We need to show specific error messages on the terminal screen for certain response codes.

To achieve this, Response Handler Java Script code performs following operations :

  • Define error messages for selected response codes (51 and 55 in this example)

  • If the response code is different than 00

    • set the $PROCESSOR_RESPONSE.setStatusMessage to the defined error message

      Adapter errmsg


    Poynt terminal displays the message received in the $PROCESSOR_RESPONSE.StatusMessage

# Entry Mode in the Auth Message

Business Need : Field 22 consists of the 2 sub-fields : First 2 bytes is Entry Mode and last byte is PIN entry capability. The field is defined has following attributes : Field type is Fixed length numeric, Length is 3 and Val Encoding is BCD. The field goes in the position 22 in the authorization message.

Adapter entmode


![Adapter entmode2](../assets/entmode2.png)

At the bottom of the field definition screen, a Java script is seen. This Java script gets the Entry Mode in the TRANSACTION data object, performs certain controls and then sets the EntryMode in an authorization message.

The Java script code performs following operations :

  • Gets the entry mode from the TRANSACTION data object

  • Sets the entryMode based on the data in the TRANSACTION data object (First 2 digits)

  • Sets the entryMode to ENTRY_MODE_ICC_FALLBACK_MSR if it is a fallback transaction

  • If the transaction includes encrypted PIN data, then sets the 3th digit of the entryMode to 1 (PIN entered)

  • Returns entryMode

The Adapter Java Script Code : Adapter entmode3

# Defining Custom Encoder

Sometimes, acquirers may have custom fields in the payload. In the following example, the payload has 2 bytes of the length (length of the payload) information at the beginning of the message. The following Custom Encoder Java Script adds this 2 byte of the length at the beginning of the message and Custom Decoder removes this length bytes.

Adapter customencoder

Last Updated: 10/7/2020, 11:48:05 PM