This document describes the Orchestrator API concept.
The Orchestrator API allows various applications to work together in a financial transaction.
The Orchestrator API mainly communicates by using Activity#startActivityForResult, other communication is done over Activity#startService.
Following requests / responses are sent by Orchestrator API:
Applications treated by Orchestrator API:
If you want to integrate the Orchestrator API, add following dependency to your build.gradle.
The Orchestrator API handles following requests. Each request has corresponding response.
Activity#startService to send the requestBroadcastReceiver with orchestrator.print.response action to get the responseActivity#startService to send the requestBroadcastReceiver with orchestrator.scan.response action to get the responseActivity#startActivityForResult to start readingActivity.onActivityResult to get the responseActivity#startService to send the requestBroadcastReceiver with orchestrator.info.response action to get the responseThe ECR app is the main application used by the merchant to initiate the transaction.
Sale request is created by SaleReqBuilder and sent by calling OrchestratorAPI.financialRequest(this, request) where this is instance of Activity.
Orchestrator API uses Activity#startActivityForResult method to start the payment activity.
Response is then returned in Activity#onActivityResult with request code cz.gpe.orchestrator.api.Constants.INITIAL_REQ_CODE.
For parsing the response, use cz.gpe.orchestrator.api.OrchestratorAPI#parseResponse which returns appropriate response object (cz-gpe-orchestrator-api-response-FinancialRes or cz.gpe.orchestrator.api.response.ErrorRes).
No any other object should be returned.
The Financial app is responsible for processing the financial transactions. It is called by the Orchestrator via Activity#startActivityForResult.
For Android 11+, it is recommended to use FinancialAPI.financialRequest(context, request) method to start the financial transaction. This suspend method uses bounded service under the hood instead of startActivityForResult.
Pre-financial app is notified of each transaction before it is processed by Financial app via cz.gpe.orchestrator.api.prefin.IPreFinCallback callback, see cz.gpe.orchestrator.api.prefin.PreFinAPI.
The callback will be called before each transaction is processed by Financial app. You can modify the transaction data (e.g. change the amount, add basket, etc.), echo the original data to continue the transaction without any changes or return null abort the transaction.
In-financial app is notified of each transaction before it is processed by Financial app via cz.gpe.orchestrator.api.infin.IInFinCallback callback, see cz.gpe.orchestrator.api.infin.InFinAPI.
The onCardRead method of the callback will be called after card is read by Financial app. You can modify the transaction data (e.g. change the amount, add basket, etc.), echo the original data to continue the transaction without any changes or return null abort the transaction. The onAuthCentreResponse method will be called after auth centre response is received by Financial app. You can use this method to handle the auth centre response if needed, but it is not possible to modify the transaction data at this point.
Post-financial app is notified of each transaction after it is processed by Financial app via cz.gpe.orchestrator.api.postfin.IPostFinCallback callback, see cz.gpe.orchestrator.api.postfin.PostFinAPI.
The callback will be called before after transaction is processed by Financial app. You can use this callback to e.g. send transaction result to your server, show some custom UI in ECR app, etc. The callback is called with the transaction result which contains all information about the transaction (amount, card data, auth data, etc.).