Logo
Getting started

How It Works

How the Embedded Payment SDK works?

There are 2 primary components from the SDK - NGHeadlessSetup & NGHeadlessActivity:

  • NGHeadlessSetup is an object for non-UI setups
    • it provides a init method for initializing with the CPoC/ MPoC SDK under the hood.
    • another similar method is the setup method, upon calling the SDK would load default config and the keys from Neurogine backend for future transaction process.
  • NGHeadlessActivity is a base android activity
    • For customer to inherit and provide the UI
    • Provide the contract for android's startActivityForResult
    • Internally, the activity connect and use the CPoC/ MPoC SDK under the hood.
    • Per each transaction, the encrypted data would be passed to Neurogine backend for processing.

Note that the card read data is processed via Neurogine backend service, for more details please refer to Gateway Service

Environment Provision

For each customer, Neurogine would first provision the gateway service for the corresponding handling and config.

Environment Provision Diagram

Profile Creation

Once the environment is provisioned, the customer can create and manage the profile and acceptance.

From Neurogine backend we employ a concept of acceptance. The acceptance is an entity that holds information like the MID, TID, host message format, and other information that will be used when doing a payment message request to the upstream acquirer or payment gateway.

A profile is then holding the binding to one or multiple acceptance.

For example one profile (e.g. with profileId prof_01J1VF63D8E6QFCTAJQ7ACSC4W) can bind to:

  • a gateway with hostMessageFormat: MPGS_AP, with MID: 123 and TID: 456
  • another gateway with hostMessageFormat: AMEX_GCAG, with MID: 987 and TID: 654

From the application side (with the Embedded Payment SDK), after a card reading, the SDK would send the encrypted data to Neurogine backend.

From Neurogine backend, based on the payment method read and the service configuration, it knows how to route and construct the corresponding payment message.

Profile Creation Diagram

New App Install

For a freshly installed application, it would need to register the SDK first, underneath the SDK would do an initial attestation and also get back the sdkId from Neurogine backend.

After the SDK is registered, the app can call the initial setup for some initial param download and key loading. This initial setup is only required once per application.

New App Install Diagram

Each App Launch

Each time the application is launched, it would need to perform the init in order for processing card reading.

So we recommend to put this init call binded in your application lifecycle.

Each App Launch Diagram

Making Transaction Request

Making transaction request to the Embedded Payment SDK is rather straight forward - Request with

  1. profileId - for the routing/ message format lookup & constructing the payment message in Neurogine backend
  2. request amount

There are some other optional request parameter, check details in the API section.

After the Embedded Payment SDK receives the request, it'll load the corresponding EMV config, perform the card read, encrypt the data and send it to Neurogine backend for host processing.

Making Transaction Request Diagram

On this page