API Reference
Complete public API for EdfaPayPlugin — initialization, payments, transactions, reconciliation, terminal, session, and utilities.
All SDK functionality is accessed through the EdfaPayPlugin singleton object. Utility methods are under EdfaPayPlugin.Utils.
Loading...initiate
Initialize the SDK with merchant credentials. Must be called before any payment operations.
Loading...Parameters
context— FragmentActivity for UI operationscredentials— EdfaPayCredentials with auth token or email/passwordonSuccess— Called with EP instance and session IDonError— Called on initialization failure| Property | Type | Description |
|---|---|---|
| environment | Env | Target environment (SANDBOX, PRODUCTION, etc.) |
| String? | User email (for credential login) | |
| password | String? | User password (for credential login) |
| token | String? | Auth token (for token login) |
| isTokenLogin | Boolean | true when token is provided (computed) |
All payment methods share the same callback pattern. The flowType parameter controls the UI flow (IMMEDIATE, STATUS, or DETAIL).
purchase
Process a standard sale transaction.
Loading...Parameters
activity— FragmentActivity for UI (optional)flowType— UI flow type (default: DETAIL)txnParams— Transaction parameters (amount, type, originalTransaction)onPaymentProcessComplete— Called with (status, code, transaction, isFlowComplete)onError— Called on erroronRequestTimerEnd— Called on server request timeoutonCardScanTimerEnd— Called on card scan timeoutonCancelByUser— Called when user cancelsauthorize
Pre-authorize a payment (hold funds without capturing).
Loading...capture
Capture a previously authorized transaction. txnParams.originalTransaction is required.
Loading...refund
Refund a previous purchase. txnParams.originalTransaction is required.
Loading...void
Void an unsettled transaction. Pass null to void the last transaction.
Loading...Parameters
activity— FragmentActivity for UItransaction— Transaction to void (null for last)onSuccess— Called with TxnResponseonError— Called on errorreverse
Reverse a transaction. Used for timeout or error recovery.
Loading...Parameters
activity— FragmentActivity for UItransaction— Transaction to reverseonSuccess— Called with TxnResponseonError— Called on errorreverseLastTransaction
Convenience method to reverse the most recent transaction. Throws if not reversible.
Loading...txnHistory
Retrieve paginated transaction history for the current terminal.
Loading...Parameters
pagination— Optional Pagination (page, sort, size)onSuccess— Called with List<Transaction>onError— Called on errortxnDetail
Get details of a specific transaction by ID.
Loading...Parameters
txnId— Transaction ID (UUID string)onSuccess— Called with TransactiononError— Called on errorreconcile
Perform end-of-day reconciliation for the current terminal.
Loading...Returns
Reconcile object with reconciliationInfo and per-scheme breakdowns
reconciliationHistory
Get a list of past reconciliation batches.
Loading...Returns
List of ReconciliationHistory records
reconciliationDetail
Get details of a specific reconciliation batch.
Loading...Parameters
id— Reconciliation batch IDreconciliationReceipt
Get a printable receipt for a reconciliation batch.
Loading...Parameters
id— Reconciliation batch IDterminalInfo
Retrieve terminal information for the current session.
Loading...Returns
TerminalInfo with deviceId, tsn, terminalId, merchantId, merchantName, version
activateTerminal
Activate the terminal for payment processing.
Loading...Parameters
password— Optional password if requireddeActivateTerminal
Deactivate the terminal. Disables payment processing until reactivated.
Loading...Parameters
password— Optional password if requiredsyncTerminal
Download latest EMV parameters, card schemes, and terminal configuration.
Loading...getSessionList
Get all stored sessions for logged-in terminals.
Loading...Returns
List<SessionDetail>
logoutCurrentSession
Logout the current session and clear stored credentials.
Loading...logoutSession
Logout a specific session by ID.
Loading...Parameters
sessionId— The session ID to logoutAdvanced login, terminal registration, OTP, and configuration methods. Accessed via EdfaPayPlugin.Extension. Must be initialized with init() before use.
init
Initialize the Extension module. Required before calling any other Extension method.
Loading...Parameters
context— FragmentActivity for UI and configurationonError— Called with EdfaException on failureonSuccess— Called with Boolean indicating if existing session was restoredloginWithCredentials
Login using email and password. Returns a Login object with session info.
Loading...Parameters
email— User email addresspassword— User passwordlocation— Device location (required for security)onSuccess— Called with Login objectloginWithToken
Login using a pre-issued auth token. Returns an SdkLogin session.
Loading...Parameters
token— Pre-issued authentication tokenlocation— Device location (required for security)verifyOtp
Verify an OTP code after credential login (when 2FA is enabled).
Loading...Parameters
sessionId— Session ID from login responseotp— One-time password coderesendOtp
Resend the OTP code to the user.
Loading...Parameters
sessionId— Session ID from login responsegetAvailableTerminal
Get a list of terminals available for registration.
Loading...Returns
List of Terminal objects available for binding
registerTerminal
Register/bind a terminal by its TRSM (Terminal Reference Security Module) ID.
Loading...Parameters
trsm— Terminal TRSM identifier to registergetInitialKey
Retrieve initial encryption keys for the terminal.
Loading...getTerminalConfig
Download terminal configuration (EMV parameters, card schemes). Saves session, keys, and config.
Loading...Parameters
forceDownload— Force re-download even if config exists (default: false)configurationType— Configuration scope (default: FULL_TERMINAL_CONFIGURATION)renewSessionIfRequiredAndPossible
Renew the session token if expired or near expiry, using the stored refresh token.
Loading...initKernels
Initialize EMV card processing kernels (Mastercard, Visa, etc.).
Loading...Parameters
completion— Optional callback with list of initialized kernel namesprepareTerminalWithToken
Convenience method: init → loginWithToken → getTerminalConfig → initKernels in one call.
Loading...Parameters
context— FragmentActivity for UIlocation— Device locationtoken— Auth tokenonSuccess— Called with EP instance and session ID when fully ready| Method | Signature | Description |
|---|---|---|
| currentLocation | (Context, (Location?, Boolean) -> Unit) | Get current device location with permission status |
| haveLocationPermission | (Context): Boolean | Check if location permission is granted |
| requestLocationPermission | (FragmentActivity, (Boolean) -> Unit) | Request location permission from user |
| isLocationMocked | (Location?): Boolean | Detect if location is spoofed/mocked |
| getDeviceId | (Context): String | Get unique device identifier (UUID) |
| saveData | (Key, String, onSuccess, onError) | Save key-value data to secure storage |
| getData | (Key, onError): String? | Retrieve data from secure storage |
| showMessageDialog | (FragmentActivity, title, message, onClose?) | Display a message dialog to the user |
TransactionType
| Value | Description |
|---|---|
| PURCHASE | Standard sale transaction |
| AUTHORIZE | Pre-authorization (hold funds) |
| CAPTURE | Capture pre-authorized amount |
| REFUND | Refund a previous purchase |
| REVERSAL | Reverse/cancel a transaction |
| VOID | Void unsettled transaction |
| CASHBACK | Purchase with cashback |
FlowType
| Value | Description |
|---|---|
| IMMEDIATE | Minimal UI, quick processing |
| STATUS | Shows transaction status only |
| DETAIL | Full transaction details and receipt (default) |
Env
| Value | Description |
|---|---|
| SANDBOX | Testing/sandbox environment |
| PRODUCTION | Live production environment |
| DEMO | Demo environment |
Presentation
Controls how the SDK UI is displayed. Each value supports chainable configuration methods.
| Value | Description |
|---|---|
| FULLSCREEN | Full screen display |
| DIALOG_CENTER | Centered dialog |
| DIALOG_BOTTOM_FILL | Bottom sheet (full width) |
| DIALOG_BOTTOM_CENTER | Bottom sheet (centered) |
| DIALOG_BOTTOM_START | Bottom sheet (start-aligned) |
| DIALOG_BOTTOM_END | Bottom sheet (end-aligned) |
| DIALOG_TOP_FILL | Top sheet (full width) |
| DIALOG_TOP_CENTER | Top sheet (centered) |
| DIALOG_TOP_START | Top sheet (start-aligned) |
| DIALOG_TOP_END | Top sheet (end-aligned) |
Chainable Methods
| Method | Default | Description |
|---|---|---|
| sizePercent(Float?) | 1.0 | Dialog size (0.0 to 1.0) |
| setPurchaseSecondaryAction(action) | NONE | Post-purchase action button |
| setShufflePinPad(Boolean) | false | Randomize PIN pad layout |
| dismissOnTouchOutside(Boolean) | true | Dismiss on outside tap |
| dismissOnBackPress(Boolean) | true | Dismiss on back button |
| cornerRadius(Int) | 16 | Dialog corner radius (dp) |
| dimAmount(Float) | 0.5 | Background dim opacity |
| animateEntry(Boolean) | true | Entry animation |
| animateExit(Boolean) | true | Exit animation |
PurchaseSecondaryAction
| Value | Description |
|---|---|
| NONE | No secondary action button |
| REVERSE | Show reverse button after purchase |
| REFUND | Show refund button after purchase |
The SDK uses an asynchronous callback-driven architecture to communicate transaction states, errors, and user interactions back to your application.
TransactionCompleteCallback
The primary hook for transaction results. It is triggered when a transaction reaches a final state (Success or Failure) and provides the associated data.
| Property | Type | Description |
|---|---|---|
| status | Boolean | True if the transaction was approved by the host. |
| code | String? | The response code from the server (e.g., '00' for success). |
| transaction | Transaction? | The detailed transaction record. Null if the flow failed before reaching the host. |
| isFlowComplete | Boolean | Crucial: True when the SDK's UI flow (dialogs, receipts) has fully finished. |
Handling isFlowComplete
You should only navigate away from the current screen or trigger disruptive UI updates whenisFlowComplete is true. The callback may be triggered twice: once with the result (isFlowComplete=false) and finally when the UI is dismissed (isFlowComplete=true).
ErrorCallback
Catch-all for exceptions occurring within the SDK logic or networking layer.
throwable— Typically an EdfaException containing an error code and message.TimeoutCallback
Triggered when an operation exceeds its allotted time. The SDK defines two main timeout scenarios:
- Request Timer: Server communication took too long.
- Scan Timer: The user did not present a card within the required window.
CancellationCallback
Triggered when the user explicitly cancels the transaction flow (e.g., tapping the back button or the 'X' button in the UI).
Language Type Definitions
Loading...Backward Compatibility
The SDK has been modernized with standardized naming conventions. While the older typealiases remain functional for backward compatibility, we recommend migrating to the new signatures for improved code clarity.
| Deprecated Name | Current Name |
|---|---|
| ProcessCompleteCallback | TransactionCompleteCallback |
| ServerCompletionCallBack | ServerResponseCallback |
| PluginCallBack | CardProcessingCallback |
| TimeOutCallBack | TimeoutCallback |
| CancelByUserCallBack | CancellationCallback |
| OnErrorCallBack | ErrorCallback |
On this page
Downloads
Coming SoonSample apps, release bundles, and more content will be available here soon.