Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Languages

Languages, strings, and lists management depends on projects' requirements and need to be adapted. However, most of the code that is provided may be reuse as is. This section aims to explain the standard GPI mechanism to help the integration.

...

Code Block
typedef struct {
	char code[LANGUAGE_CODE_LENGTH+1];
	char label[MAX_STRING_LENGTH+1];
	char emvString[NB_EMV_STRINGS][MAX_STRING_LENGTH+1];
	char individualString[NB_INDIVIDUAL_STRINGS][MAX_STRING_LENGTH+1];
	char acquirerString[NB_ACQUIRER_STRINGS][MAX_STRING_LENGTH+1];
	char issuerString[NB_ISSUER_STRINGS][MAX_STRING_LENGTH+1];
} tLanguageData;
typedef struct {
	int nbLanguage;
	tLanguageData language[MAX_NB_LANGUAGE];
} tStringTable;

Important:

  • Reduce the structure size to address RAM issue when instantiating static tStringTable stringTable.

  • It is also possible to use a simple matrix [MAX_NB_LANGUAGE][MAX_STRING_PER_LANGUAGE] in flash memory depending of the platform that is targeted.

...

; Acquirer Specific Messages
81=SELECT ACCOUNT
82=MAG PROCESSING
83=SELECT LANGUAGE
84=CANCELLED
85=SWIPE CARD
86=FAILED
87=CASHBACK
88=CASHBACK OK?
89=REFERRAL?
8A=THANK YOU
8B=TRANSACTION NOT PERMITTED

check=325829E28E2CDB90

Strings

Code Block
tGPIError gpiGetString(const unsigned char langId, const unsigned char stringId, char ** string)

There are many string related primitives in the GPI. Basically, all primitives using a string identifier are meant to use the string table. Use an identifier and a language keys to find the actual string from the string table up in memory.

Important: If a string table in flash memory is used, it’s important to use a cache to avoid latency at display time because some strings are displayed by the CL payment application within the time frames measurements.

Lists

Lists are used for the purposed of the EMV CT applications (to support EMV and language selection) but there use may be extended for any purpose to support a choice (referral management for example). The GPI example provides a generic implementation that takes into account the physical size of a screen and allows scrolling into a list.

...

Code Block
typedef struct
{
	int positionOfFirstLine;
	int positionOfLastLine;
	int firstIndexToDisplay;
	int lastIndexToDisplay;
	int selectedIndex;
} tDisplayControl;

typedef struct
{
	unsigned char id;
	char name[MAX_ITEM_NAME_LENGTH];
} tItem;

typedef struct
{
	int nbItems;
	tItem item[MAX_NUMBER_ITEMS];
} tItemList;

Important: Reduce the structure size to address RAM issue when instantiating:

...