Versions Compared

Key

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

...

Code Example

See entrypoint.h

Code Block
languagec
// Payment contexts
static tPaymentContext paymentCtx;
static tOutComeParameter outcome;
// Transaction amounts
static tAmount amount, cashBack;

char path[250] = "./AGNOS/"; // Configuration files here
unsigned char defaultTxnType = 0x00; // Default 9C value

  enpConnectPaymentServices(PATH);
  
  // Init payment context and payment outcome
  pmwInitializePaymentContext(&paymentCtx);
  pmwInitializeOutComeParameter(&outcome);
		
  // Important to perform these initializations after pmwInitializePaymentContext
  paymentCtx.mAmount = &amount;
  paymentCtx.mCashBack = &cashBack;
  paymentCtx.mTransactionType = (tTransactionType)defaultTxnType;
  amount = cashBack = NULL;
  
  // Set payment context from TRD...
  // ...
  
  // Initialize transient data model
  /// Only CL combinations refering to paymentCtx.mTransactionType will be loaded
  dtmInitializeFromFile(path, 0, 0, 0, 0, 0, paymentCtx.mTransactionType, bFALSE);
  enpInitialize("CTLSS", "", bTRUE, bFALSE, bFALSE,pay paymentCtx); // Using signal in the scope of L2 TA
  
  enpExecutePaymentTransaction(spSTART_A, paymentCtx, outcome);
  
  if (enpAreAllCLApplicationNotAllowed)
  {
    // Fallback to other technology if any
  }
  else
  {
    // Process outcome
  }

...