Versions Compared

Key

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

...

Code Block
tPaymentContext payment;
tOutComeParameter outcome;
tTransactionalContext txnContext;
tInterface interface;
tBoolean clipping=bFALSE, sred=bFALSE; // Optional. Depends on the platform
char version[100]="";
 
 
//
// At EACH SYSTEM START-UP, system initialization
//
// BEGIN ------------------------
//
gpiInitialize((const char*)"transactionLogName"); // Optional. Depends on the platform
gpiInitializeHSM((const char*)"certificateFilesName",(const char*)"certificatesRevocationListFileName",(const char*)"exceptionFileName"); // Optional. Depends on the platform
//
// END ------------------------
 
//
// At EACH NEW TRANSACTION triggering, transaction initialization
//
// BEGIN ------------------------
//
// Reset payment context
pmwInitializePaymentContext(&payment);
 
//
// Prepare payment context
// Set tPaymentContext data members like
// 9F02, 9F03, 9C, 9A, 9F21, 5F2A, 5F36, 9F7C (see paymentMW.h, tPaymentContext structure/Information provide by Level3 section)
// If PayPass, set an instance of tDataExchangeList 
//
 
// Initialize Agnos kernel
afsInitialize(&interface,NULL);
//
// END ------------------------
 
//
// At EACH ENTRY POINT CALL triggerring, start initialization (i.e. always)
//
// BEGIN ------------------------
//
// Reset outcome context
pmwInitializeOutComeParameter(&outcome);
 
// IF no preprocessing performed earlier THEN
// Open session
afsWhatIsYourVersion(version);
agnOpenSessionCL((char*)"smartcardReaderName",(char*)"pinPadName",version,&txnContext,setEMVTag,&payment->mSession,clipping,sred);
// ELSE
payment->mSession = i; // IMPORTANT: where i corresponds to the selected CL combination that is used to perform the transaction
// END IF
 
 
// Depending of the kernel, some proprietary tags need to be converted
 
// Prepare session data
agnSetAgnosDataBaseStrategy(payment->mSession,STRATEGY); // STRATEGY value depends on Agnos kernel
xxxSetUpdateCondition(); // xxx prefix varies on Agnos kernel
adbSetAddTagContactlessCallback(&_xxxAddTag); // xxx prefix varies on Agnos kernel
agnSetAgnosDatabase(payment->mSession,TLV,TLVLengh); // TLV contains selected CL combination
 
// Miscellaneous settings
memcpy(payment->mRID,AID,5); // AID is provided by the entry point
agnSetAID(session,AID,AID_LENGTH); // AID and AID_LENGTH are provided by the entry point
agnSetExitState(payment->mSession,NO_SELECT_FINAL); // Optional. Depends on entry point implementation (i.e if the entry point performs the Final Select)
 
// If 9F37 is provided by entry point then call agnOverwriteEMVTag with 9F37 value
// If NO_SELECT_FINAL then set 9F02 and 9F03 using agnSetEMVTag 
 
// Card processing
afsPerformTransaction(&payment,&outcome);
 
// Process card processing results like
// Tag reading
// Outcome conversion
// payment->mDataExchange conversion
// etc...
 
// Close Agnos session
pmwCloseEMVSession(payment->mSession);
//
// END ------------------------
 
//
// At EACH SYSTEM SHUT DOWN, system release
//
// BEGIN ------------------------
//
gpiRelease(); // Optional. Depends on the platform
//
// END ------------------------

Tags

See Configuration Model page to match potential specific framework's tags to Agnos Tags.

...