API Reference
The public methods and properties of EdfaPayPlugin, with parameters in the order the SDK declares them. Use this as a quick lookup for method signatures, parameters, and return types.
EdfaPayPlugin
The primary singleton for all SDK operations. Kotlin: EdfaPayPlugin. Java: the static facade EdfaPayPluginJ (for example EdfaPayPluginJ.purchase(...)); the methods it does not wrap (updateSecurityChecks, configureHook, invoicePayment, invoiceRefund, txnDetailApi, searchTxnApi, pgTxnStatusApi) are called on EdfaPayPlugin.INSTANCE, and the SDK_VERSION_CODE property is read with EdfaPayPlugin.INSTANCE.getSDK_VERSION_CODE(). Signatures below are Kotlin; ? marks a parameter you may pass as null.
Initialization & Authentication
| Method | Description |
|---|---|
| initiate(context: FragmentActivity, credentials, onSuccess: (sessionId) -> Unit, onTerminalBindingTask, onError) | Initialize the SDK with credentials. All three callbacks are required; onTerminalBindingTask receives a TerminalBindingTask when no terminal is bound (see Initialization) |
| setPartnerConfig(config: String) | Set encrypted partner configuration (must call before initiate) |
| updateSecurityChecks(config: String) | Apply an encrypted configuration from EdfaPay that turns the SDK's device-security checks on or off; applies to later scans |
| configureHook(context, hook: Hook, encryptor) | Register the transaction and initialization webhooks (see Utility Functions, Transaction & Init Webhooks) |
| theme() | Returns SdkTheme for chained configuration |
Payment Operations
| Method | Description |
|---|---|
| purchase(activity?, flowType = DETAIL, txnParams, onRequestTimerEnd, onCardScanTimerEnd, onError, onPaymentProcessComplete, onCancelByUser) | Process a purchase. onPaymentProcessComplete receives (status, code, transaction, isFlowComplete) |
| authorize(activity, flowType = DETAIL, txnParams, onRequestTimerEnd, onCardScanTimerEnd, onError, onPaymentProcessComplete, onCancelByUser) | Coming soon. Start a pre-authorization |
| capture(activity, flowType = DETAIL, txnParams, onRequestTimerEnd, onCardScanTimerEnd, onError, onPaymentProcessComplete, onCancelByUser) | Coming soon. Capture an authorized amount (originalTransaction: the AUTHORIZE transaction) |
| refund(activity, flowType = DETAIL, txnParams, onRequestTimerEnd, onCardScanTimerEnd, onError, onPaymentProcessComplete, onCancelByUser) | Refund a prior purchase (originalTransaction: the PURCHASE transaction) |
| reverseLastTransaction(activity?, onSuccess: (TxnResponse) -> Unit, onError) | Reverse the last transaction the SDK stored, if it is a purchase that finished less than 60 seconds ago. To cancel an older payment, use refund |
| changePin(activity?, flowType = DETAIL, parameters: List<String>, onRequestTimerEnd, onCardScanTimerEnd, onError, onProcessComplete, onCancelByUser) | Coming soon. Initiate a PIN change flow (see Card Management) |
| activateCard(activity?, flowType = DETAIL, parameters: List<String>, onRequestTimerEnd, onCardScanTimerEnd, onError, onProcessComplete, onCancelByUser) | Coming soon. Activate a new card (see Card Management) |
| invoicePayment(request: InvoicePaymentRequest, onSuccess: (InvoicePaymentResponse) -> Unit, onError) | Start an invoice payment (BNPL or Checkout). Needs an API key in EdfaPayCredentials |
| invoiceRefund(request: InvoiceRefundRequest, onSuccess: (InvoicePaymentResponse) -> Unit, onError) | Refund an invoice payment. Needs an API key in EdfaPayCredentials |
Terminal Management
| Method | Description |
|---|---|
| terminalInfo(onSuccess, onError) | Get current terminal info |
| activateTerminal(password?, onSuccess, onError) | Activate the terminal |
| deActivateTerminal(password?, onSuccess, onError) | Deactivate the terminal |
| syncTerminal(onSuccess, onError) | Sync terminal config with server |
Session Management
In Flutter, getSessionId(), getSessionDetail() and getSessionList() return a Future, and in React Native a Promise: use await, for example final id = await EdfaPayPlugin.getSessionId(); (Flutter) or const id = await EdfaPayPlugin.getSessionId(); (React Native).
| Method / Property | Return Type | Description |
|---|---|---|
| getSessionId() | String? (Future in Flutter, Promise in React Native) | Current session ID; null when no session is loaded |
| getSessionDetail() | SessionDetail? (Future in Flutter, Promise in React Native) | Detail of the current session: sessionId, email, tsn, terminalId, merchantId |
| getSessionList(context) | List<SessionDetail?> (Future in Flutter, Promise in React Native) | All sessions stored on this device |
| logoutCurrentSession(context, onSuccess: (Boolean) -> Unit, onError?) | Unit | Remove the current session's stored data |
| logoutSession(context, sessionId, onSuccess: (Boolean) -> Unit, onError?) | Unit | Remove a stored session by ID |
Transaction History
| Method | Description |
|---|---|
| txnHistory(pagination?, onSuccess: (List<Transaction>) -> Unit, onError) | Retrieve paginated transaction list |
| txnDetail(txnId, onSuccess: (Transaction) -> Unit, onError) | Get full details of a single transaction |
| txnDetailApi(txnId, onSuccess: (TransactionApi) -> Unit, onError) | Transaction detail from the EdfaPay API. Needs an API key in EdfaPayCredentials |
| searchTxnApi(params: Map<String, Any?>, onSuccess: (List<TransactionApi>) -> Unit, onError) | Search transactions in the EdfaPay API. Needs an API key in EdfaPayCredentials |
| pgTxnStatusApi(sessionId, onSuccess: (PgTxnStatus) -> Unit, onError) | Payment-gateway transaction status. Needs an API key in EdfaPayCredentials |
Reconciliation
| Method | Description |
|---|---|
| reconcile(onSuccess: (Reconcile) -> Unit, onError) | Trigger end-of-day settlement |
| reconciliationHistory(pagination?, onSuccess: (List<ReconciliationHistory>) -> Unit, onError) | List of past reconciliation records |
| reconciliationDetail(id, onSuccess: (ReconciliationDetail) -> Unit, onError) | Full detail of a reconciliation record |
| reconciliationReceipt(id, onSuccess: (ReconciliationReceipt) -> Unit, onError) | Generate printable receipt |
Properties
| Property | Type | Read/Write | Description |
|---|---|---|---|
| enableLogs | Boolean | R/W | Turn on SDK logging (default false). Logs may contain sensitive data. Turn on enableLogs only on test devices, never in builds you share. |
| animationSpeedX | Float | R/W | Animation speed multiplier (default 1.0) |
| SDK_VERSION | String | Read-only | SDK version with a v prefix, for example v1.0.8 |
| SDK_VERSION_CODE | String | Read-only | Build date and time of the SDK (ddMMyyyyHHmm) |
| SDK_VERSION_TIMESTAMP | String | Read-only | v followed by the build time in milliseconds |
| PARTNER | String | Read-only | Build flavour of the artifact |
Data Models
Key model classes used throughout the SDK. In Flutter/RN/Xamarin, complex models are returned as Map<String, dynamic> or JSON.
Transaction
| Kotlin, Java (field) | Flutter, React Native (map key) | Type | Description |
|---|---|---|---|
| rrn | rrn | String? | Retrieval Reference Number |
| transactionNumber | transaction_number | String? | Unique transaction number |
| amount | amount | String | Transaction amount |
| operationType | operation_type | String? | Raw transaction type; use transactionType() for the TransactionType enum (PURCHASE, REFUND, etc.) |
| status | status | String | Transaction status from the server |
| authCode | auth_code | String? | Bank authorization code |
| cardNumber | credit_number | String | Masked PAN (e.g., **** **** **** 1234) |
| formattedScheme | formatted_scheme | String? | Card scheme label |
| createdDate | created_date | String | Creation date as sent by the server |
| tsn | tsn | String | Terminal Serial Number (terminal that processed the transaction) |
| merchantId | merchant_id | String? | Merchant ID |
TxnParams
TxnParams(amount, orderId = null, originalTransaction = null). You do not set the transaction type: each operation (purchase, authorize, capture, refund) sets its own.
| Field | Type | Required | Description |
|---|---|---|---|
| amount | String | Yes | Transaction amount as a string (e.g., "100.00") |
| orderId | String? | No | Custom order reference ID, sent with purchase requests. If you leave it out, the SDK uses the transaction ID it generates |
| originalTransaction | Transaction? | Conditional | capture: the AUTHORIZE transaction; refund: the PURCHASE transaction. Not used by purchase and authorize |
Pagination
Pagination(pageNumber = 0, sortOrder = DESCENDING, pageSize = 50, sortBy = CREATED), package com.edfapay.paymentcard.model.requests. Pass it to txnHistory and reconciliationHistory; without it the request is sent without paging fields. In Java, use new Pagination() for the defaults or pass all four values in this order.
| Field | Type | Description |
|---|---|---|
| pageNumber | Int | Page number (default 0) |
| pageSize | Int | Items per page (default 50) |
| sortOrder | Pagination.Sort | ASCENDING or DESCENDING (default DESCENDING) |
| sortBy | Pagination.Field | CREATED (default) |
Enums
| Enum | Values |
|---|---|
| TransactionType | PURCHASE, AUTHORIZE, CAPTURE, REFUND, REVERSAL, VOID, CASHBACK, CHANGE_PIN, CARD_ACTIVATION (returned by Transaction.transactionType(); each operation sets its own type) |
| FlowType | IMMEDIATE, STATUS, DETAIL |
| Env | DEMO (integration and testing, never charges a card), PRODUCTION (live payments). SANDBOX: legacy, do not use |
| Presentation | FULLSCREEN, DIALOG_CENTER, DIALOG_TOP_FILL, DIALOG_TOP_START, DIALOG_TOP_END, DIALOG_TOP_CENTER, DIALOG_BOTTOM_FILL, DIALOG_BOTTOM_START, DIALOG_BOTTOM_END, DIALOG_BOTTOM_CENTER |
| PurchaseSecondaryAction | NONE, REVERSE, REFUND |
| PaymentMethod | TAMARA, TABBY, CHECKOUT (used by invoicePayment), CONTACTLESS (card payments; invoicePayment does not accept it) |
| PluginExtension.ReceiptType | TRANSACTION, RECONCILIATION (online receipts, see Utility Functions) |
Imports (Kotlin and Java)
Packages of the classes the samples use. Every package starts with com.edfapay.paymentcard.
| Class | Package |
|---|---|
| EdfaPayPlugin, EdfaPayPluginJ, PluginUtils, EdfaException | com.edfapay.paymentcard |
| TxnParams, EdfaPayCredentials, TerminalBindingTask, SessionDetail, TransactionType, EdfaError | com.edfapay.paymentcard.model |
| Env, FlowType, PurchaseSecondaryAction | com.edfapay.paymentcard.model.enums |
| Pagination | com.edfapay.paymentcard.model.requests |
| Transaction, TxnResponse | com.edfapay.paymentcard.model.responses |
| Presentation | com.edfapay.paymentcard.ui.presentation |
On this page
Downloads
Coming SoonSample apps, release bundles, and more content will be available here soon.